@pie-element/graphing 3.7.23 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.23...@pie-element/graphing@4.0.0) (2022-06-28)
7
+
8
+
9
+ ### chore
10
+
11
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * Image percent buttons were removed from toolbar.
17
+ New properties maxImageWidth and maxImageHeight were added.
18
+
19
+
20
+
21
+
22
+
6
23
  ## [3.7.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.22...@pie-element/graphing@3.7.23) (2022-06-13)
7
24
 
8
25
 
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.23...@pie-element/graphing-configure@4.0.0) (2022-06-28)
7
+
8
+
9
+ ### chore
10
+
11
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * Image percent buttons were removed from toolbar.
17
+ New properties maxImageWidth and maxImageHeight were added.
18
+
19
+
20
+
21
+
22
+
6
23
  ## [3.3.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.22...@pie-element/graphing-configure@3.3.23) (2022-06-13)
7
24
 
8
25
 
@@ -39,6 +39,8 @@ var _graphingConfig = _interopRequireDefault(require("./graphing-config"));
39
39
 
40
40
  var _correctResponse = _interopRequireDefault(require("./correct-response"));
41
41
 
42
+ var _intersection = _interopRequireDefault(require("lodash/intersection"));
43
+
42
44
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
45
 
44
46
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -122,14 +124,18 @@ var Configure = /*#__PURE__*/function (_React$Component) {
122
124
  (0, _createClass2["default"])(Configure, [{
123
125
  key: "componentDidMount",
124
126
  value: function componentDidMount() {
125
- // This is used for offering support for old models which have the property arrows: boolean
126
- // Same thing is set in the controller: packages/graphing/controller/src/index.js - model
127
127
  var _this$props4 = this.props,
128
+ configuration = _this$props4.configuration,
128
129
  onModelChanged = _this$props4.onModelChanged,
129
130
  model = _this$props4.model;
130
131
 
131
- var _ref = model || {},
132
- arrows = _ref.arrows;
132
+ var _ref = configuration || {},
133
+ availableTools = _ref.availableTools;
134
+
135
+ var _ref2 = model || {},
136
+ arrows = _ref2.arrows; // This is used for offering support for old models which have the property arrows: boolean
137
+ // Same thing is set in the controller: packages/graphing/controller/src/index.js - model
138
+
133
139
 
134
140
  if (typeof arrows === 'boolean') {
135
141
  if (arrows) {
@@ -147,11 +153,13 @@ var Configure = /*#__PURE__*/function (_React$Component) {
147
153
  down: false
148
154
  };
149
155
  }
150
-
151
- onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
152
- arrows: arrows
153
- }));
154
156
  }
157
+
158
+ var toolbarTools = (0, _intersection["default"])(availableTools || [], model.toolbarTools || []);
159
+ onModelChanged && onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
160
+ arrows: arrows,
161
+ toolbarTools: toolbarTools
162
+ }));
155
163
  }
