@pie-element/math-inline 12.2.2-beta.5 → 12.2.2-beta.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.
@@ -1,140 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _client = require("react-dom/client");
11
- var _configure = _interopRequireDefault(require("./configure"));
12
- var _lodashEs = require("lodash-es");
13
- var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
14
- var _debug = _interopRequireDefault(require("debug"));
15
- var _defaults = _interopRequireDefault(require("./defaults"));
16
- const log = (0, _debug.default)('pie-elements:math-inline:configure');
17
- class MathInlineConfigure extends HTMLElement {
18
- constructor() {
19
- super();
20
- this._root = null;
21
- this._model = MathInlineConfigure.createDefaultModel();
22
- this._configuration = _defaults.default.configuration;
23
- }
24
- set model(m) {
25
- this._model = MathInlineConfigure.createDefaultModel(m);
26
- this._render();
27
- }
28
- set configuration(c) {
29
- const newConfiguration = {
30
- ..._defaults.default.configuration,
31
- ...c
32
- };
33
- this._configuration = newConfiguration;
34
-
35
- // if language:enabled is true, then the corresponding default item model should include a language value;
36
- // if it is false, then the language field should be omitted from the item model.
37
- // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
38
- // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
39
- if (newConfiguration?.language?.enabled) {
40
- if (newConfiguration?.languageChoices?.options?.length) {
41
- this._model.language = newConfiguration?.languageChoices.options[0].value;
42
- }
43
- } else if (newConfiguration.language.settings && this._model.language) {
44
- this._configuration.language.enabled = true;
45
- if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
46
- this._configuration.languageChoices.options = [];
47
- }
48
-
49
- // check if the language is already included in the languageChoices.options array
50
- // and if not, then add it.
51
- if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {
52
- this._configuration.languageChoices.options.push({
53
- value: this._model.language,
54
- label: this._model.language
55
- });
56
- }
57
- } else {
58
- delete this._model.language;
59
- }
60
- this._render();
61
- }
62
- onModelChanged(model) {
63
- this._model = model;
64
- log('[onModelChanged]: ', this._model);
65
- this._render();
66
- this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model));
67
- }
68
- onConfigurationChanged(c) {
69
- this._configuration = c;
70
- if (this._model) {
71
- this.onModelChanged(this._model);
72
- }
73
- this._render();
74
- }
75
-
76
- /**
77
- *
78
- * @param {done, progress, file} handler
79
- */
80
- insertImage(handler) {
81
- this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
82
- }
83
- onDeleteImage(src, done) {
84
- this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
85
- }
86
- insertSound(handler) {
87
- this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
88
- }
89
- onDeleteSound(src, done) {
90
- this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
91
- }
92
- _render() {
93
- if (this._model) {
94
- const el = /*#__PURE__*/_react.default.createElement(_configure.default, {
95
- onModelChanged: this.onModelChanged.bind(this),
96
- onConfigurationChanged: this.onConfigurationChanged.bind(this),
97
- model: this._model,
98
- configuration: this._configuration,
99
- imageSupport: {
100
- add: this.insertImage.bind(this),
101
- delete: this.onDeleteImage.bind(this)
102
- },
103
- uploadSoundSupport: {
104
- add: this.insertSound.bind(this),
105
- delete: this.onDeleteSound.bind(this)
106
- }
107
- });
108
- if (!this._root) {
109
- this._root = (0, _client.createRoot)(this);
110
- }
111
- this._root.render(el);
112
- }
113
- }
114
- connectedCallback() {
115
- this._render();
116
- }
117
- disconnectedCallback() {
118
- if (this._root) {
119
- this._root.unmount();
120
- this._root = null;
121
- }
122
- }
123
- }
124
- exports.default = MathInlineConfigure;
125
- (0, _defineProperty2.default)(MathInlineConfigure, "createDefaultModel", (model = {}) => {
126
- // making sure that defaults are set
127
- if (!(0, _lodashEs.isEmpty)(model.responses)) {
128
- model.responses = model.responses.map(correctResponse => ({
129
- ...correctResponse,
130
- validation: correctResponse.validation || _defaults.default.model.validationDefault,
131
- allowTrailingZeros: correctResponse.allowTrailingZeros || _defaults.default.model.allowTrailingZerosDefault,
132
- ignoreOrder: correctResponse.ignoreOrder || _defaults.default.model.ignoreOrderDefault || false
133
- }));
134
- }
135
- return {
136
- ..._defaults.default.model,
137
- ...model
138
- };
139
- });
140
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_configure","_lodashEs","_pieConfigureEvents","_debug","_defaults","log","debug","MathInlineConfigure","HTMLElement","constructor","_root","_model","createDefaultModel","_configuration","defaults","configuration","model","m","_render","c","newConfiguration","language","enabled","languageChoices","options","length","value","settings","find","option","push","label","onModelChanged","dispatchEvent","ModelUpdatedEvent","onConfigurationChanged","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","el","React","createElement","Configure","bind","imageSupport","add","delete","uploadSoundSupport","createRoot","render","connectedCallback","disconnectedCallback","unmount","exports","default","_defineProperty2","isEmpty","responses","map","correctResponse","validation","validationDefault","allowTrailingZeros","allowTrailingZerosDefault","ignoreOrder","ignoreOrderDefault"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Configure from './configure';\nimport { isEmpty } from 'lodash-es';\nimport {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport debug from 'debug';\n\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:math-inline:configure');\n\nexport default class MathInlineConfigure extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n // making sure that defaults are set\n if (!isEmpty(model.responses)) {\n model.responses = model.responses.map((correctResponse) => ({\n ...correctResponse,\n validation: correctResponse.validation || defaults.model.validationDefault,\n allowTrailingZeros: correctResponse.allowTrailingZeros || defaults.model.allowTrailingZerosDefault,\n ignoreOrder: correctResponse.ignoreOrder || defaults.model.ignoreOrderDefault || false,\n }));\n }\n\n return { ...defaults.model, ...model };\n };\n\n constructor() {\n super();\n this._root = null;\n this._model = MathInlineConfigure.createDefaultModel();\n this._configuration = defaults.configuration;\n }\n\n set model(m) {\n this._model = MathInlineConfigure.createDefaultModel(m);\n this._render();\n }\n\n set configuration(c) {\n const newConfiguration = {\n ...defaults.configuration,\n ...c,\n };\n\n this._configuration = newConfiguration;\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (newConfiguration?.language?.enabled) {\n if (newConfiguration?.languageChoices?.options?.length) {\n this._model.language = newConfiguration?.languageChoices.options[0].value;\n }\n } else if (newConfiguration.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this._render();\n }\n\n onModelChanged(model) {\n this._model = model;\n log('[onModelChanged]: ', this._model);\n this._render();\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n\n onConfigurationChanged(c) {\n this._configuration = c;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n if (this._model) {\n const el = React.createElement(Configure, {\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n model: this._model,\n configuration: this._configuration,\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n }\n }\n\n connectedCallback() {\n this._render();\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAOA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,MAAMO,GAAG,GAAG,IAAAC,cAAK,EAAC,oCAAoC,CAAC;AAExC,MAAMC,mBAAmB,SAASC,WAAW,CAAC;EAe3DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,KAAK,GAAG,IAAI;IACjB,IAAI,CAACC,MAAM,GAAGJ,mBAAmB,CAACK,kBAAkB,CAAC,CAAC;IACtD,IAAI,CAACC,cAAc,GAAGC,iBAAQ,CAACC,aAAa;EAC9C;EAEA,IAAIC,KAAKA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7BjD,KAAK,CAACiD,SAAS,GAAGjD,KAAK,CAACiD,SAAS,CAACC,GAAG,CAAEC,eAAe,KAAM;MAC1D,GAAGA,eAAe;MAClBC,UAAU,EAAED,eAAe,CAACC,UAAU,IAAItD,iBAAQ,CAACE,KAAK,CAACqD,iBAAiB;MAC1EC,kBAAkB,EAAEH,eAAe,CAACG,kBAAkB,IAAIxD,iBAAQ,CAACE,KAAK,CAACuD,yBAAyB;MAClGC,WAAW,EAAEL,eAAe,CAACK,WAAW,IAAI1D,iBAAQ,CAACE,KAAK,CAACyD,kBAAkB,IAAI;IACnF,CAAC,CAAC,CAAC;EACL;EAEA,OAAO;IAAE,GAAG3D,iBAAQ,CAACE,KAAK;IAAE,GAAGA;EAAM,CAAC;AACxC,CAAC","ignoreList":[]}
@@ -1,369 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var React = _interopRequireWildcard(require("react"));
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
- var _configUi = require("@pie-lib/config-ui");
12
- var _mathToolbar = require("@pie-lib/math-toolbar");
13
- var _Card = _interopRequireDefault(require("@mui/material/Card"));
14
- var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
15
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
16
- var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
17
- var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
18
- var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
19
- var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
20
- var _Select = _interopRequireDefault(require("@mui/material/Select"));
21
- var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
22
- var _styles = require("@mui/material/styles");
23
- var _renderUi = require("@pie-lib/render-ui");
24
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
25
- // TODO once we support individual response correctness, we need to remove this constant
26
- const INDIVIDUAL_RESPONSE_CORRECTNESS_SUPPORTED = false;
27
- const ResponseContainer = (0, _styles.styled)(_Card.default)(({
28
- theme
29
- }) => ({
30
- marginBottom: theme.spacing(2.5),
31
- width: '100%',
32
- minWidth: '548px',
33
- border: `1px solid ${theme.palette.grey[700]}`,
34
- display: 'flex',
35
- flexDirection: 'column',
36
- justifyContent: 'space-between',
37
- '.response-editor': {
38
- display: 'flex',
39
- alignItems: 'center',
40
- justifyContent: 'center',
41
- width: '100%',
42
- minWidth: '500px',
43
- maxWidth: '900px',
44
- height: 'auto',
45
- minHeight: '40px !important'
46
- },
47
- '.math-toolbar': {
48
- width: '100%',
49
- maxWidth: '900px'
50
- }
51
- }));
52
- const StyledCardContent = (0, _styles.styled)(_CardContent.default)(({
53
- theme
54
- }) => ({
55
- paddingBottom: `${theme.spacing(2)} !important`
56
- }));
57
- const Title = (0, _styles.styled)(_Typography.default)({
58
- fontWeight: 700,
59
- fontSize: '1.2rem',
60
- flex: 3
61
- });
62
- const SelectContainer = (0, _styles.styled)(_configUi.InputContainer)(({
63
- theme
64
- }) => ({
65
- flex: 2,
66
- '& > *:not(label)': {
67
- marginTop: theme.spacing(1)
68
- }
69
- }));
70
- const InputContainerWrapper = (0, _styles.styled)('div')(({
71
- theme
72
- }) => ({
73
- marginBottom: theme.spacing(2)
74
- }));
75
- const TitleBar = (0, _styles.styled)('div')({
76
- display: 'flex',
77
- alignItems: 'center',
78
- justifyContent: 'space-between'
79
- });
80
- const FlexContainer = (0, _styles.styled)('div')({
81
- display: 'flex'
82
- });
83
- const AlternateBar = (0, _styles.styled)('div')({
84
- display: 'flex',
85
- alignItems: 'center',
86
- justifyContent: 'flex-start'
87
- });
88
- const ErrorText = (0, _styles.styled)('div')(({
89
- theme
90
- }) => ({
91
- fontSize: theme.typography.fontSize - 2,
92
- color: theme.palette.error.main,
93
- paddingTop: theme.spacing(1)
94
- }));
95
- const CustomColorCheckbox = (0, _styles.styled)(_Checkbox.default)({
96
- color: `${_renderUi.color.tertiary()} !important`
97
- });
98
- const AlternateButton = (0, _styles.styled)(_Button.default)(({
99
- theme
100
- }) => ({
101
- border: `1px solid ${theme.palette.grey['A400']}`,
102
- color: _renderUi.color.text()
103
- }));
104
- const RemoveAlternateButton = (0, _styles.styled)(_Button.default)(({
105
- theme
106
- }) => ({
107
- marginLeft: theme.spacing(2),
108
- border: `1px solid ${theme.palette.grey['A400']}`,
109
- color: 'gray',
110
- fontSize: '0.8rem'
111
- }));
112
- class Response extends React.Component {
113
- constructor(props) {
114
- super(props);
115
- (0, _defineProperty2.default)(this, "onChange", name => evt => {
116
- const {
117
- response,
118
- onResponseChange,
119
- index
120
- } = this.props;
121
- const newResponse = {
122
- ...response
123
- };
124
- newResponse[name] = evt.target.value;
125
- onResponseChange(newResponse, index);
126
- });
127
- (0, _defineProperty2.default)(this, "onConfigChanged", name => evt => {
128
- const {
129
- response,
130
- onResponseChange,
131
- index
132
- } = this.props;
133
- const newResponse = {
134
- ...response
135
- };
136
- newResponse[name] = evt.target.checked;
137
- onResponseChange(newResponse, index);
138
- });
139
- (0, _defineProperty2.default)(this, "onLiteralOptionsChange", name => () => {
140
- const {
141
- response,
142
- onResponseChange,
143
- index
144
- } = this.props;
145
- const newResponse = {
146
- ...response
147
- };
148
- newResponse[name] = !response[name];
149
- onResponseChange(newResponse, index);
150
- });
151
- (0, _defineProperty2.default)(this, "onAnswerChange", answer => {
152
- const {
153
- response,
154
- onResponseChange,
155
- index
156
- } = this.props;
157
- const newResponse = {
158
- ...response
159
- };
160
- newResponse.answer = answer;
161
- onResponseChange(newResponse, index);
162
- });
163
- (0, _defineProperty2.default)(this, "onAlternateAnswerChange", alternateId => answer => {
164
- const {
165
- response,
166
- onResponseChange,
167
- index
168
- } = this.props;
169
- const newResponse = {
170
- ...response
171
- };
172
- newResponse.alternates[alternateId] = answer;
173
- onResponseChange(newResponse, index);
174
- });
175
- (0, _defineProperty2.default)(this, "onAddAlternate", () => {
176
- const {
177
- response,
178
- onResponseChange,
179
- index
180
- } = this.props;
181
- const {
182
- alternateIdCounter
183
- } = this.state;
184
- const newResponse = {
185
- ...response
186
- };
187
- if (!newResponse.alternates) {
188
- newResponse.alternates = {};
189
- }
190
- newResponse.alternates[alternateIdCounter] = '';
191
- onResponseChange(newResponse, index);
192
- this.setState({
193
- alternateIdCounter: alternateIdCounter + 1
194
- });
195
- });
196
- (0, _defineProperty2.default)(this, "onRemoveAlternate", alternateId => () => {
197
- const {
198
- response,
199
- onResponseChange,
200
- index
201
- } = this.props;
202
- const newResponse = {
203
- ...response
204
- };
205
- delete newResponse.alternates[alternateId];
206
- onResponseChange(newResponse, index);
207
- this.setState(state => ({
208
- showKeypad: {
209
- ...state.showKeypad,
210
- openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount : state.showKeypad.openCount - 1
211
- }
212
- }));
213
- });
214
- (0, _defineProperty2.default)(this, "onDone", () => {
215
- this.setState(state => ({
216
- showKeypad: {
217
- ...state.showKeypad,
218
- openCount: state.showKeypad.openCount - 1,
219
- main: false
220
- }
221
- }));
222
- });
223
- (0, _defineProperty2.default)(this, "onFocus", () => {
224
- this.setState(state => ({
225
- showKeypad: {
226
- ...state.showKeypad,
227
- openCount: !state.showKeypad.main ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,
228
- main: true
229
- }
230
- }));
231
- });
232
- (0, _defineProperty2.default)(this, "onAlternateFocus", alternateId => () => {
233
- this.setState(state => ({
234
- showKeypad: {
235
- ...state.showKeypad,
236
- openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,
237
- [alternateId]: true
238
- }
239
- }));
240
- });
241
- (0, _defineProperty2.default)(this, "onAlternateDone", alternateId => () => {
242
- this.setState(state => ({
243
- showKeypad: {
244
- ...state.showKeypad,
245
- openCount: state.showKeypad.openCount - 1,
246
- [alternateId]: false
247
- }
248
- }));
249
- });
250
- const {
251
- response: {
252
- alternates
253
- } = {}
254
- } = props || {};
255
- const alternatesLength = Object.keys(alternates || {}).length;
256
- this.state = {
257
- alternateIdCounter: alternatesLength + 1,
258
- showKeypad: {
259
- openCount: 0,
260
- main: false
261
- }
262
- };
263
- }
264
- render() {
265
- const {
266
- mode,
267
- defaultResponse,
268
- index,
269
- response,
270
- cAllowTrailingZeros,
271
- cIgnoreOrder,
272
- error
273
- } = this.props;
274
- const {
275
- showKeypad
276
- } = this.state;
277
- const {
278
- validation,
279
- answer,
280
- alternates,
281
- ignoreOrder,
282
- allowTrailingZeros
283
- } = response;
284
- const hasAlternates = Object.keys(alternates || {}).length > 0;
285
- const classNames = {
286
- editor: 'response-editor',
287
- mathToolbar: 'math-toolbar'
288
- };
289
- const containerStyles = {
290
- minHeight: `${showKeypad.openCount > 0 ? 430 : 230}px`
291
- };
292
- return /*#__PURE__*/React.createElement(ResponseContainer, {
293
- style: containerStyles
294
- }, /*#__PURE__*/React.createElement(StyledCardContent, null, /*#__PURE__*/React.createElement(TitleBar, null, /*#__PURE__*/React.createElement(Title, {
295
- component: "div"
296
- }, "Response ", INDIVIDUAL_RESPONSE_CORRECTNESS_SUPPORTED ? defaultResponse ? '' : index + 1 : ''), /*#__PURE__*/React.createElement(SelectContainer, {
297
- label: "Validation"
298
- }, /*#__PURE__*/React.createElement(_Select.default, {
299
- onChange: this.onChange('validation'),
300
- value: validation || 'literal',
301
- MenuProps: {
302
- transitionDuration: {
303
- enter: 225,
304
- exit: 195
305
- }
306
- }
307
- }, /*#__PURE__*/React.createElement(_MenuItem.default, {
308
- value: "literal"
309
- }, "Literal Validation"), /*#__PURE__*/React.createElement(_MenuItem.default, {
310
- value: "symbolic"
311
- }, "Symbolic Validation")))), validation === 'literal' && /*#__PURE__*/React.createElement(FlexContainer, null, cAllowTrailingZeros.enabled && /*#__PURE__*/React.createElement(_FormControlLabel.default, {
312
- label: cAllowTrailingZeros.label,
313
- control: /*#__PURE__*/React.createElement(CustomColorCheckbox, {
314
- checked: allowTrailingZeros,
315
- onChange: this.onLiteralOptionsChange('allowTrailingZeros')
316
- })
317
- }), cIgnoreOrder.enabled && /*#__PURE__*/React.createElement(_FormControlLabel.default, {
318
- label: cIgnoreOrder.label,
319
- control: /*#__PURE__*/React.createElement(CustomColorCheckbox, {
320
- checked: ignoreOrder,
321
- onChange: this.onLiteralOptionsChange('ignoreOrder')
322
- })
323
- })), /*#__PURE__*/React.createElement(InputContainerWrapper, null, /*#__PURE__*/React.createElement(_InputLabel.default, null, "Correct Answer"), /*#__PURE__*/React.createElement(_mathToolbar.MathToolbar, {
324
- keypadMode: mode,
325
- classNames: classNames,
326
- controlledKeypad: true,
327
- showKeypad: showKeypad.main,
328
- latex: answer || '',
329
- onChange: this.onAnswerChange,
330
- onFocus: this.onFocus,
331
- onDone: this.onDone,
332
- error: error && error.answer
333
- }), error && error.answer ? /*#__PURE__*/React.createElement(ErrorText, null, error.answer) : null), hasAlternates && Object.keys(alternates).map((alternateId, altIdx) => /*#__PURE__*/React.createElement(InputContainerWrapper, {
334
- key: alternateId
335
- }, /*#__PURE__*/React.createElement(AlternateBar, null, /*#__PURE__*/React.createElement(_InputLabel.default, null, "Alternate", Object.keys(alternates).length > 1 ? ` ${altIdx + 1}` : ''), /*#__PURE__*/React.createElement(RemoveAlternateButton, {
336
- type: "secondary",
337
- onClick: this.onRemoveAlternate(alternateId)
338
- }, "Remove")), /*#__PURE__*/React.createElement(_mathToolbar.MathToolbar, {
339
- classNames: classNames,
340
- controlledKeypad: true,
341
- keypadMode: mode,
342
- showKeypad: showKeypad[alternateId] || false,
343
- latex: alternates[alternateId] || '',
344
- onChange: this.onAlternateAnswerChange(alternateId),
345
- onFocus: this.onAlternateFocus(alternateId),
346
- onDone: this.onAlternateDone(alternateId),
347
- error: error && error[alternateId]
348
- }), error && error[alternateId] ? /*#__PURE__*/React.createElement(ErrorText, null, error[alternateId]) : null)), /*#__PURE__*/React.createElement(AlternateButton, {
349
- type: "primary",
350
- onClick: this.onAddAlternate
351
- }, "ADD ALTERNATE")));
352
- }
353
- }
354
- (0, _defineProperty2.default)(Response, "propTypes", {
355
- defaultResponse: _propTypes.default.bool,
356
- error: _propTypes.default.object,
357
- mode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
358
- index: _propTypes.default.number,
359
- onResponseChange: _propTypes.default.func.isRequired,
360
- response: _propTypes.default.object.isRequired,
361
- cIgnoreOrder: _propTypes.default.object.isRequired,
362
- cAllowTrailingZeros: _propTypes.default.object.isRequired
363
- });
364
- (0, _defineProperty2.default)(Response, "defaultProps", {
365
- defaultResponse: false,
366
- mode: 'miscellaneous'
367
- });
368
- var _default = exports.default = Response;
369
- //# sourceMappingURL=response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"response.js","names":["React","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_configUi","_mathToolbar","_Card","_CardContent","_Button","_FormControlLabel","_Typography","_InputLabel","_Checkbox","_Select","_MenuItem","_styles","_renderUi","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","INDIVIDUAL_RESPONSE_CORRECTNESS_SUPPORTED","ResponseContainer","styled","Card","theme","marginBottom","spacing","width","minWidth","border","palette","grey","display","flexDirection","justifyContent","alignItems","maxWidth","height","minHeight","StyledCardContent","CardContent","paddingBottom","Title","Typography","fontWeight","fontSize","flex","SelectContainer","InputContainer","marginTop","InputContainerWrapper","TitleBar","FlexContainer","AlternateBar","ErrorText","typography","color","error","main","paddingTop","CustomColorCheckbox","Checkbox","tertiary","AlternateButton","Button","text","RemoveAlternateButton","marginLeft","Response","Component","constructor","props","_defineProperty2","name","evt","response","onResponseChange","index","newResponse","target","value","checked","answer","alternateId","alternates","alternateIdCounter","state","setState","showKeypad","openCount","alternatesLength","keys","length","render","mode","defaultResponse","cAllowTrailingZeros","cIgnoreOrder","validation","ignoreOrder","allowTrailingZeros","hasAlternates","classNames","editor","mathToolbar","containerStyles","createElement","style","component","label","onChange","MenuProps","transitionDuration","enter","exit","enabled","control","onLiteralOptionsChange","MathToolbar","keypadMode","controlledKeypad","latex","onAnswerChange","onFocus","onDone","map","altIdx","key","type","onClick","onRemoveAlternate","onAlternateAnswerChange","onAlternateFocus","onAlternateDone","onAddAlternate","PropTypes","bool","object","oneOfType","string","number","func","isRequired","_default","exports"],"sources":["../src/response.jsx"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport { MathToolbar } from '@pie-lib/math-toolbar';\nimport Card from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport Button from '@mui/material/Button';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Typography from '@mui/material/Typography';\nimport InputLabel from '@mui/material/InputLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport Select from '@mui/material/Select';\nimport MenuItem from '@mui/material/MenuItem';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\n// TODO once we support individual response correctness, we need to remove this constant\nconst INDIVIDUAL_RESPONSE_CORRECTNESS_SUPPORTED = false;\n\nconst ResponseContainer = styled(Card)(({ theme }) => ({\n marginBottom: theme.spacing(2.5),\n width: '100%',\n minWidth: '548px',\n border: `1px solid ${theme.palette.grey[700]}`,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n\n '.response-editor': {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n minWidth: '500px',\n maxWidth: '900px',\n height: 'auto',\n minHeight: '40px !important',\n },\n\n '.math-toolbar': {\n width: '100%',\n maxWidth: '900px',\n },\n}));\n\nconst StyledCardContent = styled(CardContent)(({ theme }) => ({\n paddingBottom: `${theme.spacing(2)} !important`,\n}));\n\nconst Title = styled(Typography)({\n fontWeight: 700,\n fontSize: '1.2rem',\n flex: 3,\n});\n\nconst SelectContainer = styled(InputContainer)(({ theme }) => ({\n flex: 2,\n '& > *:not(label)': {\n marginTop: theme.spacing(1),\n },\n}));\n\nconst InputContainerWrapper = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst TitleBar = styled('div')({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n});\n\nconst FlexContainer = styled('div')({\n display: 'flex',\n});\n\nconst AlternateBar = styled('div')({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n});\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst CustomColorCheckbox = styled(Checkbox)({\n color: `${color.tertiary()} !important`,\n});\n\nconst AlternateButton = styled(Button)(({ theme }) => ({\n border: `1px solid ${theme.palette.grey['A400']}`,\n color: color.text(),\n}));\n\nconst RemoveAlternateButton = styled(Button)(({ theme }) => ({\n marginLeft: theme.spacing(2),\n border: `1px solid ${theme.palette.grey['A400']}`,\n color: 'gray',\n fontSize: '0.8rem',\n}));\n\nclass Response extends React.Component {\n static propTypes = {\n defaultResponse: PropTypes.bool,\n error: PropTypes.object,\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n index: PropTypes.number,\n onResponseChange: PropTypes.func.isRequired,\n response: PropTypes.object.isRequired,\n cIgnoreOrder: PropTypes.object.isRequired,\n cAllowTrailingZeros: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n defaultResponse: false,\n mode: 'miscellaneous',\n };\n\n constructor(props) {\n super(props);\n\n const { response: { alternates } = {} } = props || {};\n const alternatesLength = Object.keys(alternates || {}).length;\n\n this.state = {\n alternateIdCounter: alternatesLength + 1,\n showKeypad: {\n openCount: 0,\n main: false,\n },\n };\n }\n\n onChange = (name) => (evt) => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = evt.target.value;\n\n onResponseChange(newResponse, index);\n };\n\n onConfigChanged = (name) => (evt) => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = evt.target.checked;\n\n onResponseChange(newResponse, index);\n };\n\n onLiteralOptionsChange = (name) => () => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = !response[name];\n\n onResponseChange(newResponse, index);\n };\n\n onAnswerChange = (answer) => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n newResponse.answer = answer;\n\n onResponseChange(newResponse, index);\n };\n\n onAlternateAnswerChange = (alternateId) => (answer) => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n newResponse.alternates[alternateId] = answer;\n\n onResponseChange(newResponse, index);\n };\n\n onAddAlternate = () => {\n const { response, onResponseChange, index } = this.props;\n const { alternateIdCounter } = this.state;\n const newResponse = { ...response };\n\n if (!newResponse.alternates) {\n newResponse.alternates = {};\n }\n\n newResponse.alternates[alternateIdCounter] = '';\n\n onResponseChange(newResponse, index);\n\n this.setState({\n alternateIdCounter: alternateIdCounter + 1,\n });\n };\n\n onRemoveAlternate = (alternateId) => () => {\n const { response, onResponseChange, index } = this.props;\n const newResponse = { ...response };\n\n delete newResponse.alternates[alternateId];\n\n onResponseChange(newResponse, index);\n\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount : state.showKeypad.openCount - 1,\n },\n }));\n };\n\n onDone = () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: state.showKeypad.openCount - 1,\n main: false,\n },\n }));\n };\n\n onFocus = () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad.main ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,\n main: true,\n },\n }));\n };\n\n onAlternateFocus = (alternateId) => () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,\n [alternateId]: true,\n },\n }));\n };\n\n onAlternateDone = (alternateId) => () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: state.showKeypad.openCount - 1,\n [alternateId]: false,\n },\n }));\n };\n\n render() {\n const { mode, defaultResponse, index, response, cAllowTrailingZeros, cIgnoreOrder, error } = this.props;\n\n const { showKeypad } = this.state;\n const { validation, answer, alternates, ignoreOrder, allowTrailingZeros } = response;\n const hasAlternates = Object.keys(alternates || {}).length > 0;\n const classNames = {\n editor: 'response-editor',\n mathToolbar: 'math-toolbar',\n };\n const containerStyles = {\n minHeight: `${showKeypad.openCount > 0 ? 430 : 230}px`,\n };\n\n return (\n <ResponseContainer style={containerStyles}>\n <StyledCardContent>\n <TitleBar>\n <Title component=\"div\">\n Response {INDIVIDUAL_RESPONSE_CORRECTNESS_SUPPORTED ? (defaultResponse ? '' : index + 1) : ''}\n </Title>\n\n <SelectContainer label=\"Validation\">\n <Select\n onChange={this.onChange('validation')}\n value={validation || 'literal'}\n MenuProps={{ transitionDuration: { enter: 225, exit: 195 } }}\n >\n <MenuItem value=\"literal\">Literal Validation</MenuItem>\n <MenuItem value=\"symbolic\">Symbolic Validation</MenuItem>\n </Select>\n </SelectContainer>\n </TitleBar>\n\n {validation === 'literal' && (\n <FlexContainer>\n {cAllowTrailingZeros.enabled && (\n <FormControlLabel\n label={cAllowTrailingZeros.label}\n control={\n <CustomColorCheckbox\n checked={allowTrailingZeros}\n onChange={this.onLiteralOptionsChange('allowTrailingZeros')}\n />\n }\n />\n )}\n\n {cIgnoreOrder.enabled && (\n <FormControlLabel\n label={cIgnoreOrder.label}\n control={\n <CustomColorCheckbox checked={ignoreOrder} onChange={this.onLiteralOptionsChange('ignoreOrder')} />\n }\n />\n )}\n </FlexContainer>\n )}\n\n <InputContainerWrapper>\n <InputLabel>Correct Answer</InputLabel>\n <MathToolbar\n keypadMode={mode}\n classNames={classNames}\n controlledKeypad\n showKeypad={showKeypad.main}\n latex={answer || ''}\n onChange={this.onAnswerChange}\n onFocus={this.onFocus}\n onDone={this.onDone}\n error={error && error.answer}\n />\n {error && error.answer ? <ErrorText>{error.answer}</ErrorText> : null}\n </InputContainerWrapper>\n\n {hasAlternates &&\n Object.keys(alternates).map((alternateId, altIdx) => (\n <InputContainerWrapper key={alternateId}>\n <AlternateBar>\n <InputLabel>\n Alternate\n {Object.keys(alternates).length > 1 ? ` ${altIdx + 1}` : ''}\n </InputLabel>\n <RemoveAlternateButton type=\"secondary\" onClick={this.onRemoveAlternate(alternateId)}>\n Remove\n </RemoveAlternateButton>\n </AlternateBar>\n\n <MathToolbar\n classNames={classNames}\n controlledKeypad\n keypadMode={mode}\n showKeypad={showKeypad[alternateId] || false}\n latex={alternates[alternateId] || ''}\n onChange={this.onAlternateAnswerChange(alternateId)}\n onFocus={this.onAlternateFocus(alternateId)}\n onDone={this.onAlternateDone(alternateId)}\n error={error && error[alternateId]}\n />\n {error && error[alternateId] ? <ErrorText>{error[alternateId]}</ErrorText> : null}\n </InputContainerWrapper>\n ))}\n\n <AlternateButton type=\"primary\" onClick={this.onAddAlternate}>\n ADD ALTERNATE\n </AlternateButton>\n </StyledCardContent>\n </ResponseContainer>\n );\n }\n}\n\nexport default Response;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,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AACK;AACxC,CAAC;AAAA,IAAAtE,gBAAA,CAAA7D,OAAA,EAVGyD,QAAQ,kBAYU;EACpB2B,eAAe,EAAE,KAAK;EACtBD,IAAI,EAAE;AACR,CAAC;AAAA,IAAAiD,QAAA,GAAAC,OAAA,CAAArI,OAAA,GAwPYyD,QAAQ","ignoreList":[]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPluginProps = exports.generateValidationMessage = exports.ResponseTypes = void 0;
7
- const ResponseTypes = exports.ResponseTypes = {
8
- advanced: 'Advanced Multi',
9
- simple: 'Simple'
10
- };
11
- const generateValidationMessage = (model = {}, config = {}) => {
12
- const {
13
- maxResponseAreas
14
- } = config;
15
- const {
16
- responseType
17
- } = model;
18
- let responseAreasMessage = '';
19
- const answersMessage = '\nAll correct answers (the primary and any alternates) should not be empty and should be unique.';
20
- if (responseType === 'Advanced Multi') {
21
- responseAreasMessage = '\nThere should be at least 1 ' + (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') + 'response area' + (maxResponseAreas ? 's' : '') + ' defined.';
22
- }
23
- return 'Validation requirements:' + answersMessage + responseAreasMessage;
24
- };
25
- exports.generateValidationMessage = generateValidationMessage;
26
- const getPluginProps = (props = {}, baseInputConfiguration = {}) => ({
27
- ...baseInputConfiguration,
28
- ...props
29
- });
30
- exports.getPluginProps = getPluginProps;
31
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["ResponseTypes","exports","advanced","simple","generateValidationMessage","model","config","maxResponseAreas","responseType","responseAreasMessage","answersMessage","getPluginProps","props","baseInputConfiguration"],"sources":["../src/utils.js"],"sourcesContent":["export const ResponseTypes = {\n advanced: 'Advanced Multi',\n simple: 'Simple',\n};\n\nexport const generateValidationMessage = (model = {}, config = {}) => {\n const { maxResponseAreas } = config;\n const { responseType } = model;\n let responseAreasMessage = '';\n\n const answersMessage =\n '\\nAll correct answers (the primary and any alternates) should not be empty and should be unique.';\n\n if (responseType === 'Advanced Multi') {\n responseAreasMessage =\n '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' +\n (maxResponseAreas ? 's' : '') +\n ' defined.';\n }\n\n return 'Validation requirements:' + answersMessage + responseAreasMessage;\n};\n\nexport const getPluginProps = (props = {}, baseInputConfiguration = {}) => ({\n ...baseInputConfiguration,\n ...props,\n});\n"],"mappings":";;;;;;AAAO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3BE,QAAQ,EAAE,gBAAgB;EAC1BC,MAAM,EAAE;AACV,CAAC;AAEM,MAAMC,yBAAyB,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,GAAG,CAAC,CAAC,KAAK;EACpE,MAAM;IAAEC;EAAiB,CAAC,GAAGD,MAAM;EACnC,MAAM;IAAEE;EAAa,CAAC,GAAGH,KAAK;EAC9B,IAAII,oBAAoB,GAAG,EAAE;EAE7B,MAAMC,cAAc,GAClB,kGAAkG;EAEpG,IAAIF,YAAY,KAAK,gBAAgB,EAAE;IACrCC,oBAAoB,GAClB,+BAA+B,IAC9BF,gBAAgB,GAAG,eAAeA,gBAAgB,GAAG,GAAG,EAAE,CAAC,GAC5D,eAAe,IACdA,gBAAgB,GAAG,GAAG,GAAG,EAAE,CAAC,GAC7B,WAAW;EACf;EAEA,OAAO,0BAA0B,GAAGG,cAAc,GAAGD,oBAAoB;AAC3E,CAAC;AAACR,OAAA,CAAAG,yBAAA,GAAAA,yBAAA;AAEK,MAAMO,cAAc,GAAGA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAEC,sBAAsB,GAAG,CAAC,CAAC,MAAM;EAC1E,GAAGA,sBAAsB;EACzB,GAAGD;AACL,CAAC,CAAC;AAACX,OAAA,CAAAU,cAAA,GAAAA,cAAA","ignoreList":[]}