@pie-element/extended-text-entry 15.1.2-next.1 → 15.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 (100) hide show
  1. package/CHANGELOG.json +1282 -0
  2. package/CHANGELOG.md +2270 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +1 -0
  5. package/configure/CHANGELOG.json +922 -0
  6. package/configure/CHANGELOG.md +1959 -0
  7. package/configure/lib/defaults.js +224 -0
  8. package/configure/lib/defaults.js.map +1 -0
  9. package/configure/lib/index.js +125 -0
  10. package/configure/lib/index.js.map +1 -0
  11. package/configure/lib/main.js +247 -0
  12. package/configure/lib/main.js.map +1 -0
  13. package/configure/package.json +23 -0
  14. package/controller/CHANGELOG.json +362 -0
  15. package/controller/CHANGELOG.md +1183 -0
  16. package/controller/lib/defaults.js +91 -0
  17. package/controller/lib/defaults.js.map +1 -0
  18. package/controller/lib/index.js +101 -0
  19. package/controller/lib/index.js.map +1 -0
  20. package/controller/package.json +16 -0
  21. package/docs/config-schema.json +1782 -0
  22. package/docs/config-schema.json.md +1333 -0
  23. package/docs/demo/config.js +7 -0
  24. package/docs/demo/generate.js +14 -0
  25. package/docs/demo/index.html +3 -0
  26. package/docs/demo/session.js +7 -0
  27. package/docs/pie-schema.json +954 -0
  28. package/docs/pie-schema.json.md +717 -0
  29. package/lib/annotation/annotation-editor.js +636 -0
  30. package/lib/annotation/annotation-editor.js.map +1 -0
  31. package/lib/annotation/annotation-menu.js +147 -0
  32. package/lib/annotation/annotation-menu.js.map +1 -0
  33. package/lib/annotation/annotation-utils.js +205 -0
  34. package/lib/annotation/annotation-utils.js.map +1 -0
  35. package/lib/annotation/freeform-editor.js +241 -0
  36. package/lib/annotation/freeform-editor.js.map +1 -0
  37. package/lib/index.js +108 -0
  38. package/lib/index.js.map +1 -0
  39. package/lib/main.js +205 -0
  40. package/lib/main.js.map +1 -0
  41. package/lib/print.js +86 -0
  42. package/lib/print.js.map +1 -0
  43. package/module/configure.js +1 -0
  44. package/module/controller.js +139 -0
  45. package/module/demo.js +38 -0
  46. package/module/element.js +1 -0
  47. package/module/index.html +21 -0
  48. package/module/manifest.json +22 -0
  49. package/module/print-demo.js +76 -0
  50. package/module/print.html +18 -0
  51. package/module/print.js +1 -0
  52. package/package.json +22 -88
  53. package/configure.js +0 -2
  54. package/controller.js +0 -1
  55. package/dist/author/defaults.d.ts +0 -166
  56. package/dist/author/defaults.js +0 -209
  57. package/dist/author/index.d.ts +0 -52
  58. package/dist/author/index.js +0 -74
  59. package/dist/author/main.d.ts +0 -26
  60. package/dist/author/main.js +0 -166
  61. package/dist/browser/author/index.js +0 -495
  62. package/dist/browser/author/index.js.map +0 -1
  63. package/dist/browser/browser-kkT1XVKw.js +0 -219
  64. package/dist/browser/browser-kkT1XVKw.js.map +0 -1
  65. package/dist/browser/controller/index.js +0 -184
  66. package/dist/browser/controller/index.js.map +0 -1
  67. package/dist/browser/delivery/index.js +0 -98
  68. package/dist/browser/delivery/index.js.map +0 -1
  69. package/dist/browser/dist-CfUys1Kx.js +0 -47872
  70. package/dist/browser/dist-CfUys1Kx.js.map +0 -1
  71. package/dist/browser/extended-text-entry.css +0 -2
  72. package/dist/browser/main-BVg6yw7a.js +0 -714
  73. package/dist/browser/main-BVg6yw7a.js.map +0 -1
  74. package/dist/browser/print/index.js +0 -48
  75. package/dist/browser/print/index.js.map +0 -1
  76. package/dist/controller/defaults.d.ts +0 -33
  77. package/dist/controller/defaults.js +0 -104
  78. package/dist/controller/index.d.ts +0 -59
  79. package/dist/controller/index.js +0 -72
  80. package/dist/delivery/annotation/annotation-editor.d.ts +0 -47
  81. package/dist/delivery/annotation/annotation-editor.js +0 -296
  82. package/dist/delivery/annotation/annotation-menu.d.ts +0 -25
  83. package/dist/delivery/annotation/annotation-menu.js +0 -113
  84. package/dist/delivery/annotation/annotation-utils.d.ts +0 -20
  85. package/dist/delivery/annotation/annotation-utils.js +0 -65
  86. package/dist/delivery/annotation/freeform-editor.d.ts +0 -30
  87. package/dist/delivery/annotation/freeform-editor.js +0 -143
  88. package/dist/delivery/index.d.ts +0 -23
  89. package/dist/delivery/index.js +0 -68
  90. package/dist/delivery/main.d.ts +0 -27
  91. package/dist/delivery/main.js +0 -134
  92. package/dist/extended-text-entry.css +0 -2
  93. package/dist/index.d.ts +0 -1
  94. package/dist/index.iife.d.ts +0 -8
  95. package/dist/index.iife.js +0 -403
  96. package/dist/index.js +0 -2
  97. package/dist/print/index.d.ts +0 -15
  98. package/dist/print/index.js +0 -48
  99. package/dist/runtime-support.d.ts +0 -12
  100. package/dist/runtime-support.js +0 -12