156
164
  }, {
157
165
  key: "render",
@@ -164,41 +172,49 @@ var Configure = /*#__PURE__*/function (_React$Component) {
164
172
  onModelChanged = _this$props5.onModelChanged,
165
173
  imageSupport = _this$props5.imageSupport;
166
174
 
167
- var _ref2 = configuration || {},
168
- _ref2$arrows = _ref2.arrows,
169
- arrows = _ref2$arrows === void 0 ? {} : _ref2$arrows,
170
- _ref2$authoring = _ref2.authoring,
171
- authoring = _ref2$authoring === void 0 ? {} : _ref2$authoring,
172
- _ref2$coordinatesOnHo = _ref2.coordinatesOnHover,
173
- coordinatesOnHover = _ref2$coordinatesOnHo === void 0 ? {} : _ref2$coordinatesOnHo,
174
- _ref2$graphDimensions = _ref2.graphDimensions,
175
- graphDimensions = _ref2$graphDimensions === void 0 ? {} : _ref2$graphDimensions,
176
- _ref2$labels = _ref2.labels,
177
- labels = _ref2$labels === void 0 ? {} : _ref2$labels,
178
- _ref2$padding = _ref2.padding,
179
- padding = _ref2$padding === void 0 ? {} : _ref2$padding,
180
- _ref2$prompt = _ref2.prompt,
181
- prompt = _ref2$prompt === void 0 ? {} : _ref2$prompt,
182
- _ref2$title = _ref2.title,
183
- title = _ref2$title === void 0 ? {} : _ref2$title,
184
- _ref2$rationale = _ref2.rationale,
185
- rationale = _ref2$rationale === void 0 ? {} : _ref2$rationale,
186
- _ref2$scoringType = _ref2.scoringType,
187
- scoringType = _ref2$scoringType === void 0 ? {} : _ref2$scoringType,
188
- _ref2$spellCheck = _ref2.spellCheck,
189
- spellCheck = _ref2$spellCheck === void 0 ? {} : _ref2$spellCheck,
190
- _ref2$studentInstruct = _ref2.studentInstructions,
191
- studentInstructions = _ref2$studentInstruct === void 0 ? {} : _ref2$studentInstruct,
192
- _ref2$teacherInstruct = _ref2.teacherInstructions,
193
- teacherInstructions = _ref2$teacherInstruct === void 0 ? {} : _ref2$teacherInstruct;
194
-
195
- var _ref3 = model || {},
196
- teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
197
- promptEnabled = _ref3.promptEnabled,
198
- rationaleEnabled = _ref3.rationaleEnabled,
199
- spellCheckEnabled = _ref3.spellCheckEnabled;
175
+ var _ref3 = configuration || {},
176
+ _ref3$arrows = _ref3.arrows,
177
+ arrows = _ref3$arrows === void 0 ? {} : _ref3$arrows,
178
+ _ref3$authoring = _ref3.authoring,
179
+ authoring = _ref3$authoring === void 0 ? {} : _ref3$authoring,
180
+ _ref3$availableTools = _ref3.availableTools,
181
+ availableTools = _ref3$availableTools === void 0 ? [] : _ref3$availableTools,
182
+ _ref3$coordinatesOnHo = _ref3.coordinatesOnHover,
183
+ coordinatesOnHover = _ref3$coordinatesOnHo === void 0 ? {} : _ref3$coordinatesOnHo,
184
+ _ref3$graphDimensions = _ref3.graphDimensions,
185
+ graphDimensions = _ref3$graphDimensions === void 0 ? {} : _ref3$graphDimensions,
186
+ _ref3$labels = _ref3.labels,
187
+ labels = _ref3$labels === void 0 ? {} : _ref3$labels,
188
+ _ref3$padding = _ref3.padding,
189
+ padding = _ref3$padding === void 0 ? {} : _ref3$padding,
190
+ _ref3$prompt = _ref3.prompt,
191
+ prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
192
+ _ref3$title = _ref3.title,
193
+ title = _ref3$title === void 0 ? {} : _ref3$title,
194
+ _ref3$rationale = _ref3.rationale,
195
+ rationale = _ref3$rationale === void 0 ? {} : _ref3$rationale,
196
+ _ref3$scoringType = _ref3.scoringType,
197
+ scoringType = _ref3$scoringType === void 0 ? {} : _ref3$scoringType,
198
+ _ref3$spellCheck = _ref3.spellCheck,
199
+ spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
200
+ _ref3$studentInstruct = _ref3.studentInstructions,
201
+ studentInstructions = _ref3$studentInstruct === void 0 ? {} : _ref3$studentInstruct,
202
+ _ref3$teacherInstruct = _ref3.teacherInstructions,
203
+ teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
204
+ _ref3$maxImageWidth = _ref3.maxImageWidth,
205
+ maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
206
+ _ref3$maxImageHeight = _ref3.maxImageHeight,
207
+ maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight;
208
+
209
+ var _ref4 = model || {},
210
+ teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
211
+ promptEnabled = _ref4.promptEnabled,
212
+ rationaleEnabled = _ref4.rationaleEnabled,
213
+ spellCheckEnabled = _ref4.spellCheckEnabled;
200
214
 
201
215
  log('[render] model', model);
216
+ var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
217
+ var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
202
218
  return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
203
219
  settings: /*#__PURE__*/_react["default"].createElement(Panel, {
204
220
  model: model,
@@ -243,7 +259,9 @@ var Configure = /*#__PURE__*/function (_React$Component) {
243
259
  onChange: this.onTeacherInstructionsChange,
244
260
  imageSupport: imageSupport,
245
261
  nonEmpty: false,
246
- spellCheck: spellCheckEnabled
262
+ spellCheck: spellCheckEnabled,
263
+ maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
264
+ maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight
247
265
  })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
248
266
  label: prompt.label,
249
267
  className: classes.promptHolder
@@ -254,7 +272,9 @@ var Configure = /*#__PURE__*/function (_React$Component) {
254
272
  imageSupport: imageSupport,
255
273
  nonEmpty: false,
256
274
  spellCheck: spellCheckEnabled,
257
- disableUnderline: true
275
+ disableUnderline: true,
276
+ maxImageWidth: defaultImageMaxWidth,
277
+ maxImageHeight: defaultImageMaxHeight
258
278
  })), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
259
279
  label: rationale.label || 'Rationale',
260
280
  className: classes.promptHolder
@@ -263,13 +283,17 @@ var Configure = /*#__PURE__*/function (_React$Component) {
263
283
  markup: model.rationale || '',
264
284
  onChange: this.onRationaleChange,
265
285
  imageSupport: imageSupport,
266
- spellCheck: spellCheckEnabled
286
+ spellCheck: spellCheckEnabled,
287
+ maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
288
+ maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight
267
289
  })), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
