@pie-element/drawing-response 4.1.9 → 4.2.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 +23 -0
- package/configure/CHANGELOG.md +22 -0
- package/configure/lib/defaults.js +4 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/root.js +52 -22
- package/configure/lib/root.js.map +1 -1
- package/configure/package.json +2 -2
- package/configure/src/__tests__/__snapshots__/root.test.jsx.snap +15 -0
- package/configure/src/defaults.js +4 -0
- package/configure/src/root.jsx +24 -3
- package/docs/config-schema.json +16 -0
- package/docs/config-schema.json.md +12 -0
- package/docs/demo/generate.js +2 -1
- package/docs/pie-schema.json +6 -0
- package/docs/pie-schema.json.md +4 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
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.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@4.1.9...@pie-element/drawing-response@4.2.0) (2022-10-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update snapshots ([9781596](https://github.com/pie-framework/pie-elements/commit/978159686bbbd6b727dff4b88ce4ab9606504586))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* set withRubric to false in item default configurations. Set rubricEnabled to true if it's enabled for drawing-response and extended-text-entry ([a209057](https://github.com/pie-framework/pie-elements/commit/a209057f5a3fa5438efc8595453c89c11959a8f5))
|
|
17
|
+
* update libs ([7e174fb](https://github.com/pie-framework/pie-elements/commit/7e174fba75e7ea668900ad5c103751cefe33e2af))
|
|
18
|
+
* **docs:** update docs ([23cab69](https://github.com/pie-framework/pie-elements/commit/23cab69700cfee41395941f99599253cba8a28a3))
|
|
19
|
+
* **drawing-response:** add pie-api config PD-23 ([d98fc22](https://github.com/pie-framework/pie-elements/commit/d98fc225c16f6bc89631f72ea488ff67feab3872))
|
|
20
|
+
* **drawing-response:** add settings to enable rubric. Add withRubric prop to configuration and rubricEnabled prop to model PD-2096 ([142429a](https://github.com/pie-framework/pie-elements/commit/142429a1a92af9e41f670d4f611e9bb62039a1f3))
|
|
21
|
+
* **drawing-response:** updated snapshot PD-2096 ([4e1a63c](https://github.com/pie-framework/pie-elements/commit/4e1a63cf0840c2ac93de0b314d56b9bb6c3835ac))
|
|
22
|
+
* enable spanish and special characters in author PD-2120 ([85fd3dd](https://github.com/pie-framework/pie-elements/commit/85fd3dd0fc10da1a2dfd5a842809c625790f8ba9))
|
|
23
|
+
* **drawing-response:** add uploadSoundSupport property PD-23-updated ([9a0f0b4](https://github.com/pie-framework/pie-elements/commit/9a0f0b4adb5d3956240fdebc62485c27572be495))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response@4.1.8...@pie-element/drawing-response@4.1.9) (2022-09-29)
|
|
7
30
|
|
|
8
31
|
**Note:** Version bump only for package @pie-element/drawing-response
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.9...@pie-element/drawing-response-configure@4.2.0) (2022-10-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update snapshots ([9781596](https://github.com/pie-framework/pie-elements/commit/978159686bbbd6b727dff4b88ce4ab9606504586))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* set withRubric to false in item default configurations. Set rubricEnabled to true if it's enabled for drawing-response and extended-text-entry ([a209057](https://github.com/pie-framework/pie-elements/commit/a209057f5a3fa5438efc8595453c89c11959a8f5))
|
|
17
|
+
* update libs ([7e174fb](https://github.com/pie-framework/pie-elements/commit/7e174fba75e7ea668900ad5c103751cefe33e2af))
|
|
18
|
+
* **drawing-response:** add pie-api config PD-23 ([d98fc22](https://github.com/pie-framework/pie-elements/commit/d98fc225c16f6bc89631f72ea488ff67feab3872))
|
|
19
|
+
* **drawing-response:** add settings to enable rubric. Add withRubric prop to configuration and rubricEnabled prop to model PD-2096 ([142429a](https://github.com/pie-framework/pie-elements/commit/142429a1a92af9e41f670d4f611e9bb62039a1f3))
|
|
20
|
+
* **drawing-response:** updated snapshot PD-2096 ([4e1a63c](https://github.com/pie-framework/pie-elements/commit/4e1a63cf0840c2ac93de0b314d56b9bb6c3835ac))
|
|
21
|
+
* enable spanish and special characters in author PD-2120 ([85fd3dd](https://github.com/pie-framework/pie-elements/commit/85fd3dd0fc10da1a2dfd5a842809c625790f8ba9))
|
|
22
|
+
* **drawing-response:** add uploadSoundSupport property PD-23-updated ([9a0f0b4](https://github.com/pie-framework/pie-elements/commit/9a0f0b4adb5d3956240fdebc62485c27572be495))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.8...@pie-element/drawing-response-configure@4.1.9) (2022-09-29)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @pie-element/drawing-response-configure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","spellCheckEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","enabled","backgroundImage","teacherInstructions","maxImageWidth","maxImageHeight"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,aAAa,EAAE,IAPV;AAQLC,IAAAA,0BAA0B,EAAE,IARvB;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,iBAAiB,EAAC,IAXb;AAYLC,IAAAA,qBAAqB,EAAE;AAZlB,GADM;AAebC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAC,KAFC;AAGVC,MAAAA,OAAO,EAAC;AAHE,KADC;AAMbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE;AAFQ,KANJ;AAUbb,IAAAA,MAAM,EAAE;AACNc,MAAAA,QAAQ,EAAE,IADJ;AAEND,MAAAA,KAAK,EAAE;AAFD,KAVK;AAcbI,IAAAA,mBAAmB,EAAE;AACnBH,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KAdR;AAkBbK,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE,GADR;AAEbjB,MAAAA,MAAM,EAAE;AAFK,KAlBF;AAsBbmB,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE,GADP;AAEdjB,MAAAA,MAAM,EAAE;AAFM;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","spellCheckEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","enabled","backgroundImage","teacherInstructions","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,aAAa,EAAE,IAPV;AAQLC,IAAAA,0BAA0B,EAAE,IARvB;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,iBAAiB,EAAC,IAXb;AAYLC,IAAAA,qBAAqB,EAAE;AAZlB,GADM;AAebC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAC,KAFC;AAGVC,MAAAA,OAAO,EAAC;AAHE,KADC;AAMbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE;AAFQ,KANJ;AAUbb,IAAAA,MAAM,EAAE;AACNc,MAAAA,QAAQ,EAAE,IADJ;AAEND,MAAAA,KAAK,EAAE;AAFD,KAVK;AAcbI,IAAAA,mBAAmB,EAAE;AACnBH,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KAdR;AAkBbK,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE,GADR;AAEbjB,MAAAA,MAAM,EAAE;AAFK,KAlBF;AAsBbmB,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE,GADP;AAEdjB,MAAAA,MAAM,EAAE;AAFM,KAtBH;AA0BboB,IAAAA,UAAU,EAAE;AACVN,MAAAA,QAAQ,EAAE,KADA;AAEVD,MAAAA,KAAK,EAAE;AAFG;AA1BC;AAfF,C","sourcesContent":["export default {\n model: {\n prompt: 'This is the question prompt',\n imageUrl: '',\n imageDimensions: {\n height: 0,\n width: 0\n },\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n spellCheckEnabled:true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings:false,\n enabled:true\n },\n backgroundImage: {\n settings: true,\n label: 'Background Image'\n },\n prompt: {\n settings: true,\n label: 'Prompt'\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric'\n }\n }\n};\n"],"file":"defaults.js"}
|
package/configure/lib/root.js
CHANGED
|
@@ -100,6 +100,23 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
(0, _createClass2["default"])(Root, [{
|
|
103
|
+
key: "componentDidMount",
|
|
104
|
+
value: function componentDidMount() {
|
|
105
|
+
var _ref = this.props || {},
|
|
106
|
+
model = _ref.model,
|
|
107
|
+
onModelChanged = _ref.onModelChanged,
|
|
108
|
+
configuration = _ref.configuration;
|
|
109
|
+
|
|
110
|
+
var _ref2 = configuration || {},
|
|
111
|
+
withRubric = _ref2.withRubric;
|
|
112
|
+
|
|
113
|
+
if (withRubric.enabled) {
|
|
114
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
115
|
+
rubricEnabled: true
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
103
120
|
key: "render",
|
|
104
121
|
value: function render() {
|
|
105
122
|
var _this$props5 = this.props,
|
|
@@ -111,25 +128,27 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
111
128
|
onConfigurationChanged = _this$props5.onConfigurationChanged,
|
|
112
129
|
onModelChanged = _this$props5.onModelChanged;
|
|
113
130
|
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
backgroundImage =
|
|
117
|
-
|
|
118
|
-
prompt =
|
|
119
|
-
|
|
120
|
-
teacherInstructions =
|
|
121
|
-
|
|
122
|
-
spellCheck =
|
|
123
|
-
|
|
124
|
-
maxImageWidth =
|
|
125
|
-
|
|
126
|
-
maxImageHeight =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
var _ref3 = configuration || {},
|
|
132
|
+
_ref3$backgroundImage = _ref3.backgroundImage,
|
|
133
|
+
backgroundImage = _ref3$backgroundImage === void 0 ? {} : _ref3$backgroundImage,
|
|
134
|
+
_ref3$prompt = _ref3.prompt,
|
|
135
|
+
prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
|
|
136
|
+
_ref3$teacherInstruct = _ref3.teacherInstructions,
|
|
137
|
+
teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
|
|
138
|
+
_ref3$spellCheck = _ref3.spellCheck,
|
|
139
|
+
spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
|
|
140
|
+
_ref3$maxImageWidth = _ref3.maxImageWidth,
|
|
141
|
+
maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
|
|
142
|
+
_ref3$maxImageHeight = _ref3.maxImageHeight,
|
|
143
|
+
maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight,
|
|
144
|
+
withRubric = _ref3.withRubric;
|
|
145
|
+
|
|
146
|
+
var _ref4 = model || {},
|
|
147
|
+
teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
|
|
148
|
+
promptEnabled = _ref4.promptEnabled,
|
|
149
|
+
spellCheckEnabled = _ref4.spellCheckEnabled,
|
|
150
|
+
backgroundImageEnabled = _ref4.backgroundImageEnabled,
|
|
151
|
+
rubricEnabled = _ref4.rubricEnabled;
|
|
133
152
|
|
|
134
153
|
var toolbarOpts = {};
|
|
135
154
|
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
@@ -160,7 +179,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
160
179
|
},
|
|
161
180
|
Properties: {
|
|
162
181
|
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
163
|
-
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
|
|
182
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
183
|
+
rubricEnabled: withRubric.settings && toggle(withRubric.label)
|
|
164
184
|
}
|
|
165
185
|
}
|
|
166
186
|
})
|
|
@@ -178,7 +198,12 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
178
198
|
spellCheck: spellCheckEnabled,
|
|
179
199
|
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
180
200
|
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
181
|
-
uploadSoundSupport: uploadSoundSupport
|
|
201
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
202
|
+
languageCharactersProps: [{
|
|
203
|
+
language: 'spanish'
|
|
204
|
+
}, {
|
|
205
|
+
language: 'special'
|
|
206
|
+
}]
|
|
182
207
|
})), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
183
208
|
label: "Item Stem",
|
|
184
209
|
className: classes.prompt
|
|
@@ -190,7 +215,12 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
190
215
|
imageSupport: imageSupport,
|
|
191
216
|
maxImageWidth: defaultImageMaxWidth,
|
|
192
217
|
maxImageHeight: defaultImageMaxHeight,
|
|
193
|
-
uploadSoundSupport: uploadSoundSupport
|
|
218
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
219
|
+
languageCharactersProps: [{
|
|
220
|
+
language: 'spanish'
|
|
221
|
+
}, {
|
|
222
|
+
language: 'special'
|
|
223
|
+
}]
|
|
194
224
|
})), backgroundImageEnabled && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
195
225
|
className: classes.label,
|
|
196
226
|
variant: "subheading"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","prompt","props","model","onModelChanged","update","teacherInstructions","dimensions","imageDimensions","imageUrl","classes","configuration","imageSupport","uploadSoundSupport","onConfigurationChanged","backgroundImage","spellCheck","maxImageWidth","maxImageHeight","teacherInstructionsEnabled","promptEnabled","spellCheckEnabled","backgroundImageEnabled","toolbarOpts","defaultImageMaxWidth","defaultImageMaxHeight","toolbarEditorPosition","position","base","Settings","label","Properties","regular","onTeacherInstructionsChanged","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","marginTop","spacing","unit","paddingTop","width","marginBottom","propTypes","PropTypes","object","isRequired","shape","add","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;wGACO,UAACC,MAAD,EAAY;AAC5B,wBAAkC,MAAKC,KAAvC;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AACA,UAAMC,MAAM,GAAG,2BAAUF,KAAV,CAAf;AAEAC,MAAAA,cAAc,iCACTC,MADS;AAEZJ,QAAAA,MAAM,EAANA;AAFY,SAAd;AAID,K;qHAE8B,UAACK,mBAAD,EAAyB;AACtD,yBAAkC,MAAKJ,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAA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IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWX,MAAX,EAAmBvC,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport ImageContainer from './image-container';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onPromptChanged = (prompt) => {\n const { model, onModelChanged } = this.props;\n const update = cloneDeep(model);\n\n onModelChanged({\n ...update,\n prompt,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n teacherInstructions,\n });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n imageDimensions: dimensions,\n });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n imageUrl,\n });\n };\n\n render() {\n const {\n classes,\n configuration,\n model,\n imageSupport,\n uploadSoundSupport,\n onConfigurationChanged,\n onModelChanged,\n } = this.props;\n const {\n backgroundImage = {},\n prompt = {},\n teacherInstructions = {},\n spellCheck = {},\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, spellCheckEnabled, backgroundImageEnabled } =\n model || {};\n const toolbarOpts = {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n return (\n <div className={classes.base}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: {\n backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label)\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n },\n }}\n />\n }\n >\n <div className={classes.regular}>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.prompt}\n >\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label=\"Item Stem\" className={classes.prompt}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n imageSupport={imageSupport}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n )}\n\n {backgroundImageEnabled && (\n <div>\n <Typography className={classes.label} variant=\"subheading\">\n Define Background Image\n </Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </div>\n )}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 3,\n },\n label: {\n marginTop: theme.spacing.unit * 4,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n regular: {\n marginBottom: theme.spacing.unit * 3,\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
|
|
1
|
+
{"version":3,"sources":["../src/root.jsx"],"names":["Panel","settings","toggle","Root","prompt","props","model","onModelChanged","update","teacherInstructions","dimensions","imageDimensions","imageUrl","configuration","withRubric","enabled","rubricEnabled","classes","imageSupport","uploadSoundSupport","onConfigurationChanged","backgroundImage","spellCheck","maxImageWidth","maxImageHeight","teacherInstructionsEnabled","promptEnabled","spellCheckEnabled","backgroundImageEnabled","toolbarOpts","defaultImageMaxWidth","defaultImageMaxHeight","toolbarEditorPosition","position","base","Settings","label","Properties","regular","onTeacherInstructionsChanged","language","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","marginTop","spacing","unit","paddingTop","width","marginBottom","propTypes","PropTypes","object","isRequired","shape","add","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA0BC,kBAA1B,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA0BD,kBAA1B,CAAeC,MAAf;;IAEaC,I;;;;;;;;;;;;;;;wGACO,UAACC,MAAD,EAAY;AAC5B,wBAAkC,MAAKC,KAAvC;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eAAeA,cAAf;AACA,UAAMC,MAAM,GAAG,2BAAUF,KAAV,CAAf;AAEAC,MAAAA,cAAc,iCACTC,MADS;AAEZJ,QAAAA,MAAM,EAANA;AAFY,SAAd;AAID,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C,IAAd,GAAqB;AAD3B,KAJkB;AAOzB9C,IAAAA,MAAM,EAAE;AACN+C,MAAAA,UAAU,EAAEJ,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAD3B;AAENE,MAAAA,KAAK,EAAE;AAFD,KAPiB;AAWzBd,IAAAA,OAAO,EAAE;AACPe,MAAAA,YAAY,EAAEN,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB;AAD5B;AAXgB,GAAZ;AAAA,CAAf;;AAgBA/C,IAAI,CAACmD,SAAL,GAAiB;AACfrC,EAAAA,OAAO,EAAEsC,sBAAUC,MAAV,CAAiBC,UADX;AAEf5C,EAAAA,aAAa,EAAE0C,sBAAUC,MAFV;AAGflD,EAAAA,KAAK,EAAEiD,sBAAUC,MAAV,CAAiBC,UAHT;AAIfvC,EAAAA,YAAY,EAAEqC,sBAAUG,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEJ,sBAAUK,IADa;AAE5B,cAAQL,sBAAUK;AAFU,GAAhB,CAJC;AAQfzC,EAAAA,kBAAkB,EAAEoC,sBAAUG,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEJ,sBAAUK,IADmB;AAElC,cAAQL,sBAAUK;AAFgB,GAAhB,CARL;AAYfrD,EAAAA,cAAc,EAAEgD,sBAAUK,IAAV,CAAeH,UAZhB;AAafrC,EAAAA,sBAAsB,EAAEmC,sBAAUK,IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWX,MAAX,EAAmB3C,IAAnB,C","sourcesContent":["import React from 'react';\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport ImageContainer from './image-container';\nimport cloneDeep from 'lodash/cloneDeep';\n\nconst { Panel, toggle } = settings;\n\nexport class Root extends React.Component {\n onPromptChanged = (prompt) => {\n const { model, onModelChanged } = this.props;\n const update = cloneDeep(model);\n\n onModelChanged({\n ...update,\n prompt,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n teacherInstructions,\n });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n imageDimensions: dimensions,\n });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n imageUrl,\n });\n };\n\n componentDidMount() {\n const { model, onModelChanged, configuration } = this.props || {};\n const { withRubric } = configuration || {};\n\n if (withRubric.enabled) {\n onModelChanged({\n ...model,\n rubricEnabled: true,\n });\n }\n }\n\n render() {\n const {\n classes,\n configuration,\n model,\n imageSupport,\n uploadSoundSupport,\n onConfigurationChanged,\n onModelChanged,\n } = this.props;\n const {\n backgroundImage = {},\n prompt = {},\n teacherInstructions = {},\n spellCheck = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric,\n } = configuration || {};\n const {\n teacherInstructionsEnabled,\n promptEnabled,\n spellCheckEnabled,\n backgroundImageEnabled,\n rubricEnabled\n } = model || {};\n const toolbarOpts = {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n return (\n <div className={classes.base}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: {\n backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label)\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric.settings && toggle(withRubric.label)\n },\n }}\n />\n }\n >\n <div className={classes.regular}>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.prompt}\n >\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label=\"Item Stem\" className={classes.prompt}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n imageSupport={imageSupport}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {backgroundImageEnabled && (\n <div>\n <Typography className={classes.label} variant=\"subheading\">\n Define Background Image\n </Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </div>\n )}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst styles = (theme) => ({\n base: {\n marginTop: theme.spacing.unit * 3,\n },\n label: {\n marginTop: theme.spacing.unit * 4,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n regular: {\n marginBottom: theme.spacing.unit * 3,\n },\n});\n\nRoot.propTypes = {\n classes: PropTypes.object.isRequired,\n configuration: PropTypes.object,\n model: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func,\n delete: PropTypes.func,\n }),\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles)(Root);\n"],"file":"root.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drawing-response-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
-
"@pie-lib/config-ui": "^11.0.
|
|
12
|
+
"@pie-lib/config-ui": "^11.0.20",
|
|
13
13
|
"@pie-lib/editable-html": "^9.2.2",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
15
15
|
"debug": "^3.1.0",
|
|
@@ -32,11 +32,16 @@ exports[`Root snapshot renders 1`] = `
|
|
|
32
32
|
"label": "Teacher Instructions",
|
|
33
33
|
"settings": true,
|
|
34
34
|
},
|
|
35
|
+
"withRubric": Object {
|
|
36
|
+
"label": "Add Rubric",
|
|
37
|
+
"settings": false,
|
|
38
|
+
},
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
41
|
groups={
|
|
38
42
|
Object {
|
|
39
43
|
"Properties": Object {
|
|
44
|
+
"rubricEnabled": false,
|
|
40
45
|
"spellCheckEnabled": false,
|
|
41
46
|
"teacherInstructionsEnabled": undefined,
|
|
42
47
|
},
|
|
@@ -67,6 +72,16 @@ exports[`Root snapshot renders 1`] = `
|
|
|
67
72
|
label="Item Stem"
|
|
68
73
|
>
|
|
69
74
|
<EditableHtml
|
|
75
|
+
languageCharactersProps={
|
|
76
|
+
Array [
|
|
77
|
+
Object {
|
|
78
|
+
"language": "spanish",
|
|
79
|
+
},
|
|
80
|
+
Object {
|
|
81
|
+
"language": "special",
|
|
82
|
+
},
|
|
83
|
+
]
|
|
84
|
+
}
|
|
70
85
|
markup="Test Prompt"
|
|
71
86
|
maxImageHeight={300}
|
|
72
87
|
maxImageWidth={300}
|
package/configure/src/root.jsx
CHANGED
|
@@ -48,6 +48,18 @@ export class Root extends React.Component {
|
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
componentDidMount() {
|
|
52
|
+
const { model, onModelChanged, configuration } = this.props || {};
|
|
53
|
+
const { withRubric } = configuration || {};
|
|
54
|
+
|
|
55
|
+
if (withRubric.enabled) {
|
|
56
|
+
onModelChanged({
|
|
57
|
+
...model,
|
|
58
|
+
rubricEnabled: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
51
63
|
render() {
|
|
52
64
|
const {
|
|
53
65
|
classes,
|
|
@@ -64,10 +76,16 @@ export class Root extends React.Component {
|
|
|
64
76
|
teacherInstructions = {},
|
|
65
77
|
spellCheck = {},
|
|
66
78
|
maxImageWidth = {},
|
|
67
|
-
maxImageHeight = {}
|
|
79
|
+
maxImageHeight = {},
|
|
80
|
+
withRubric,
|
|
68
81
|
} = configuration || {};
|
|
69
|
-
const {
|
|
70
|
-
|
|
82
|
+
const {
|
|
83
|
+
teacherInstructionsEnabled,
|
|
84
|
+
promptEnabled,
|
|
85
|
+
spellCheckEnabled,
|
|
86
|
+
backgroundImageEnabled,
|
|
87
|
+
rubricEnabled
|
|
88
|
+
} = model || {};
|
|
71
89
|
const toolbarOpts = {};
|
|
72
90
|
|
|
73
91
|
const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
@@ -102,6 +120,7 @@ export class Root extends React.Component {
|
|
|
102
120
|
toggle(teacherInstructions.label),
|
|
103
121
|
spellCheckEnabled:
|
|
104
122
|
spellCheck.settings && toggle(spellCheck.label),
|
|
123
|
+
rubricEnabled: withRubric.settings && toggle(withRubric.label)
|
|
105
124
|
},
|
|
106
125
|
}}
|
|
107
126
|
/>
|
|
@@ -123,6 +142,7 @@ export class Root extends React.Component {
|
|
|
123
142
|
maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}
|
|
124
143
|
maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}
|
|
125
144
|
uploadSoundSupport={uploadSoundSupport}
|
|
145
|
+
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
126
146
|
/>
|
|
127
147
|
</InputContainer>
|
|
128
148
|
)}
|
|
@@ -138,6 +158,7 @@ export class Root extends React.Component {
|
|
|
138
158
|
maxImageWidth={defaultImageMaxWidth}
|
|
139
159
|
maxImageHeight={defaultImageMaxHeight}
|
|
140
160
|
uploadSoundSupport={uploadSoundSupport}
|
|
161
|
+
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
|
|
141
162
|
/>
|
|
142
163
|
</InputContainer>
|
|
143
164
|
)}
|
package/docs/config-schema.json
CHANGED
|
@@ -130,6 +130,22 @@
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
+
"withRubric": {
|
|
134
|
+
"title": "ConfigureProp",
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {
|
|
137
|
+
"settings": {
|
|
138
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"title": "settings"
|
|
141
|
+
},
|
|
142
|
+
"label": {
|
|
143
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
144
|
+
"type": "string",
|
|
145
|
+
"title": "label"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
133
149
|
"showPrompt": {
|
|
134
150
|
"description": "Determines whether prompt field will be displayed or not",
|
|
135
151
|
"default": true,
|
|
@@ -99,6 +99,18 @@ Indicates the max dimension for images in prompt - this is also the default dime
|
|
|
99
99
|
|
|
100
100
|
Indicates the max dimension for images in rationale
|
|
101
101
|
|
|
102
|
+
# `withRubric` (object)
|
|
103
|
+
|
|
104
|
+
Properties of the `withRubric` object:
|
|
105
|
+
|
|
106
|
+
## `settings` (boolean)
|
|
107
|
+
|
|
108
|
+
Indicates if the item has to be displayed in the Settings Panel
|
|
109
|
+
|
|
110
|
+
## `label` (string)
|
|
111
|
+
|
|
112
|
+
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
113
|
+
|
|
102
114
|
# `showPrompt` (boolean)
|
|
103
115
|
|
|
104
116
|
Determines whether prompt field will be displayed or not
|
package/docs/demo/generate.js
CHANGED
package/docs/pie-schema.json
CHANGED
|
@@ -83,6 +83,11 @@
|
|
|
83
83
|
"type": "string",
|
|
84
84
|
"title": "toolbarEditorPosition"
|
|
85
85
|
},
|
|
86
|
+
"rubricEnabled": {
|
|
87
|
+
"description": "Indicates if Rubric is enabled",
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"title": "rubricEnabled"
|
|
90
|
+
},
|
|
86
91
|
"id": {
|
|
87
92
|
"description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
|
|
88
93
|
"type": "string",
|
|
@@ -99,6 +104,7 @@
|
|
|
99
104
|
"element",
|
|
100
105
|
"id",
|
|
101
106
|
"imageDimensions",
|
|
107
|
+
"rubricEnabled",
|
|
102
108
|
"spellCheckEnabled",
|
|
103
109
|
"studentInstructionsEnabled",
|
|
104
110
|
"teacherInstructionsEnabled"
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -65,6 +65,10 @@ This element must be one of the following enum values:
|
|
|
65
65
|
|
|
66
66
|
Default: `": 'bottom'"`
|
|
67
67
|
|
|
68
|
+
# `rubricEnabled` (boolean, required)
|
|
69
|
+
|
|
70
|
+
Indicates if Rubric is enabled
|
|
71
|
+
|
|
68
72
|
# `id` (string, required)
|
|
69
73
|
|
|
70
74
|
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drawing-response",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"author": "pie framework developers",
|
|
26
26
|
"license": "ISC",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "2d74cf6e1f9ad7921efc46779c0e5028d787b9d3",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"postpublish": "../../scripts/postpublish"
|
|
30
30
|
},
|