@@ -1,166 +0,0 @@
1
- import e from "react";
2
- import t from "prop-types";
3
- import n from "@mui/material/Typography";
4
- import { styled as r } from "@mui/material/styles";
5
- import i, { ALL_PLUGINS as a } from "@pie-lib/editable-html-tip-tap";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { FeedbackSelector as c, InputContainer as l, layout as u, settings as d } from "@pie-lib/config-ui";
8
- //#region src/author/main.tsx
9
- var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
10
- type: "default",
11
- default: "Your answer has been submitted"
12
- }, _ = r(n)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), v = r(l)(({ theme: e }) => ({
13
- paddingTop: e.spacing(1),
14
- marginTop: e.spacing(2),
15
- marginBottom: e.spacing(2),
16
- width: "100%"
17
- })), y = r("div")(({ theme: e }) => ({
18
- fontSize: e.typography.fontSize - 2,
19
- color: e.palette.error.main,
20
- paddingTop: e.spacing(1)
21
- })), b = class extends e.Component {
22
- static propTypes = {
23
- onModelChanged: t.func.isRequired,
24
- onConfigurationChanged: t.func,
25
- model: t.object.isRequired,
26
- configuration: t.object.isRequired,
27
- imageSupport: t.object.isRequired,
28
- uploadSoundSupport: t.object.isRequired
29
- };
30
- constructor(e) {
31
- super(e), this.state = { setDimensions: !0 };
32
- }
33
- onPromptChange = (e) => {
34
- let { onModelChanged: t, model: n } = this.props;
35
- t({
36
- ...n,
37
- prompt: e
38
- });
39
- };
40
- changeFeedback = (e) => {
41
- let { model: t, onModelChanged: n } = this.props;
42
- n({
43
- ...t,
44
- feedback: e
45
- });
46
- };
47
- changeTeacherInstructions = (e) => {
48
- let { model: t, onModelChanged: n } = this.props;
49
- n({
50
- ...t,
51
- teacherInstructions: e
52
- });
53
- };
54
- render() {
55
- let { model: t, configuration: n, imageSupport: r, onConfigurationChanged: l, onModelChanged: d, uploadSoundSupport: b } = this.props, { annotations: x = {}, contentDimensions: S = {}, dimensions: C = {}, equationEditor: w = {}, feedback: T = {}, playerSpellCheck: E = {}, prompt: D = {}, settingsPanelDisabled: ee, spanishInput: O = {}, specialInput: k = {}, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, mathInput: N = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, multiple: I = {}, withRubric: L = {}, mathMlOptions: R = {}, baseInputConfiguration: z = {} } = n || {}, { errors: B = {}, extraCSSRules: V, feedbackEnabled: H, promptEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = t || {}, { prompt: q, teacherInstructions: J } = B, Y = P && P.prompt, X = F && F.prompt, Z = { position: K === "top" ? "top" : "bottom" }, Q = {
56
- mathInput: N.settings && p(N.label),
57
- equationEditor: w.enabled && t.mathInput && h(w.label, [
58
- "non-negative-integers",
59
- "integers",
60
- "decimals",
61
- "fractions",
62
- "Grade 1 - 2",
63
- "Grade 3 - 5",
64
- "Grade 6 - 7",
65
- "Grade 8 - HS",
66
- "geometry",
67
- "advanced-algebra",
68
- "statistics",
69
- "item-authoring"
70
- ]),
71
- spanishInput: O.settings && p(O.label),
72
- specialInput: k.settings && p(k.label),
73
- dimensions: C.settings && m(C.label, {
74
- width: {
75
- label: "Width (px)",
76
- suffix: "px",
77
- min: 100,
78
- max: 1200
79
- },
80
- height: {
81
- label: "Height (px)",
82
- suffix: "px",
83
- min: 100,
84
- max: 500
85
- }
86
- }),
87
- "multiple.enabled": I.settings && p(I.label, !0),
88
- promptEnabled: D.settings && p(D.label),
89
- feedbackEnabled: T.settings && p(T.label),
90
- annotationsEnabled: x.settings && p(x.label),
91
- spellCheckEnabled: A.settings && p(A.label),
92
- playerSpellCheckDisabled: E.settings && p(E.label)
93
- }, te = {
94
- teacherInstructionsEnabled: M.settings && p(M.label),
95
- studentInstructionsEnabled: j.settings && p(j.label),
96
- rubricEnabled: L?.settings && p(L?.label)
97
- }, $ = (e) => Object.assign({ ...z }, e || {});
98
- return /* @__PURE__ */ s(u.ConfigLayout, {
99
- extraCSSRules: V,
100
- dimensions: S,
101
- hideSettings: ee,
102
- settings: /* @__PURE__ */ o(f, {
103
- model: t,
104
- configuration: n,
105
- onChangeModel: (e) => d(e),
106
- onChangeConfiguration: (e) => l(e),
107
- groups: {
108
- Settings: Q,
109
- Properties: te
110
- }
111
- }),
112
- children: [
113
- G && /* @__PURE__ */ s(v, {
114
- label: M.label,
115
- children: [/* @__PURE__ */ o(i, {
116
- className: "prompt",
117
- markup: t.teacherInstructions || "",
118
- onChange: this.changeTeacherInstructions,
119
- imageSupport: r,
120
- nonEmpty: !1,
121
- error: J,
122
- toolbarOpts: Z,
123
- spellCheck: W,
124
- maxImageWidth: P && P.teacherInstructions || Y,
125
- maxImageHeight: F && F.teacherInstructions || X,
126
- uploadSoundSupport: b,
127
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
128
- mathMlOptions: R,
129
- pluginProps: $(M?.inputConfiguration)
130
- }), J && /* @__PURE__ */ o(y, { children: J })]
131
- }),
132
- U && /* @__PURE__ */ s(v, {
133
- label: D.label,
134
- children: [/* @__PURE__ */ o(i, {
135
- activePlugins: a,
136
- className: "prompt",
137
- markup: t.prompt || "",
138
- onChange: this.onPromptChange,
139
- imageSupport: r,
140
- nonEmpty: !1,
141
- error: q,
142
- toolbarOpts: Z,
143
- spellCheck: W,
144
- maxImageWidth: Y,
145
- maxImageHeight: X,
146
- uploadSoundSupport: b,
147
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
148
- mathMlOptions: R,
149
- pluginProps: $(D?.inputConfiguration)
150
- }), q && /* @__PURE__ */ o(y, { children: q })]
151
- }),
152
- H && /* @__PURE__ */ s(e.Fragment, { children: [/* @__PURE__ */ o(_, {
153
- variant: "h6",
154
- children: "Feedback"
155
- }), /* @__PURE__ */ o(c, {
156
- label: "When submitted, show",
157
- feedback: t.feedback || g,
158
- onChange: this.changeFeedback,
159
- toolbarOpts: Z
160
- })] })
161
- ]
162
- });
163
- }
164
- };
165
- //#endregion
166
- export { b as default };
@@ -1,495 +0,0 @@
1
- import { a as e } from "../browser-kkT1XVKw.js";
2
- import { _ as t, a as n, b as r, g as i, h as a, i as o, n as s, r as c, t as l } from "../dist-CfUys1Kx.js";
3
- import u from "react";
4
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
- import { createRoot as p } from "react-dom/client";
6
- //#region ../../shared/configure-events/dist/index.js
7
- var m = class e extends CustomEvent {
8
- static {
9
- this.TYPE = "model.updated";
10
- }
11
- constructor(t, n = !1) {
12
- super(e.TYPE, {
13
- bubbles: !0,
14
- detail: {
15
- update: t,
16
- reset: n
17
- }
18
- }), this.update = t, this.reset = n;
19
- }
20
- }, h = class e extends CustomEvent {
21
- static {
22
- this.TYPE = "delete.image";
23
- }
24
- constructor(t, n) {
25
- super(e.TYPE, {
26
- bubbles: !0,
27
- detail: {
28
- src: t,
29
- done: n
30
- }
31
- }), this.src = t, this.done = n;
32
- }
33
- }, g = class e extends CustomEvent {
34
- static {
35
- this.TYPE = "insert.image";
36
- }
37
- constructor(t) {
38
- super(e.TYPE, {
39
- bubbles: !0,
40
- detail: t
41
- }), this.handler = t;
42
- }
43
- }, _ = class e extends CustomEvent {
44
- static {
45
- this.TYPE = "delete.sound";
46
- }
47
- constructor(t, n) {
48
- super(e.TYPE, {
49
- bubbles: !0,
50
- detail: {
51
- src: t,
52
- done: n
53
- }
54
- }), this.src = t, this.done = n;
55
- }
56
- }, v = class e extends CustomEvent {
57
- static {
58
- this.TYPE = "insert.sound";
59
- }
60
- constructor(t) {
61
- super(e.TYPE, {
62
- bubbles: !0,
63
- detail: t
64
- }), this.handler = t;
65
- }
66
- }, y = /* @__PURE__ */ e(r(), 1), { Panel: b, toggle: x, numberFields: S, dropdown: C } = s, w = {
67
- type: "default",
68
- default: "Your answer has been submitted"
69
- }, T = t(i)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), E = t(l)(({ theme: e }) => ({
70
- paddingTop: e.spacing(1),
71
- marginTop: e.spacing(2),
72
- marginBottom: e.spacing(2),
73
- width: "100%"
74
- })), D = t("div")(({ theme: e }) => ({
75
- fontSize: e.typography.fontSize - 2,
76
- color: e.palette.error.main,
77
- paddingTop: e.spacing(1)
78
- })), O = class extends u.Component {
79
- static propTypes = {
80
- onModelChanged: y.default.func.isRequired,
81
- onConfigurationChanged: y.default.func,
82
- model: y.default.object.isRequired,
83
- configuration: y.default.object.isRequired,
84
- imageSupport: y.default.object.isRequired,
85
- uploadSoundSupport: y.default.object.isRequired
86
- };
87
- constructor(e) {
88
- super(e), this.state = { setDimensions: !0 };
89
- }
90
- onPromptChange = (e) => {
91
- let { onModelChanged: t, model: n } = this.props;
92
- t({
93
- ...n,
94
- prompt: e
95
- });
96
- };
97
- changeFeedback = (e) => {
98
- let { model: t, onModelChanged: n } = this.props;
99
- n({
100
- ...t,
101
- feedback: e
102
- });
103
- };
104
- changeTeacherInstructions = (e) => {
105
- let { model: t, onModelChanged: n } = this.props;
106
- n({
107
- ...t,
108
- teacherInstructions: e
109
- });
110
- };
111
- render() {
112
- let { model: e, configuration: t, imageSupport: r, onConfigurationChanged: i, onModelChanged: s, uploadSoundSupport: l } = this.props, { annotations: p = {}, contentDimensions: m = {}, dimensions: h = {}, equationEditor: g = {}, feedback: _ = {}, playerSpellCheck: v = {}, prompt: y = {}, settingsPanelDisabled: O, spanishInput: k = {}, specialInput: A = {}, spellCheck: j = {}, studentInstructions: M = {}, teacherInstructions: N = {}, mathInput: P = {}, maxImageWidth: F = {}, maxImageHeight: I = {}, multiple: L = {}, withRubric: R = {}, mathMlOptions: z = {}, baseInputConfiguration: B = {} } = t || {}, { errors: V = {}, extraCSSRules: H, feedbackEnabled: U, promptEnabled: W, spellCheckEnabled: G, teacherInstructionsEnabled: K, toolbarEditorPosition: q } = e || {}, { prompt: J, teacherInstructions: Y } = V, X = F && F.prompt, Z = I && I.prompt, Q = { position: q === "top" ? "top" : "bottom" }, ee = {
113
- mathInput: P.settings && x(P.label),
114
- equationEditor: g.enabled && e.mathInput && C(g.label, [
115
- "non-negative-integers",
116
- "integers",
117
- "decimals",
118
- "fractions",
119
- "Grade 1 - 2",
120
- "Grade 3 - 5",
121
- "Grade 6 - 7",
122
- "Grade 8 - HS",
123
- "geometry",
124
- "advanced-algebra",
125
- "statistics",
126
- "item-authoring"
127
- ]),
128
- spanishInput: k.settings && x(k.label),
129
- specialInput: A.settings && x(A.label),
130
- dimensions: h.settings && S(h.label, {
131
- width: {
132
- label: "Width (px)",
133
- suffix: "px",
134
- min: 100,
135
- max: 1200
136
- },
137
- height: {
138
- label: "Height (px)",
139
- suffix: "px",
140
- min: 100,
141
- max: 500
142
- }
143
- }),
144
- "multiple.enabled": L.settings && x(L.label, !0),
145
- promptEnabled: y.settings && x(y.label),
146
- feedbackEnabled: _.settings && x(_.label),
147
- annotationsEnabled: p.settings && x(p.label),
148
- spellCheckEnabled: j.settings && x(j.label),
149
- playerSpellCheckDisabled: v.settings && x(v.label)
150
- }, te = {
151
- teacherInstructionsEnabled: N.settings && x(N.label),
152
- studentInstructionsEnabled: M.settings && x(M.label),
153
- rubricEnabled: R?.settings && x(R?.label)
154
- }, $ = (e) => Object.assign({ ...B }, e || {});
155
- return /* @__PURE__ */ f(c.ConfigLayout, {
156
- extraCSSRules: H,
157
- dimensions: m,
158
- hideSettings: O,
159
- settings: /* @__PURE__ */ d(b, {
160
- model: e,
161
- configuration: t,
162
- onChangeModel: (e) => s(e),
163
- onChangeConfiguration: (e) => i(e),
164
- groups: {
165
- Settings: ee,
166
- Properties: te
167
- }
168
- }),
169
- children: [
170
- K && /* @__PURE__ */ f(E, {
171
- label: N.label,
172
- children: [/* @__PURE__ */ d(n, {
173
- className: "prompt",
174
- markup: e.teacherInstructions || "",
175
- onChange: this.changeTeacherInstructions,
176
- imageSupport: r,
177
- nonEmpty: !1,
178
- error: Y,
179
- toolbarOpts: Q,
180
- spellCheck: G,
181
- maxImageWidth: F && F.teacherInstructions || X,
182
- maxImageHeight: I && I.teacherInstructions || Z,
183
- uploadSoundSupport: l,
184
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
185
- mathMlOptions: z,
186
- pluginProps: $(N?.inputConfiguration)
187
- }), Y && /* @__PURE__ */ d(D, { children: Y })]
188
- }),
189
- W && /* @__PURE__ */ f(E, {
190
- label: y.label,
191
- children: [/* @__PURE__ */ d(n, {
192
- activePlugins: a,
193
- className: "prompt",
194
- markup: e.prompt || "",
195
- onChange: this.onPromptChange,
196
- imageSupport: r,
197
- nonEmpty: !1,
198
- error: J,
199
- toolbarOpts: Q,
200
- spellCheck: G,
201
- maxImageWidth: X,
202
- maxImageHeight: Z,
203
- uploadSoundSupport: l,
204
- languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
205
- mathMlOptions: z,
206
- pluginProps: $(y?.inputConfiguration)
207
- }), J && /* @__PURE__ */ d(D, { children: J })]
208
- }),
209
- U && /* @__PURE__ */ f(u.Fragment, { children: [/* @__PURE__ */ d(T, {
210
- variant: "h6",
211
- children: "Feedback"
212
- }), /* @__PURE__ */ d(o, {
213
- label: "When submitted, show",
214
- feedback: e.feedback || w,
215
- onChange: this.changeFeedback,
216
- toolbarOpts: Q
217
- })] })
218
- ]
219
- });
220
- }
221
- }, k = {
222
- model: {
223
- annotationsEnabled: !1,
224
- dimensions: {
225
- height: 100,
226
- width: 500
227
- },
228
- equationEditor: "Grade 8 - HS",
229
- feedbackEnabled: !1,
230
- mathInput: !1,
231
- playerSpellCheckDisabled: !0,
232
- predefinedAnnotations: [
233
- {
234
- label: "good",
235
- text: "good",
236
- type: "positive"
237
- },
238
- {
239
- label: "★",
240
- text: "★",
241
- type: "positive"
242
- },
243
- {
244
- label: ":-)",
245
- text: ":-)",
246
- type: "positive"
247
- },
248
- {
249
- label: "creative",
250
- text: "creative",
251
- type: "positive"
252
- },
253
- {
254
- label: "run-on",
255
- text: "run-on",
256
- type: "negative"
257
- },
258
- {
259
- label: "frag",
260
- text: "fragment",
261
- type: "negative"
262
- },
263
- {
264
- label: "tran",
265
- text: "transition",
266
- type: "negative"
267
- },
268
- {
269
- label: "supp",
270
- text: "support needed",
271
- type: "negative"
272
- },
273
- {
274
- label: "punc",
275
- text: "punctuation",
276
- type: "negative"
277
- },
278
- {
279
- label: "agr",
280
- text: "agreement wrong",
281
- type: "negative"
282
- },
283
- {
284
- label: "unclear",
285
- text: "unclear",
286
- type: "negative"
287
- },
288
- {
289
- label: "cut",
290
- text: "cut",
291
- type: "negative"
292
- },
293
- {
294
- label: "sp",
295
- text: "spelling",
296
- type: "negative"
297
- },
298
- {
299
- label: "cap",
300
- text: "capitalization",
301
- type: "negative"
302
- },
303
- {
304
- label: "inf",
305
- text: "informal",
306
- type: "negative"
307
- },
308
- {
309
- label: "awk",
310
- text: "awkward",
311
- type: "negative"
312
- }
313
- ],
314
- prompt: "",
315
- promptEnabled: !0,
316
- rationale: "",
317
- rationaleEnabled: !0,
318
- spanishInput: !1,
319
- specialInput: !1,
320
- spellCheckEnabled: !0,
321
- studentInstructionsEnabled: !0,
322
- teacherInstructions: "",
323
- teacherInstructionsEnabled: !0,
324
- toolbarEditorPosition: "bottom"
325
- },
326
- configuration: {
327
- annotations: {
328
- settings: !1,
329
- label: "Annotations"
330
- },
331
- baseInputConfiguration: {
332
- audio: { disabled: !1 },
333
- video: { disabled: !1 },
334
- image: { disabled: !1 },
335
- h3: { disabled: !0 },
336
- blockquote: { disabled: !0 },
337
- textAlign: { disabled: !0 },
338
- showParagraphs: { disabled: !1 },
339
- separateParagraphs: { disabled: !0 }
340
- },
341
- dimensions: {
342
- settings: !0,
343
- label: "Text-Entry Display Size"
344
- },
345
- spellCheck: {
346
- label: "Spellcheck",
347
- settings: !1,
348
- enabled: !0
349
- },
350
- playerSpellCheck: {
351
- label: "Disable Student Spellcheck",
352
- settings: !0,
353
- enabled: !0
354
- },
355
- equationEditor: {
356
- settings: !1,
357
- label: "Equation Editor",
358
- enabled: !0
359
- },
360
- feedback: {
361
- settings: !0,
362
- label: "Feedback"
363
- },
364
- mathInput: {
365
- settings: !0,
366
- label: "Student response can include math notation",
367
- enabled: !1
368
- },
369
- settingsPanelDisabled: !1,
370
- spanishInput: {
371
- settings: !0,
372
- label: "Students can insert Spanish",
373
- enabled: !1
374
- },
375
- specialInput: {
376
- settings: !0,
377
- label: "Students can insert Special Characters",
378
- enabled: !1
379
- },
380
- multiple: {
381
- settings: !1,
382
- label: "Multiple Parts",
383
- enabled: !1
384
- },
385
- studentInstructions: {
386
- settings: !1,
387
- label: "Student Instructions"
388
- },
389
- prompt: {
390
- settings: !0,
391
- label: "Prompt",
392
- inputConfiguration: {
393
- audio: { disabled: !1 },
394
- video: { disabled: !1 },
395
- image: { disabled: !1 }
396
- },
397
- required: !1
398
- },
399
- teacherInstructions: {
400
- settings: !0,
401
- label: "Teacher Instructions",
402
- inputConfiguration: {
403
- audio: { disabled: !1 },
404
- video: { disabled: !1 },
405
- image: { disabled: !1 }
406
- },
407
- required: !1
408
- },
409
- maxImageWidth: {
410
- teacherInstructions: 300,
411
- prompt: 300
412
- },
413
- maxImageHeight: {
414
- teacherInstructions: 300,
415
- prompt: 300
416
- },
417
- withRubric: {
418
- settings: !1,
419
- label: "Add Rubric"
420
- },
421
- mathMlOptions: {
422
- mmlOutput: !1,
423
- mmlEditing: !1
424
- }
425
- }
426
- }, A = class e extends HTMLElement {
427
- static createDefaultModel = (e = {}, t) => {
428
- let n = {
429
- ...k.model,
430
- ...e
431
- };
432
- return t?.withRubric?.forceEnabled && !n.rubricEnabled && (n.rubricEnabled = !0), n;
433
- };
434
- constructor() {
435
- super(), this._root = null, this._configuration = k.configuration, this._configuration.withRubric?.forceEnabled && (this._configuration.withRubric.settings = !1), this._model = e.createDefaultModel({}, this._configuration);
436
- }
437
- set model(t) {
438
- this._model = e.createDefaultModel(t, this._configuration), this.render();
439
- }
440
- set configuration(e) {
441
- this._configuration = {
442
- ...k.configuration,
443
- ...e
444
- };
445
- let { withRubric: t = {} } = e || {};
446
- t?.forceEnabled && (this._configuration.withRubric.settings = !1, this._model.rubricEnabled || (this._model.rubricEnabled = !0)), this.render();
447
- }
448
- onModelChanged(e) {
449
- this._model = e, this.render(), this.dispatchEvent(new m(this._model, !1));
450
- }
451
- onConfigurationChanged(e) {
452
- this._configuration = {
453
- ...k.configuration,
454
- ...e
455
- }, this._model && this.onModelChanged(this._model), this.render();
456
- }
457
- insertImage(e) {
458
- this.dispatchEvent(new g(e));
459
- }
460
- onDeleteImage(e, t) {
461
- this.dispatchEvent(new h(e, t));
462
- }
463
- insertSound(e) {
464
- this.dispatchEvent(new v(e));
465
- }
466
- onDeleteSound(e, t) {
467
- this.dispatchEvent(new _(e, t));
468
- }
469
- render() {
470
- if (this._model) {
471
- let e = u.createElement(O, {
472
- model: this._model,
473
- configuration: this._configuration,
474
- onModelChanged: this.onModelChanged.bind(this),
475
- onConfigurationChanged: this.onConfigurationChanged.bind(this),
476
- imageSupport: {
477
- add: this.insertImage.bind(this),
478
- delete: this.onDeleteImage.bind(this)
479
- },
480
- uploadSoundSupport: {
481
- add: this.insertSound.bind(this),
482
- delete: this.onDeleteSound.bind(this)
483
- }
484
- });
485
- this._root ||= p(this), this._root.render(e);
486
- }
487
- }
488
- disconnectedCallback() {
489
- this._root && this._root.unmount();
490
- }
491
- };
492
- //#endregion
493
- export { A as default };
494
-
495
- //# sourceMappingURL=index.js.map