268
- authoringEnabled: authoring && authoring.enabled,
290
+ authoring: authoring,
291
+ availableTools: availableTools,
269
292
  graphDimensions: graphDimensions,
270
293
  model: model,
271
294
  onChange: this.props.onModelChanged
272
295
  }), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
296
+ availableTools: availableTools,
273
297
  model: model,
274
298
  onChange: this.props.onModelChanged
275
299
  })));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","arrows","left","right","up","down","classes","configuration","onConfigurationChanged","imageSupport","authoring","coordinatesOnHover","graphDimensions","labels","padding","scoringType","spellCheck","studentInstructions","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","enabled","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;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RvC,S,kBAUW;AAAEW,EAAAA,OAAO,EAAE;AAAX,C;;eAgMT,wBAAW1B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n const { onModelChanged, model } = this.props;\n let { arrows } = model || {};\n\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n\n onModelChanged({ ...model, arrows });\n }\n }\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const {\n arrows = {},\n authoring = {},\n coordinatesOnHover = {},\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n title = {},\n rationale = {},\n scoringType = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, spellCheckEnabled } =\n model || {};\n\n log('[render] model', model);\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoringEnabled={authoring && authoring.enabled}\n graphDimensions={graphDimensions}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
1
+ {"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","configuration","availableTools","arrows","left","right","up","down","toolbarTools","classes","onConfigurationChanged","imageSupport","authoring","coordinatesOnHover","graphDimensions","labels","padding","scoringType","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","defaultImageMaxWidth","defaultImageMaxHeight","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;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Container } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools } = configuration || {};\n let { arrows } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools });\n };\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n title = {},\n rationale = {},\n scoringType = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, spellCheckEnabled } =\n model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n graphDimensions={graphDimensions}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
@@ -43,6 +43,8 @@ var _Delete = _interopRequireDefault(require("@material-ui/icons/Delete"));
43
43
 
44
44
  var _lodash = require("lodash");
45
45
 
46
+ var _core = require("@material-ui/core");
47
+
46
48
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
47
49
 
48
50
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -55,15 +57,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
55
57
 
56
58
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
57
59
 
58
- var allTools = _graphing.tools.allTools;
59
-
60
60
  var styles = function styles(theme) {
61
61
  return {
62
62
  column: {
63
63
  flex: 1
64
64
  },
65
65
  graphingTools: {
66
- margin: "".concat(theme.spacing.unit * 3, "px 0"),
67
66
  color: '#ababab'
68
67
  },
69
68
  availableTools: {
@@ -91,10 +90,10 @@ var styles = function styles(theme) {
91
90
  background: '#fafafa'
92
91
  },
93
92
  button: {
94
- marginTop: theme.spacing.unit * 3,
93
+ margin: "".concat(theme.spacing.unit * 3, "px 0"),
95
94
  cursor: 'pointer',
96
95
  background: '#eee',
97
- padding: theme.spacing.unit * 2,
96
+ padding: theme.spacing.unit * 1.5,
98
97
  width: 'fit-content',
99
98
  borderRadius: '4px',
100
99
  '&:hover': {
@@ -116,23 +115,76 @@ var styles = function styles(theme) {
116
115
  },
117
116
  name: {
118
117
  margin: '5px 0'
118
+ },
119
+ subtitleText: {
120
+ marginTop: theme.spacing.unit * 1.5,
121
+ marginBottom: theme.spacing.unit
122
+ },
123
+ toolsHeader: {
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ justifyContent: 'space-between'
127
+ },
128
+ defaultTool: {
129
+ display: 'flex',
130
+ alignItems: 'center',
131
+ width: '300px'
132
+ },
133
+ defaultToolSelect: {
134
+ marginLeft: theme.spacing.unit,
135
+ textTransform: 'uppercase',
136
+ color: '#4d4d4d'
137
+ },
138
+ menuItem: {
139
+ textTransform: 'uppercase'
140
+ },
141
+ noDefaultTool: {
142
+ padding: theme.spacing.unit / 2
119
143
  }
120
144
  };
121
145
  };
122
146
 
123
147
  var Tools = function Tools(_ref) {
124
148
  var classes = _ref.classes,
149
+ availableTools = _ref.availableTools,
150
+ defaultTool = _ref.defaultTool,
125
151
  toolbarTools = _ref.toolbarTools,
126
- toggleToolBarTool = _ref.toggleToolBarTool;
127
- // label has to be placed at the end of the list
128
- var allToolsNoLabel = (allTools || []).filter(function (tool) {
152
+ toggleToolBarTool = _ref.toggleToolBarTool,
153
+ onDefaultToolChange = _ref.onDefaultToolChange;
154
+ var allTools = availableTools || [];
155
+ var isLabelAvailable = allTools.includes('label');
156
+ var toolbarToolsNoLabel = (toolbarTools || []).filter(function (tool) {
129
157
  return tool !== 'label';
130
158
  });
159
+
160
+ if (isLabelAvailable) {
161
+ // label has to be placed at the end of the list
162
+ var allToolsNoLabel = allTools.filter(function (tool) {
163
+ return tool !== 'label';
164
+ });
165
+ allTools = [].concat((0, _toConsumableArray2["default"])(allToolsNoLabel), ['label']);
166
+ }
167
+
131
168
  return /*#__PURE__*/React.createElement("div", {
132
169
  className: classes.graphingTools
133
- }, "GRAPHING TOOLS", /*#__PURE__*/React.createElement("div", {
170
+ }, /*#__PURE__*/React.createElement("div", {
171
+ className: classes.toolsHeader
172
+ }, /*#__PURE__*/React.createElement("span", null, "GRAPHING TOOLS"), toolbarToolsNoLabel.length > 0 && /*#__PURE__*/React.createElement("div", {
173
+ className: classes.defaultTool
174
+ }, /*#__PURE__*/React.createElement("span", null, "Default graphing tool:"), /*#__PURE__*/React.createElement(_core.Select, {
175
+ className: classes.defaultToolSelect,
176
+ onChange: onDefaultToolChange,
177
+ value: defaultTool,
178
+ disableUnderline: true
179
+ }, toolbarToolsNoLabel.map(function (tool, index) {
180
+ return /*#__PURE__*/React.createElement(_core.MenuItem, {
181
+ key: index,
182
+ className: classes.menuItem,
183
+ value: tool
184
+ }, tool);
185
+ })))), /*#__PURE__*/React.createElement("div", {
134
186
  className: classes.availableTools
135
- }, [].concat((0, _toConsumableArray2["default"])(allToolsNoLabel), ['label']).map(function (tool) {
187
+ }, allTools.map(function (tool) {
136
188
  var selected = toolbarTools.find(function (t) {
137
189
  return t === tool;
138
190
  });
@@ -217,10 +269,12 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
217
269
  });
218
270
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toggleToolBarTool", function (tool) {
219
271
  var _this$props$model = _this.props.model,
272
+ defaultTool = _this$props$model.defaultTool,
220
273
  toolbarTools = _this$props$model.toolbarTools,
221
274
  _this$props$model$ans = _this$props$model.answers,
222
275
  answers = _this$props$model$ans === void 0 ? {} : _this$props$model$ans;
223
276
  var updatedToolbarTools = (0, _toConsumableArray2["default"])(toolbarTools);
277
+ var newDefaultTool = defaultTool;
224
278
  var index = toolbarTools.findIndex(function (t) {
225
279
  return tool === t;
226
280
  });
@@ -230,6 +284,13 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
230
284
 
231
285
  updatedToolbarTools.splice(index, 1);
232
286
 
287
+ if (tool === defaultTool) {
288
+ var toolbarToolsNoLabel = (updatedToolbarTools || []).filter(function (tool) {
289
+ return tool !== 'label';
290
+ });
291
+ newDefaultTool = toolbarToolsNoLabel.length && toolbarToolsNoLabel[0] || '';
292
+ }
293
+
233
294
  if (!(0, _lodash.isEqual)(answers, updatedAnswers)) {
234
295
  _this.setState({
235
296
  dialog: {
@@ -239,7 +300,8 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
239
300
  onConfirm: function onConfirm() {
240
301
  return _this.handleAlertDialog(false, _this.updateModel({
241
302
  toolbarTools: updatedToolbarTools,
242
- answers: updatedAnswers
303
+ answers: updatedAnswers,
304
+ defaultTool: newDefaultTool
243
305
  }));
244
306
  },
245
307
  onClose: function onClose() {
@@ -252,10 +314,22 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
252
314
  }
253
315
  } else {
254
316
  updatedToolbarTools.push(tool);
317
+
318
+ if (defaultTool === '' && tool !== 'label') {
319
+ newDefaultTool = tool;
320
+ }
255
321
  }
256
322
 
257
323
  _this.updateModel({
258
- toolbarTools: updatedToolbarTools
324
+ toolbarTools: updatedToolbarTools,
325
+ defaultTool: newDefaultTool
326
+ });
327
+ });
328
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDefaultToolChange", function (event) {
329
+ var value = event.target.value;
330
+
331
+ _this.updateModel({
332
+ defaultTool: value
259
333
  });
260
334
  });
261
335
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "addAlternateResponse", function () {
@@ -320,6 +394,7 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
320
394
  var _this2 = this;
321
395
 
322
396
  var _this$props6 = this.props,
397
+ availableTools = _this$props6.availableTools,
323
398
  classes = _this$props6.classes,
324
399
  model = _this$props6.model;
325
400
  var dialog = this.state.dialog;
@@ -330,6 +405,7 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
330
405
  arrows = _ref7.arrows,
331
406
  backgroundMarks = _ref7.backgroundMarks,
332
407
  coordinatesOnHover = _ref7.coordinatesOnHover,
408
+ defaultTool = _ref7.defaultTool,
333
409
  domain = _ref7.domain,
334
410
  _ref7$graph = _ref7.graph,
335
411
  graph = _ref7$graph === void 0 ? {} : _ref7$graph,
@@ -338,13 +414,21 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
338
414
  title = _ref7.title,
339
415
  toolbarTools = _ref7.toolbarTools;
340
416
 
341
- return /*#__PURE__*/React.createElement("div", null, "Define Correct Response", /*#__PURE__*/React.createElement(Tools, {
417
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_core.Typography, {
418
+ component: "div",
419
+ variant: "subheading"
420
+ }, /*#__PURE__*/React.createElement("span", null, "Define Tool Set and Correct Response")), /*#__PURE__*/React.createElement(_core.Typography, {
421
+ component: "div",
422
+ variant: "body1",
423
+ className: classes.subtitleText
424
+ }, /*#__PURE__*/React.createElement("span", null, "Use this interface to choose which graphing tools students will be able to use, and to define the correct answer")), /*#__PURE__*/React.createElement(Tools, {
342
425
  classes: classes,
426
+ availableTools: availableTools,
427
+ defaultTool: defaultTool,
428
+ onDefaultToolChange: this.onDefaultToolChange,
343
429
  toggleToolBarTool: this.toggleToolBarTool,
344
430
  toolbarTools: toolbarTools
345
- }), /*#__PURE__*/React.createElement("div", {
346
- className: classes.container
347
- }, Object.entries(answers || {}).map(function (_ref8) {
431
+ }), Object.entries(answers || {}).map(function (_ref8) {
348
432
  var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
349
433
  key = _ref9[0],
350
434
  answer = _ref9[1];
@@ -388,7 +472,7 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
388
472
  }), /*#__PURE__*/React.createElement("div", {
389
473
  className: classes.button,
390
474
  onClick: this.addAlternateResponse
391
- }, "ADD ALTERNATE")), /*#__PURE__*/React.createElement(_configUi.AlertDialog, {
475
+ }, "ADD ALTERNATE"), /*#__PURE__*/React.createElement(_configUi.AlertDialog, {
392
476
  open: dialog.open,
393
477
  title: dialog.title,
394
478
  text: dialog.text,