@pie-element/multiple-choice 14.0.4-next.20261011174919 → 14.0.4

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,225 +1,213 @@
1
1
  import { generateValidationMessage as e } from "./utils.js";
2
2
  import t from "react";
3
- import n from "prop-types";
4
- import { color as r } from "@pie-lib/render-ui";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { styled as o } from "@mui/material/styles";
7
- import s from "@mui/material/Box";
8
- import { merge as c } from "@pie-element/shared-lodash";
9
- import l from "@pie-lib/editable-html-tip-tap";
10
- import { AlertDialog as u, ChoiceConfiguration as ee, InputContainer as d, choiceUtils as f, layout as te, settings as p } from "@pie-lib/config-ui";
11
- import m from "@mui/material/Button";
12
- import h from "@mui/material/Tooltip";
13
- import g from "@mui/material/Typography";
14
- import ne from "@mui/icons-material/Info";
3
+ import { color as n } from "@pie-lib/render-ui";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { styled as a } from "@mui/material/styles";
6
+ import o from "@mui/material/Box";
7
+ import { merge as s } from "@pie-element/shared-lodash";
8
+ import c from "@pie-lib/editable-html-tip-tap";
9
+ import { AlertDialog as ee, ChoiceConfiguration as te, InputContainer as l, choiceUtils as u, layout as ne, settings as d } from "@pie-lib/config-ui";
10
+ import f from "@mui/material/Button";
11
+ import p from "@mui/material/Tooltip";
12
+ import m from "@mui/material/Typography";
13
+ import re from "@mui/icons-material/Info";
15
14
  //#region src/author/main.tsx
16
- var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ theme: e }) => ({
15
+ var { Panel: ie, toggle: h, radio: g, dropdown: _ } = d, ae = 9, oe = a(l)(({ theme: e }) => ({
17
16
  width: "100%",
18
17
  paddingTop: e.spacing(2),
19
18
  marginBottom: e.spacing(2)
20
- })), ae = o(d)(({ theme: e }) => ({
19
+ })), se = a(l)(({ theme: e }) => ({
21
20
  flex: 1,
22
21
  marginTop: e.spacing(1.5),
23
22
  paddingTop: e.spacing(2),
24
23
  marginLeft: e.spacing(3.5)
25
- })), oe = o(d)(({ theme: e }) => ({
24
+ })), ce = a(l)(({ theme: e }) => ({
26
25
  display: "flex",
27
26
  flexDirection: "column",
28
27
  marginBottom: e.spacing(1),
29
28
  width: "100%"
30
- })), x = o(m)(({ theme: e }) => ({
29
+ })), v = a(f)(({ theme: e }) => ({
31
30
  marginTop: e.spacing(1),
32
31
  float: "right"
33
- })), se = o(x)({
32
+ })), le = a(v)({
34
33
  cursor: "not-allowed",
35
34
  pointerEvents: "all",
36
- backgroundColor: r.disabled(),
37
- "&:hover": { backgroundColor: r.disabled() },
38
- "&:focus": { backgroundColor: r.disabled() }
39
- }), ce = o(s)({
35
+ backgroundColor: n.disabled(),
36
+ "&:hover": { backgroundColor: n.disabled() },
37
+ "&:focus": { backgroundColor: n.disabled() }
38
+ }), ue = a(o)({
40
39
  display: "flex",
41
40
  alignItems: "center"
42
- }), le = o(g)(({ theme: e }) => ({
41
+ }), de = a(m)(({ theme: e }) => ({
43
42
  fontSize: e.typography.fontSize + 2,
44
43
  marginRight: e.spacing(1)
45
- })), S = o(h)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
44
+ })), y = a(p)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
46
45
  fontSize: e.typography.fontSize - 2,
47
46
  whiteSpace: "pre",
48
47
  maxWidth: "500px"
49
- } })), C = o("div")(({ theme: e }) => ({
48
+ } })), b = a("div")(({ theme: e }) => ({
50
49
  fontSize: e.typography.fontSize - 2,
51
50
  color: e.palette.error.main,
52
51
  paddingTop: e.spacing(1)
53
- })), ue = (t) => {
54
- let { model: n, configuration: r, onPromptChanged: o, onChoiceChanged: s, onRemoveChoice: c, onAddChoice: u, imageSupport: d, uploadSoundSupport: f, onChangeModel: p, onConfigurationChanged: m, onTeacherInstructionsChanged: h } = t, { addChoiceButton: g = {}, contentDimensions: ue = {}, feedback: w = {}, deleteChoice: de = {}, choiceMode: fe = {}, choicePrefix: T = {}, partialScoring: E = {}, lockChoiceOrder: D = {}, teacherInstructions: O = {}, studentInstructions: k = {}, rationale: A = {}, scoringType: j = {}, sequentialChoiceLabels: M = {}, settingsPanelDisabled: pe, choicesLayout: N, spellCheck: P = {}, gridColumns: me, maxImageWidth: F = {}, maxImageHeight: I = {}, prompt: L = {}, withRubric: R = {}, mathMlOptions: z = {}, language: B = {}, languageChoices: V = {} } = r || {}, { maxAnswerChoices: H } = r || {}, { limitChoicesNumber: he, teacherInstructionsEnabled: ge, rationaleEnabled: _e, feedbackEnabled: ve, promptEnabled: ye, spellCheckEnabled: U, choices: W, errors: be, toolbarEditorPosition: xe, extraCSSRules: Se } = n || {}, { answerChoices: G, choices: Ce, correctResponse: K, prompt: q, rationale: J, teacherInstructions: Y } = be || {}, we = W?.length ? Array.from({ length: W.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = r, X = { position: xe === "top" ? "top" : "bottom" };
55
- he && (H = b);
52
+ })), x = (t) => {
53
+ let { model: n, configuration: a, onPromptChanged: o, onChoiceChanged: s, onRemoveChoice: ee, onAddChoice: l, imageSupport: u, uploadSoundSupport: d, onChangeModel: f, onConfigurationChanged: p, onTeacherInstructionsChanged: m } = t, { addChoiceButton: x = {}, contentDimensions: S = {}, feedback: fe = {}, deleteChoice: pe = {}, choiceMode: C = {}, choicePrefix: w = {}, partialScoring: T = {}, lockChoiceOrder: E = {}, teacherInstructions: D = {}, studentInstructions: O = {}, rationale: k = {}, scoringType: A = {}, sequentialChoiceLabels: j = {}, settingsPanelDisabled: me, choicesLayout: M = {}, spellCheck: N = {}, gridColumns: he = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, prompt: I = {}, withRubric: L = {}, mathMlOptions: R = {}, language: z = {}, languageChoices: B = {} } = a || {}, { maxAnswerChoices: V } = a || {}, { limitChoicesNumber: ge, teacherInstructionsEnabled: _e, rationaleEnabled: ve, feedbackEnabled: ye, promptEnabled: be, spellCheckEnabled: H, choices: U, errors: xe, toolbarEditorPosition: Se, extraCSSRules: Ce } = n || {}, { answerChoices: W, choices: we, correctResponse: G, prompt: K, rationale: q, teacherInstructions: J } = xe || {}, Y = U?.length ? Array.from({ length: U.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = a, X = { position: Se === "top" ? "top" : "bottom" };
54
+ ge && (V = ae);
56
55
  let Z = (e = {}) => ({
57
56
  ...Te,
58
57
  ...e
59
- }), Ee = e(r), Q = F && F.prompt, $ = I && I.prompt, De = H && W?.length >= H ? `Only ${H} allowed maximum` : "", Oe = {
60
- choiceMode: fe.settings && v(fe.label, ["checkbox", "radio"]),
61
- "sequentialChoiceLabels.enabled": M.settings && _(M.label, !0),
62
- choicePrefix: T.settings && v(T.label, ["numbers", "letters"]),
63
- partialScoring: E.settings && _(E.label),
64
- lockChoiceOrder: D.settings && _(D.label),
65
- feedbackEnabled: w.settings && _(w.label),
66
- choicesLayout: N.settings && y(N.label, [
58
+ }), Ee = e(a), Q = P && P.prompt, $ = F && F.prompt, De = V && U?.length >= V ? `Only ${V} allowed maximum` : "", Oe = {
59
+ choiceMode: C.settings && g(C.label, ["checkbox", "radio"]),
60
+ "sequentialChoiceLabels.enabled": j.settings && h(j.label, !0),
61
+ choicePrefix: w.settings && g(w.label, ["numbers", "letters"]),
62
+ partialScoring: T.settings && h(T.label),
63
+ lockChoiceOrder: E.settings && h(E.label),
64
+ feedbackEnabled: fe.settings && h(fe.label),
65
+ choicesLayout: M.settings && _(M.label, [
67
66
  "vertical",
68
67
  "grid",
69
68
  "horizontal"
70
69
  ]),
71
- gridColumns: N.settings && n.choicesLayout === "grid" && we.length > 0 && y(me.label, we),
72
- "language.enabled": B.settings && _(B.label, !0),
73
- language: B.settings && B.enabled && y(V.label, V.options)
70
+ gridColumns: M.settings && n.choicesLayout === "grid" && Y.length > 0 && _(he.label, Y),
71
+ "language.enabled": z.settings && h(z.label, !0),
72
+ language: z.settings && z.enabled && _(B.label, B.options)
74
73
  }, ke = {
75
- teacherInstructionsEnabled: O.settings && _(O.label),
76
- studentInstructionsEnabled: k.settings && _(k.label),
77
- promptEnabled: L.settings && _(L.label),
78
- rationaleEnabled: A.settings && _(A.label),
79
- spellCheckEnabled: P.settings && _(P.label),
80
- scoringType: j.settings && v(j.label, ["auto", "rubric"]),
81
- rubricEnabled: R?.settings && _(R?.label)
74
+ teacherInstructionsEnabled: D.settings && h(D.label),
75
+ studentInstructionsEnabled: O.settings && h(O.label),
76
+ promptEnabled: I.settings && h(I.label),
77
+ rationaleEnabled: k.settings && h(k.label),
78
+ spellCheckEnabled: N.settings && h(N.label),
79
+ scoringType: A.settings && g(A.label, ["auto", "rubric"]),
80
+ rubricEnabled: L?.settings && h(L?.label)
82
81
  };
83
- return /* @__PURE__ */ a(te.ConfigLayout, {
84
- dimensions: ue,
85
- hideSettings: pe,
86
- extraCSSRules: Se,
82
+ return /* @__PURE__ */ i(ne.ConfigLayout, {
83
+ dimensions: S,
84
+ hideSettings: me,
85
+ extraCSSRules: Ce,
87
86
  classes: {},
88
- settings: /* @__PURE__ */ i(re, {
87
+ settings: /* @__PURE__ */ r(ie, {
89
88
  model: n,
90
- onChangeModel: p,
91
- configuration: r,
92
- onChangeConfiguration: m,
89
+ onChangeModel: f,
90
+ configuration: a,
91
+ onChangeConfiguration: p,
93
92
  groups: {
94
93
  Settings: Oe,
95
94
  Properties: ke
96
95
  }
97
96
  }),
98
97
  children: [
99
- ge && /* @__PURE__ */ a(ie, {
100
- label: O.label,
101
- children: [/* @__PURE__ */ i(l, {
98
+ _e && /* @__PURE__ */ i(oe, {
99
+ label: D.label,
100
+ children: [/* @__PURE__ */ r(c, {
102
101
  markup: n.teacherInstructions || "",
103
- onChange: h,
104
- imageSupport: d,
102
+ onChange: m,
103
+ imageSupport: u,
105
104
  nonEmpty: !1,
106
105
  disableUnderline: !0,
107
- error: Y,
106
+ error: J,
108
107
  toolbarOpts: X,
109
- pluginProps: Z(r?.teacherInstructions?.inputConfiguration),
110
- spellCheck: U,
111
- maxImageWidth: F && F.teacherInstructions || Q,
112
- maxImageHeight: I && I.teacherInstructions || $,
113
- uploadSoundSupport: f,
108
+ pluginProps: Z(a?.teacherInstructions?.inputConfiguration),
109
+ spellCheck: H,
110
+ maxImageWidth: P && P.teacherInstructions || Q,
111
+ maxImageHeight: F && F.teacherInstructions || $,
112
+ uploadSoundSupport: d,
114
113
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
115
- mathMlOptions: z
116
- }), Y && /* @__PURE__ */ i(C, { children: Y })]
114
+ mathMlOptions: R
115
+ }), J && /* @__PURE__ */ r(b, { children: J })]
117
116
  }),
118
- ye && /* @__PURE__ */ a(ie, {
119
- label: L.label,
120
- children: [/* @__PURE__ */ i(l, {
117
+ be && /* @__PURE__ */ i(oe, {
118
+ label: I.label,
119
+ children: [/* @__PURE__ */ r(c, {
121
120
  markup: n.prompt,
122
121
  onChange: o,
123
- imageSupport: d,
122
+ imageSupport: u,
124
123
  nonEmpty: !1,
125
124
  disableUnderline: !0,
126
- error: q,
125
+ error: K,
127
126
  toolbarOpts: X,
128
- pluginProps: Z(r?.prompt?.inputConfiguration),
129
- spellCheck: U,
130
- maxImageWidth: F && F.prompt,
131
- maxImageHeight: I && I.prompt,
132
- uploadSoundSupport: f,
127
+ pluginProps: Z(a?.prompt?.inputConfiguration),
128
+ spellCheck: H,
129
+ maxImageWidth: P && P.prompt,
130
+ maxImageHeight: F && F.prompt,
131
+ uploadSoundSupport: d,
133
132
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
134
- mathMlOptions: z
135
- }), q && /* @__PURE__ */ i(C, { children: q })]
133
+ mathMlOptions: R
134
+ }), K && /* @__PURE__ */ r(b, { children: K })]
136
135
  }),
137
- /* @__PURE__ */ a(ce, { children: [/* @__PURE__ */ i(le, {
136
+ /* @__PURE__ */ i(ue, { children: [/* @__PURE__ */ r(de, {
138
137
  component: "div",
139
138
  children: "Choices"
140
- }), /* @__PURE__ */ i(S, {
139
+ }), /* @__PURE__ */ r(y, {
141
140
  disableFocusListener: !0,
142
141
  disableTouchListener: !0,
143
142
  placement: "right",
144
143
  title: Ee,
145
- children: /* @__PURE__ */ i(ne, {
144
+ children: /* @__PURE__ */ r(re, {
146
145
  fontSize: "small",
147
146
  color: "primary"
148
147
  })
149
148
  })] }),
150
- W.map((e, t) => /* @__PURE__ */ a(oe, { children: [/* @__PURE__ */ i(ee, {
149
+ U.map((e, t) => /* @__PURE__ */ i(ce, { children: [/* @__PURE__ */ r(te, {
151
150
  index: t + 1,
152
151
  useLetterOrdering: n.choicePrefix === "letters",
153
152
  mode: n.choiceMode,
154
153
  data: e,
155
154
  defaultFeedback: {},
156
- imageSupport: d,
155
+ imageSupport: u,
157
156
  disableImageAlignmentButtons: !0,
158
- onDelete: () => c(t),
157
+ onDelete: () => ee(t),
159
158
  onChange: (e) => s(t, e),
160
- allowFeedBack: ve,
161
- allowDelete: de.settings,
159
+ allowFeedBack: ye,
160
+ allowDelete: pe.settings,
162
161
  noLabels: !0,
163
- pluginOpts: Z(r?.choices?.inputConfiguration),
162
+ pluginOpts: Z(a?.choices?.inputConfiguration),
164
163
  toolbarOpts: X,
165
- spellCheck: U,
166
- error: Ce?.[e.value] || null,
167
- noCorrectAnswerError: K,
168
- maxImageWidth: F && F.choices || Q,
169
- maxImageHeight: I && I.choices || $,
170
- uploadSoundSupport: f,
171
- mathMlOptions: z
172
- }, t), _e && /* @__PURE__ */ a(ae, {
173
- label: A.label,
174
- children: [/* @__PURE__ */ i(l, {
164
+ spellCheck: H,
165
+ error: we?.[e.value] || null,
166
+ noCorrectAnswerError: G,
167
+ maxImageWidth: P && P.choices || Q,
168
+ maxImageHeight: F && F.choices || $,
169
+ uploadSoundSupport: d,
170
+ mathMlOptions: R
171
+ }, t), ve && /* @__PURE__ */ i(se, {
172
+ label: k.label,
173
+ children: [/* @__PURE__ */ r(c, {
175
174
  markup: e.rationale || "",
176
175
  onChange: (n) => s(t, {
177
176
  ...e,
178
177
  rationale: n
179
178
  }),
180
- imageSupport: d,
181
- error: J?.[e.value] || null,
179
+ imageSupport: u,
180
+ error: q?.[e.value] || null,
182
181
  toolbarOpts: X,
183
- pluginProps: Z(r?.rationale?.inputConfiguration),
184
- spellCheck: U,
185
- maxImageWidth: F && F.rationale || Q,
186
- maxImageHeight: I && I.rationale || $,
187
- uploadSoundSupport: f,
182
+ pluginProps: Z(a?.rationale?.inputConfiguration),
183
+ spellCheck: H,
184
+ maxImageWidth: P && P.rationale || Q,
185
+ maxImageHeight: F && F.rationale || $,
186
+ uploadSoundSupport: d,
188
187
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
189
- mathMlOptions: z
190
- }), J?.[e.value] && /* @__PURE__ */ i(C, { children: J?.[e.value] })]
188
+ mathMlOptions: R
189
+ }), q?.[e.value] && /* @__PURE__ */ r(b, { children: q?.[e.value] })]
191
190
  }, `rationale-${t}`)] }, `choice-${t}`)),
192
- K && /* @__PURE__ */ i(C, { children: K }),
193
- G && /* @__PURE__ */ i(C, { children: G }),
194
- g.settings && /* @__PURE__ */ i(S, {
191
+ G && /* @__PURE__ */ r(b, { children: G }),
192
+ W && /* @__PURE__ */ r(b, { children: W }),
193
+ x.settings && /* @__PURE__ */ r(y, {
195
194
  title: De,
196
- children: H && W?.length >= H ? /* @__PURE__ */ i(se, {
195
+ children: V && U?.length >= V ? /* @__PURE__ */ r(le, {
197
196
  variant: "contained",
198
197
  color: "primary",
199
- onClick: u,
198
+ onClick: l,
200
199
  disabled: !0,
201
- children: g.label
202
- }) : /* @__PURE__ */ i(x, {
200
+ children: x.label
201
+ }) : /* @__PURE__ */ r(v, {
203
202
  variant: "contained",
204
203
  color: "primary",
205
- onClick: u,
206
- children: g.label
204
+ onClick: l,
205
+ children: x.label
207
206
  })
208
207
  })
209
208
  ]
210
209
  });
211
- }, w = class extends t.Component {
212
- static propTypes = {
213
- model: n.object.isRequired,
214
- configuration: n.object.isRequired,
215
- disableSidePanel: n.bool,
216
- onModelChanged: n.func.isRequired,
217
- onConfigurationChanged: n.func.isRequired,
218
- imageSupport: n.shape({
219
- add: n.func.isRequired,
220
- delete: n.func.isRequired
221
- })
222
- };
210
+ }, S = class extends t.Component {
223
211
  state = { showWarning: !1 };
224
212
  onRemoveChoice = (e) => {
225
213
  let { model: t, configuration: n, onModelChanged: r } = this.props, { minAnswerChoices: i } = n || {};
@@ -231,15 +219,15 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
231
219
  };
232
220
  onAddChoice = () => {
233
221
  let { model: e, configuration: t, onModelChanged: n } = this.props, { maxAnswerChoices: r } = t || {}, { limitChoicesNumber: i } = e || {};
234
- i && (r = b), !(r && e.choices.length >= r) && (e.choices.push({
222
+ i && (r = ae), !(r && e.choices.length >= r) && (e.choices.push({
235
223
  label: "",
236
- value: f.firstAvailableIndex(e.choices.map((e) => e.value), 0),
224
+ value: u.firstAvailableIndex(e.choices.map((e) => e.value), 0),
237
225
  feedback: { type: "none" }
238
226
  }), n({ choices: e.choices }));
239
227
  };
240
228
  onChoiceChanged = (e, t) => {
241
229
  let { model: n, onModelChanged: r } = this.props;
242
- t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) => c({}, e, { correct: !1 }))), n.choices.splice(e, 1, t), r({ choices: n.choices });
230
+ t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) => s({}, e, { correct: !1 }))), n.choices.splice(e, 1, t), r({ choices: n.choices });
243
231
  };
244
232
  onPromptChanged = (e) => {
245
233
  this.props.onModelChanged({ prompt: e });
@@ -267,12 +255,12 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
267
255
  };
268
256
  render() {
269
257
  let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: n } = this.state;
270
- return /* @__PURE__ */ a(t.Fragment, { children: [/* @__PURE__ */ i(u, {
258
+ return /* @__PURE__ */ i(t.Fragment, { children: [/* @__PURE__ */ r(ee, {
271
259
  open: n,
272
260
  title: "Warning",
273
261
  text: `There can't be less than ${e || 0} choices.`,
274
262
  onConfirm: () => this.setState({ showWarning: !1 })
275
- }), /* @__PURE__ */ i(ue, {
263
+ }), /* @__PURE__ */ r(x, {
276
264
  ...this.props,
277
265
  onChangeModel: this.onModelChanged,
278
266
  onRemoveChoice: this.onRemoveChoice,
@@ -284,4 +272,4 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
284
272
  }
285
273
  };
286
274
  //#endregion
287
- export { w as Main, w as default };
275
+ export { S as Main, S as default };
@@ -1 +1,2 @@
1
- export declare const generateValidationMessage: (config: any) => string;
1
+ import type { MultipleChoiceConfiguration } from '../types.js';
2
+ export declare const generateValidationMessage: (config: MultipleChoiceConfiguration) => string;
@@ -34214,7 +34214,8 @@ var BH = We, VH = BH.default, HH = VH && typeof VH == "object" ? VH : BH, UH = z
34214
34214
  toolbarOpts: H.default.object,
34215
34215
  uploadSoundSupport: H.default.object,
34216
34216
  maxImageWidth: H.default.number,
34217
- maxImageHeight: H.default.number
34217
+ maxImageHeight: H.default.number,
34218
+ mathMlOptions: H.default.object
34218
34219
  };
34219
34220
  static defaultProps = {
34220
34221
  index: -1,
@@ -35167,15 +35168,12 @@ var IW = class extends _t.Component {
35167
35168
  }), BW = (e) => typeof e == "string" ? {
35168
35169
  label: e,
35169
35170
  value: e
35170
- } : e, VW = function() {
35171
- let [e, t, n = !1] = Array.prototype.slice.call(arguments);
35172
- return {
35173
- type: "radio",
35174
- label: e,
35175
- choices: t && t.map((e) => BW(e)),
35176
- isConfigProperty: n
35177
- };
35178
- }, HW = (e, t, n = !1) => ({
35171
+ } : e, VW = (e, t, n = !1) => ({
35172
+ type: "radio",
35173
+ label: e,
35174
+ choices: t && t.map((e) => BW(e)),
35175
+ isConfigProperty: n
35176
+ }), HW = (e, t, n = !1) => ({
35179
35177
  type: "dropdown",
35180
35178
  label: e,
35181
35179
  choices: t,
@@ -35252,7 +35250,7 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
35252
35250
  color: e.palette.error.main,
35253
35251
  paddingTop: e.spacing(1)
35254
35252
  })), hG = (e) => {
35255
- let { model: t, configuration: n, onPromptChanged: r, onChoiceChanged: i, onRemoveChoice: a, onAddChoice: o, imageSupport: s, uploadSoundSupport: c, onChangeModel: l, onConfigurationChanged: u, onTeacherInstructionsChanged: d } = e, { addChoiceButton: f = {}, contentDimensions: p = {}, feedback: m = {}, deleteChoice: h = {}, choiceMode: g = {}, choicePrefix: _ = {}, partialScoring: v = {}, lockChoiceOrder: y = {}, teacherInstructions: b = {}, studentInstructions: x = {}, rationale: S = {}, scoringType: C = {}, sequentialChoiceLabels: ee = {}, settingsPanelDisabled: w, choicesLayout: T, spellCheck: te = {}, gridColumns: ne, maxImageWidth: re = {}, maxImageHeight: E = {}, prompt: ie = {}, withRubric: ae = {}, mathMlOptions: oe = {}, language: se = {}, languageChoices: ce = {} } = n || {}, { maxAnswerChoices: le } = n || {}, { limitChoicesNumber: ue, teacherInstructionsEnabled: de, rationaleEnabled: D, feedbackEnabled: O, promptEnabled: fe, spellCheckEnabled: pe, choices: k, errors: me, toolbarEditorPosition: he, extraCSSRules: ge } = t || {}, { answerChoices: _e, choices: ve, correctResponse: ye, prompt: be, rationale: xe, teacherInstructions: Se } = me || {}, Ce = k?.length ? Array.from({ length: k.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: we = {} } = n, Te = { position: he === "top" ? "top" : "bottom" };
35253
+ let { model: t, configuration: n, onPromptChanged: r, onChoiceChanged: i, onRemoveChoice: a, onAddChoice: o, imageSupport: s, uploadSoundSupport: c, onChangeModel: l, onConfigurationChanged: u, onTeacherInstructionsChanged: d } = e, { addChoiceButton: f = {}, contentDimensions: p = {}, feedback: m = {}, deleteChoice: h = {}, choiceMode: g = {}, choicePrefix: _ = {}, partialScoring: v = {}, lockChoiceOrder: y = {}, teacherInstructions: b = {}, studentInstructions: x = {}, rationale: S = {}, scoringType: C = {}, sequentialChoiceLabels: ee = {}, settingsPanelDisabled: w, choicesLayout: T = {}, spellCheck: te = {}, gridColumns: ne = {}, maxImageWidth: re = {}, maxImageHeight: E = {}, prompt: ie = {}, withRubric: ae = {}, mathMlOptions: oe = {}, language: se = {}, languageChoices: ce = {} } = n || {}, { maxAnswerChoices: le } = n || {}, { limitChoicesNumber: ue, teacherInstructionsEnabled: de, rationaleEnabled: D, feedbackEnabled: O, promptEnabled: fe, spellCheckEnabled: pe, choices: k, errors: me, toolbarEditorPosition: he, extraCSSRules: ge } = t || {}, { answerChoices: _e, choices: ve, correctResponse: ye, prompt: be, rationale: xe, teacherInstructions: Se } = me || {}, Ce = k?.length ? Array.from({ length: k.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: we = {} } = n, Te = { position: he === "top" ? "top" : "bottom" };
35256
35254
  ue && (le = aG);
35257
35255
  let A = (e = {}) => ({
35258
35256
  ...we,
@@ -35410,17 +35408,6 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
35410
35408
  ]
35411
35409
  });
35412
35410
  }, gG = class extends _t.Component {
35413
- static propTypes = {
35414
- model: H.default.object.isRequired,
35415
- configuration: H.default.object.isRequired,
35416
- disableSidePanel: H.default.bool,
35417
- onModelChanged: H.default.func.isRequired,
35418
- onConfigurationChanged: H.default.func.isRequired,
35419
- imageSupport: H.default.shape({
35420
- add: H.default.func.isRequired,
35421
- delete: H.default.func.isRequired
35422
- })
35423
- };
35424
35411
  state = { showWarning: !1 };
35425
35412
  onRemoveChoice = (e) => {
35426
35413
  let { model: t, configuration: n, onModelChanged: r } = this.props, { minAnswerChoices: i } = n || {};
@@ -35654,6 +35641,11 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
35654
35641
  }
35655
35642
  };
35656
35643
  }, xG = class e extends HTMLElement {
35644
+ _root;
35645
+ _reactContainer;
35646
+ _model;
35647
+ _configuration;
35648
+ _disableSidePanel;
35657
35649
  static createDefaultModel = (e = {}) => {
35658
35650
  let t = oW.normalizeChoices({
35659
35651
  ..._G.model,
@@ -35675,7 +35667,7 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
35675
35667
  ..._G.configuration,
35676
35668
  ...t.configuration
35677
35669
  };
35678
- this._configuration = n, n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
35670
+ this._configuration = n, n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []), n.languageChoices.options.find((e) => e.value === this._model.language) || n.languageChoices.options.push({
35679
35671
  value: this._model.language,
35680
35672
  label: this._model.language
35681
35673
  })) : delete this._model.language, this._render();