@pie-element/extended-text-entry 9.0.1-next.2 → 9.0.1-next.39
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 +1 -1
- package/configure/CHANGELOG.md +1 -1
- package/configure/lib/index.js +40 -4
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +2 -9
- package/configure/lib/main.js.map +1 -1
- package/docs/config-schema.json +2 -2
- package/docs/config-schema.json.md +8 -2
- package/docs/pie-schema.json +1 -1
- package/docs/pie-schema.json.md +4 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/main.js +19 -16
- package/lib/main.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -163,7 +163,7 @@ The default bahaviour is to disable the spellcheck for the player.
|
|
|
163
163
|
|
|
164
164
|
### Features
|
|
165
165
|
|
|
166
|
-
* add a different property in the config,
|
|
166
|
+
* add a different property in the config, to force a value ([300c664](https://github.com/pie-framework/pie-elements/commit/300c664618f46177137deef3bced2d096cdb8126))
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -160,7 +160,7 @@ The default bahaviour is to disable the spellcheck for the player.
|
|
|
160
160
|
|
|
161
161
|
### Features
|
|
162
162
|
|
|
163
|
-
* add a different property in the config,
|
|
163
|
+
* add a different property in the config, to force a value ([300c664](https://github.com/pie-framework/pie-elements/commit/300c664618f46177137deef3bced2d096cdb8126))
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
|
package/configure/lib/index.js
CHANGED
|
@@ -45,25 +45,49 @@ var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
45
45
|
var _super = _createSuper(ExtendedTextEntry);
|
|
46
46
|
|
|
47
47
|
function ExtendedTextEntry() {
|
|
48
|
+
var _this$_configuration$;
|
|
49
|
+
|
|
48
50
|
var _this;
|
|
49
51
|
|
|
50
52
|
(0, _classCallCheck2["default"])(this, ExtendedTextEntry);
|
|
51
53
|
_this = _super.call(this);
|
|
52
|
-
_this.
|
|
53
|
-
|
|
54
|
+
_this._configuration = _defaults["default"].configuration; // if configuration.withRubric.forceEnabled is true, then we
|
|
55
|
+
// update the configuration (we do not want to display the toggle in the Settings Panel)
|
|
56
|
+
|
|
57
|
+
if ((_this$_configuration$ = _this._configuration.withRubric) !== null && _this$_configuration$ !== void 0 && _this$_configuration$.forceEnabled) {
|
|
58
|
+
_this._configuration.withRubric.settings = false;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_this._model = ExtendedTextEntry.createDefaultModel({}, _this._configuration);
|
|
54
62
|
return _this;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
(0, _createClass2["default"])(ExtendedTextEntry, [{
|
|
58
66
|
key: "model",
|
|
59
67
|
set: function set(m) {
|
|
60
|
-
this._model = ExtendedTextEntry.createDefaultModel(m);
|
|
68
|
+
this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);
|
|
61
69
|
this.render();
|
|
62
70
|
}
|
|
63
71
|
}, {
|
|
64
72
|
key: "configuration",
|
|
65
73
|
set: function set(c) {
|
|
66
74
|
this._configuration = _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
|
|
75
|
+
|
|
76
|
+
var _ref = c || {},
|
|
77
|
+
_ref$withRubric = _ref.withRubric,
|
|
78
|
+
withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric; // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)
|
|
79
|
+
// without triggering the Model Updated event (for more details, check documentation)
|
|
80
|
+
// and also update the configuration (we do not want to display the toggle in the Settings Panel)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if (withRubric !== null && withRubric !== void 0 && withRubric.forceEnabled) {
|
|
84
|
+
this._configuration.withRubric.settings = false;
|
|
85
|
+
|
|
86
|
+
if (!this._model.rubricEnabled) {
|
|
87
|
+
this._model.rubricEnabled = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
67
91
|
this.render();
|
|
68
92
|
}
|
|
69
93
|
}, {
|
|
@@ -137,7 +161,19 @@ var ExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
137
161
|
|
|
138
162
|
exports["default"] = ExtendedTextEntry;
|
|
139
163
|
(0, _defineProperty2["default"])(ExtendedTextEntry, "createDefaultModel", function () {
|
|
164
|
+
var _config$withRubric;
|
|
165
|
+
|
|
140
166
|
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
141
|
-
|
|
167
|
+
var config = arguments.length > 1 ? arguments[1] : undefined;
|
|
168
|
+
|
|
169
|
+
var defaultModel = _objectSpread(_objectSpread({}, _defaults["default"].model), model); // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)
|
|
170
|
+
// without triggering the Model Updated event (for more details, check documentation)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
if (config !== null && config !== void 0 && (_config$withRubric = config.withRubric) !== null && _config$withRubric !== void 0 && _config$withRubric.forceEnabled && !defaultModel.rubricEnabled) {
|
|
174
|
+
defaultModel.rubricEnabled = true;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return defaultModel;
|
|
142
178
|
});
|
|
143
179
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["ExtendedTextEntry","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["ExtendedTextEntry","_configuration","defaults","configuration","withRubric","forceEnabled","settings","_model","createDefaultModel","m","render","c","rubricEnabled","dispatchEvent","ModelUpdatedEvent","onModelChanged","handler","InsertImageEvent","src","done","DeleteImageEvent","InsertSoundEvent","DeleteSoundEvent","element","React","createElement","Main","model","bind","onConfigurationChanged","imageSupport","add","insertImage","onDeleteImage","uploadSoundSupport","insertSound","onDeleteSound","ReactDOM","HTMLElement","config","defaultModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA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B,CAAsB,IAAtB,CADa;AAElB,sBAAQ,KAAKQ,aAAL,CAAmBR,IAAnB,CAAwB,IAAxB;AAFU;AAToB,SAA1B,CAAhB;;AAeAS,6BAAS3B,MAAT,CAAgBa,OAAhB,EAAyB,IAAzB;AACD;AACF;;;kDAnH4Ce,W;;;iCAA1BtC,iB,wBACS,YAAwB;AAAA;;AAAA,MAAvB2B,KAAuB,uEAAf,EAAe;AAAA,MAAXY,MAAW;;AAClD,MAAMC,YAAY,mCACbtC,qBAASyB,KADI,GAEbA,KAFa,CAAlB,CADkD,CAMlD;AACA;;;AACA,MAAIY,MAAM,SAAN,IAAAA,MAAM,WAAN,0BAAAA,MAAM,CAAEnC,UAAR,kEAAoBC,YAApB,IAAoC,CAACmC,YAAY,CAAC5B,aAAtD,EAAqE;AACnE4B,IAAAA,YAAY,CAAC5B,aAAb,GAA6B,IAA7B;AACD;;AAED,SAAO4B,YAAP;AACD,C","sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class ExtendedTextEntry extends HTMLElement {\n static createDefaultModel = (model = {}, config) => {\n const defaultModel = {\n ...defaults.model,\n ...model,\n };\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n if (config?.withRubric?.forceEnabled && !defaultModel.rubricEnabled) {\n defaultModel.rubricEnabled = true;\n }\n\n return defaultModel;\n };\n\n\n constructor() {\n super();\n this._configuration = defaults.configuration;\n\n // if configuration.withRubric.forceEnabled is true, then we\n // update the configuration (we do not want to display the toggle in the Settings Panel)\n if (this._configuration.withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n }\n\n this._model = ExtendedTextEntry.createDefaultModel({}, this._configuration);\n }\n\n set model(m) {\n this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);\n this.render();\n }\n\n set configuration(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n const { withRubric = {} } = c || {};\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n // and also update the configuration (we do not want to display the toggle in the Settings Panel)\n if (withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n\n if (!this._model.rubricEnabled) {\n this._model.rubricEnabled = true;\n }\n }\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\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 element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\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 ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}
|
package/configure/lib/main.js
CHANGED
|
@@ -205,7 +205,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
205
205
|
Properties: panelProperties
|
|
206
206
|
}
|
|
207
207
|
})
|
|
208
|
-
},
|
|
208
|
+
}, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
209
209
|
label: teacherInstructions.label,
|
|
210
210
|
className: classes.promptContainer
|
|
211
211
|
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
@@ -252,7 +252,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
252
252
|
feedback: model.feedback || defaultFeedback,
|
|
253
253
|
onChange: this.changeFeedback,
|
|
254
254
|
toolbarOpts: toolbarOpts
|
|
255
|
-
})))
|
|
255
|
+
})));
|
|
256
256
|
}
|
|
257
257
|
}]);
|
|
258
258
|
return Main;
|
|
@@ -278,13 +278,6 @@ var _default = (0, _styles.withStyles)(function (theme) {
|
|
|
278
278
|
paddingTop: theme.spacing.unit * 2,
|
|
279
279
|
marginBottom: theme.spacing.unit * 2,
|
|
280
280
|
width: '100%'
|
|
281
|
-
},
|
|
282
|
-
promptInput: {
|
|
283
|
-
width: '100%',
|
|
284
|
-
marginBottom: theme.spacing.unit
|
|
285
|
-
},
|
|
286
|
-
field: {
|
|
287
|
-
width: '200px'
|
|
288
281
|
}
|
|
289
282
|
};
|
|
290
283
|
})(Main);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","numberFields","dropdown","defaultFeedback","type","Main","props","markup","onModelChanged","model","prompt","feedback","update","teacherInstructions","state","setDimensions","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","dimensions","equationEditor","playerSpellCheck","settingsPanelDisabled","spanishInput","specialInput","spellCheck","studentInstructions","mathInput","maxImageWidth","maxImageHeight","multiple","withRubric","feedbackEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","width","suffix","min","max","height","playerSpellCheckDisabled","panelProperties","studentInstructionsEnabled","rubricEnabled","config","Settings","Properties","promptContainer","changeTeacherInstructions","language","ALL_PLUGINS","onPromptChange","header","changeFeedback","React","Component","PropTypes","func","isRequired","object","theme","paddingBottom","spacing","unit","paddingTop","marginBottom","promptInput","field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkDC,kBAAlD,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkDD,kBAAlD,CAAeC,MAAf;AAAA,IAAuBC,YAAvB,GAAkDF,kBAAlD,CAAuBE,YAAvB;AAAA,IAAqCC,QAArC,GAAkDH,kBAAlD,CAAqCG,QAArC;AAEA,IAAMC,eAAe,GAAG;AACtBC,EAAAA,IAAI,EAAE,SADgB;AAEtB,aAAS;AAFa,CAAxB;;IAKaC,I;;;;;AAWX,gBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,uGAKF,UAACC,MAAD,EAAY;AAC3B,wBAAkC,MAAKD,KAAvC;AAAA,UAAQE,cAAR,eAAQA,cAAR;AAAA,UAAwBC,KAAxB,eAAwBA,KAAxB;AAEAD,MAAAA,cAAc,iCAAMC,KAAN;AAAaC,QAAAA,MAAM,EAAEH;AAArB,SAAd;AACD,KATkB;AAAA,uGAWF,UAACI,QAAD,EAAc;AAC7B,yBAAkC,MAAKL,KAAvC;AAAA,UAAQG,KAAR,gBAAQA,KAAR;AAAA,UAAeD,cAAf,gBAAeA,cAAf;;AACA,UAAMI,MAAM,mCAAQH,KAAR;AAAeE,QAAAA,QAAQ,EAARA;AAAf,QAAZ;;AAEAH,MAAAA,cAAc,CAACI,MAAD,CAAd;AACD,KAhBkB;AAAA,kHAkBS,UAACC,mBAAD,EAAyB;AACnD,yBAAkC,MAAKP,KAAvC;AAAA,UAAQG,KAAR,gBAAQA,KAAR;AAAA,UAAeD,cAAf,gBAAeA,cAAf;;AACA,UAAMI,MAAM,mCAAQH,KAAR;AAAeI,QAAAA,mBAAmB,EAAnBA;AAAf,QAAZ;;AAEAL,MAAAA,cA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BlD,EAAAA,sBAAsB,EAAEgD,sBAAUC,IAFjB;AAGjB3D,EAAAA,KAAK,EAAE0D,sBAAUG,MAAV,CAAiBD,UAHP;AAIjBpD,EAAAA,aAAa,EAAEkD,sBAAUG,MAAV,CAAiBD,UAJf;AAKjBnD,EAAAA,YAAY,EAAEiD,sBAAUG,MAAV,CAAiBD,UALd;AAMjBjD,EAAAA,kBAAkB,EAAE+C,sBAAUG,MAAV,CAAiBD,UANpB;AAOjBrD,EAAAA,OAAO,EAAEmD,sBAAUG,MAAV,CAAiBD;AAPT,C;;eAgLN,wBAAW,UAACE,KAAD;AAAA,SAAY;AACpCR,IAAAA,MAAM,EAAE;AACNS,MAAAA,aAAa,EAAED,KAAK,CAACE,OAAN,CAAcC;AADvB,KAD4B;AAIpChB,IAAAA,eAAe,EAAE;AACfiB,MAAAA,UAAU,EAAEJ,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CADlB;AAEfE,MAAAA,YAAY,EAAEL,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAFpB;AAGf5B,MAAAA,KAAK,EAAE;AAHQ,KAJmB;AASpC+B,IAAAA,WAAW,EAAE;AACX/B,MAAAA,KAAK,EAAE,MADI;AAEX8B,MAAAA,YAAY,EAAEL,KAAK,CAACE,OAAN,CAAcC;AAFjB,KATuB;AAapCI,IAAAA,KAAK,EAAE;AACLhC,MAAAA,KAAK,EAAE;AADF;AAb6B,GAAZ;AAAA,CAAX,EAgBXzC,IAhBW,C","sourcesContent":["import React from 'react';\nimport { FeedbackSelector, InputContainer, settings, layout } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\n\nconst { Panel, toggle, numberFields, dropdown } = settings;\n\nconst defaultFeedback = {\n type: 'default',\n default: 'Your answer has been submitted',\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n classes: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = { setDimensions: true };\n }\n\n onPromptChange = (markup) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt: markup });\n };\n\n changeFeedback = (feedback) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, feedback };\n\n onModelChanged(update);\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, teacherInstructions };\n\n onModelChanged(update);\n };\n\n render() {\n const { model, classes, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n dimensions = {},\n equationEditor = {},\n feedback = {},\n playerSpellCheck = {},\n prompt = {},\n settingsPanelDisabled,\n spanishInput = {},\n specialInput = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n mathInput = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multiple = {},\n withRubric = {},\n } = configuration || {};\n const { feedbackEnabled, promptEnabled, spellCheckEnabled, teacherInstructionsEnabled, toolbarEditorPosition } =\n model || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n mathInput: mathInput.settings && toggle(mathInput.label),\n equationEditor:\n equationEditor.enabled &&\n model.mathInput &&\n dropdown(equationEditor.label, [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'Grade 1 - 2',\n 'Grade 3 - 5',\n 'Grade 6 - 7',\n 'Grade 8 - HS',\n 'geometry',\n 'advanced-algebra',\n 'statistics',\n 'item-authoring',\n ]),\n spanishInput: spanishInput.settings && toggle(spanishInput.label),\n specialInput: specialInput.settings && toggle(specialInput.label),\n dimensions: numberFields(dimensions.label, {\n width: { label: 'Width (px)', suffix: 'px', min: 100, max: 500 },\n height: { label: 'Height (px)', suffix: 'px', min: 100, max: 500 },\n }),\n 'multiple.enabled': multiple.settings && toggle(multiple.label, true),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptContainer}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\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={prompt.label} className={classes.promptContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n className={classes.prompt}\n markup={model.prompt || ''}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {feedbackEnabled && (\n <React.Fragment>\n <Typography className={classes.header} variant=\"subheading\">\n Feedback\n </Typography>\n\n <FeedbackSelector\n label=\"When submitted, show\"\n feedback={model.feedback || defaultFeedback}\n onChange={this.changeFeedback}\n toolbarOpts={toolbarOpts}\n />\n </React.Fragment>\n )}\n </div>\n </layout.ConfigLayout>\n );\n }\n}\nexport default withStyles((theme) => ({\n header: {\n paddingBottom: theme.spacing.unit,\n },\n promptContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n promptInput: {\n width: '100%',\n marginBottom: theme.spacing.unit,\n },\n field: {\n width: '200px',\n },\n}))(Main);\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","numberFields","dropdown","defaultFeedback","type","Main","props","markup","onModelChanged","model","prompt","feedback","update","teacherInstructions","state","setDimensions","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","dimensions","equationEditor","playerSpellCheck","settingsPanelDisabled","spanishInput","specialInput","spellCheck","studentInstructions","mathInput","maxImageWidth","maxImageHeight","multiple","withRubric","feedbackEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","width","suffix","min","max","height","playerSpellCheckDisabled","panelProperties","studentInstructionsEnabled","rubricEnabled","config","Settings","Properties","promptContainer","changeTeacherInstructions","language","ALL_PLUGINS","onPromptChange","header","changeFeedback","React","Component","PropTypes","func","isRequired","object","theme","paddingBottom","spacing","unit","paddingTop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AUG,MAAV,CAAiBD,UAHP;AAIjBpD,EAAAA,aAAa,EAAEkD,sBAAUG,MAAV,CAAiBD,UAJf;AAKjBnD,EAAAA,YAAY,EAAEiD,sBAAUG,MAAV,CAAiBD,UALd;AAMjBjD,EAAAA,kBAAkB,EAAE+C,sBAAUG,MAAV,CAAiBD,UANpB;AAOjBrD,EAAAA,OAAO,EAAEmD,sBAAUG,MAAV,CAAiBD;AAPT,C;;eA8KN,wBAAW,UAACE,KAAD;AAAA,SAAY;AACpCR,IAAAA,MAAM,EAAE;AACNS,MAAAA,aAAa,EAAED,KAAK,CAACE,OAAN,CAAcC;AADvB,KAD4B;AAIpChB,IAAAA,eAAe,EAAE;AACfiB,MAAAA,UAAU,EAAEJ,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CADlB;AAEfE,MAAAA,YAAY,EAAEL,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAFpB;AAGf5B,MAAAA,KAAK,EAAE;AAHQ;AAJmB,GAAZ;AAAA,CAAX,EASXzC,IATW,C","sourcesContent":["import React from 'react';\nimport { FeedbackSelector, InputContainer, settings, layout } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\n\nconst { Panel, toggle, numberFields, dropdown } = settings;\n\nconst defaultFeedback = {\n type: 'default',\n default: 'Your answer has been submitted',\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n classes: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = { setDimensions: true };\n }\n\n onPromptChange = (markup) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt: markup });\n };\n\n changeFeedback = (feedback) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, feedback };\n\n onModelChanged(update);\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, teacherInstructions };\n\n onModelChanged(update);\n };\n\n render() {\n const { model, classes, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n dimensions = {},\n equationEditor = {},\n feedback = {},\n playerSpellCheck = {},\n prompt = {},\n settingsPanelDisabled,\n spanishInput = {},\n specialInput = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n mathInput = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multiple = {},\n withRubric = {},\n } = configuration || {};\n const { feedbackEnabled, promptEnabled, spellCheckEnabled, teacherInstructionsEnabled, toolbarEditorPosition } =\n model || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n mathInput: mathInput.settings && toggle(mathInput.label),\n equationEditor:\n equationEditor.enabled &&\n model.mathInput &&\n dropdown(equationEditor.label, [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'Grade 1 - 2',\n 'Grade 3 - 5',\n 'Grade 6 - 7',\n 'Grade 8 - HS',\n 'geometry',\n 'advanced-algebra',\n 'statistics',\n 'item-authoring',\n ]),\n spanishInput: spanishInput.settings && toggle(spanishInput.label),\n specialInput: specialInput.settings && toggle(specialInput.label),\n dimensions: numberFields(dimensions.label, {\n width: { label: 'Width (px)', suffix: 'px', min: 100, max: 500 },\n height: { label: 'Height (px)', suffix: 'px', min: 100, max: 500 },\n }),\n 'multiple.enabled': multiple.settings && toggle(multiple.label, true),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptContainer}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\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={prompt.label} className={classes.promptContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n className={classes.prompt}\n markup={model.prompt || ''}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {feedbackEnabled && (\n <React.Fragment>\n <Typography className={classes.header} variant=\"subheading\">\n Feedback\n </Typography>\n\n <FeedbackSelector\n label=\"When submitted, show\"\n feedback={model.feedback || defaultFeedback}\n onChange={this.changeFeedback}\n toolbarOpts={toolbarOpts}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\nexport default withStyles((theme) => ({\n header: {\n paddingBottom: theme.spacing.unit,\n },\n promptContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n}))(Main);\n"],"file":"main.js"}
|
package/docs/config-schema.json
CHANGED
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"title": "label"
|
|
231
231
|
},
|
|
232
232
|
"forceEnabled": {
|
|
233
|
-
"description": "Indicates the value for the toggle
|
|
233
|
+
"description": "Indicates the value for the toggle;\nif true:\n- this property will not be visible in Settings Panel (settings will become automatically false)\n- the model property afferent to it will become automatically false",
|
|
234
234
|
"type": "boolean",
|
|
235
235
|
"title": "forceEnabled"
|
|
236
236
|
}
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
"title": "label"
|
|
330
330
|
},
|
|
331
331
|
"forceEnabled": {
|
|
332
|
-
"description": "Indicates the value for the toggle
|
|
332
|
+
"description": "Indicates the value for the toggle;\nif true:\n- this property will not be visible in Settings Panel (settings will become automatically false)\n- the model property afferent to it will become automatically false",
|
|
333
333
|
"type": "boolean",
|
|
334
334
|
"title": "forceEnabled"
|
|
335
335
|
}
|
|
@@ -177,7 +177,10 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
177
177
|
|
|
178
178
|
## `forceEnabled` (boolean)
|
|
179
179
|
|
|
180
|
-
Indicates the value for the toggle;
|
|
180
|
+
Indicates the value for the toggle;
|
|
181
|
+
if true:
|
|
182
|
+
- this property will not be visible in Settings Panel (settings will become automatically false)
|
|
183
|
+
- the model property afferent to it will become automatically false
|
|
181
184
|
|
|
182
185
|
# `showPrompt` (boolean)
|
|
183
186
|
|
|
@@ -262,4 +265,7 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
262
265
|
|
|
263
266
|
### `forceEnabled` (boolean)
|
|
264
267
|
|
|
265
|
-
Indicates the value for the toggle;
|
|
268
|
+
Indicates the value for the toggle;
|
|
269
|
+
if true:
|
|
270
|
+
- this property will not be visible in Settings Panel (settings will become automatically false)
|
|
271
|
+
- the model property afferent to it will become automatically false
|
package/docs/pie-schema.json
CHANGED
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"title": "label"
|
|
251
251
|
},
|
|
252
252
|
"forceEnabled": {
|
|
253
|
-
"description": "Indicates the value for the toggle
|
|
253
|
+
"description": "Indicates the value for the toggle;\nif true:\n- this property will not be visible in Settings Panel (settings will become automatically false)\n- the model property afferent to it will become automatically false",
|
|
254
254
|
"type": "boolean",
|
|
255
255
|
"title": "forceEnabled"
|
|
256
256
|
}
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -203,7 +203,10 @@ Indicates the label for the item that has to be displayed in the Settings Panel
|
|
|
203
203
|
|
|
204
204
|
### `forceEnabled` (boolean)
|
|
205
205
|
|
|
206
|
-
Indicates the value for the toggle;
|
|
206
|
+
Indicates the value for the toggle;
|
|
207
|
+
if true:
|
|
208
|
+
- this property will not be visible in Settings Panel (settings will become automatically false)
|
|
209
|
+
- the model property afferent to it will become automatically false
|
|
207
210
|
|
|
208
211
|
## `Dimensions` (object)
|
|
209
212
|
|
package/lib/index.js
CHANGED
|
@@ -107,6 +107,8 @@ var RootExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
107
107
|
}, {
|
|
108
108
|
key: "connectedCallback",
|
|
109
109
|
value: function connectedCallback() {
|
|
110
|
+
this.setAttribute('aria-label', 'Written Response Question');
|
|
111
|
+
this.setAttribute('role', 'region');
|
|
110
112
|
this.render();
|
|
111
113
|
}
|
|
112
114
|
}, {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","_model","_session","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","elem","React","createElement","Main","model","session","onChange","handleChange","bind","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;AAEA,IAAMC,SAAS,GAAG,QAAOC,MAAP,0DAAOA,MAAP,OAAkBC,SAAlB,GAA8B,IAAIC,SAAJ,EAA9B,GAAgD;AAAEC,EAAAA,eAAe,EAAE,yBAACC,CAAD;AAAA,WAAOA,CAAP;AAAA;AAAnB,CAAlE;;AAEO,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACjC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOL,SAAP;AACD;;AACD,MAAI;AACF,QAAMM,QAAQ,GAAGR,SAAS,CAACI,eAAV,CAA0BG,KAA1B,EAAiC,WAAjC,CAAjB;AACA,QAAMD,YAAW,GAAGE,QAAQ,CAACC,IAAT,CAAcH,WAAlC;AACA,WAAOA,YAAP;AACD,GAJD,CAIE,OAAOI,GAAP,EAAY;AACZX,IAAAA,GAAG,CAAC,kCAAD,EAAqCQ,KAArC,CAAH;AACA,WAAOA,KAAP;AACD;AACF;;AAEM,SAASI,UAAT,CAAoBJ,KAApB,EAA2B;AAChC,MAAMK,EAAE,GAAGN,WAAW,CAACC,KAAD,CAAtB;AACA,MAAMM,GAAG,GAAGD,EAAE,KAAKV,SAAP,IAAoBU,EAAE,CAACE,MAAH,GAAY,CAA5C;AACA,SAAOD,GAAP;AACD;;IAEoBE,qB;;;;;AACnB,mCAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKF,MAAL,GAAcE,CAAd;AACA,WAAKC,aAAL,CAAmB,IAAIC,8BAAJ,CAAkB,KAAKC,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAA9C,EAAqD,CAAC,CAAC,KAAKN,MAA5D,CAAnB;AAEA,WAAKO,MAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKN,QAAZ;AACD,K;SAPD,aAAYO,CAAZ,EAAe;AACb,WAAKP,QAAL,GAAgBO,CAAhB;AACA,WAAKD,MAAL;AACD;;;WAMD,sBAAahB,KAAb,EAAoB;AAClB,WAAKU,QAAL,CAAcV,KAAd,GAAsBA,KAAtB;AAEA,WAAKY,aAAL,CAAmB,IAAIM,oCAAJ,CAAwB,KAAKJ,OAAL,CAAaC,WAAb,EAAxB,EAAoDX,UAAU,CAACJ,KAAD,CAA9D,CAAnB;AACD;;;WAED,6BAAoB;AAClB,
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","_model","_session","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","setAttribute","elem","React","createElement","Main","model","session","onChange","handleChange","bind","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;AAEA,IAAMC,SAAS,GAAG,QAAOC,MAAP,0DAAOA,MAAP,OAAkBC,SAAlB,GAA8B,IAAIC,SAAJ,EAA9B,GAAgD;AAAEC,EAAAA,eAAe,EAAE,yBAACC,CAAD;AAAA,WAAOA,CAAP;AAAA;AAAnB,CAAlE;;AAEO,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACjC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOL,SAAP;AACD;;AACD,MAAI;AACF,QAAMM,QAAQ,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kB,MAAlB,EAA0B,QAA1B;AAEA,WAAKH,MAAL;AACD;;;WAED,kBAAS;AAAA;;AACP,UAAI,KAAKP,MAAL,IAAe,KAAKC,QAAxB,EAAkC;AAChC,YAAIU,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,KAAK,EAAE,KAAKf,MADuB;AAEnCgB,UAAAA,OAAO,EAAE,KAAKf,QAFqB;AAGnCgB,UAAAA,QAAQ,EAAE,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB;AAHyB,SAA1B,CAAX;;AAMAC,6BAASb,MAAT,CAAgBI,IAAhB,EAAsB,IAAtB,EAA4B,YAAM;AAChC,yCAAW,MAAX;AACD,SAFD;AAGD;AACF;;;kDAhDgDU,W","sourcesContent":["import Main from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport debug from 'debug';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n return out;\n}\n\nexport default class RootExtendedTextEntry extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\n\n this.render();\n }\n\n set session(s) {\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n handleChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question'); \n this.setAttribute('role', 'region');\n\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onChange: this.handleChange.bind(this),\n });\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
|
package/lib/main.js
CHANGED
|
@@ -37,6 +37,8 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
37
37
|
|
|
38
38
|
var _renderUi = require("@pie-lib/render-ui");
|
|
39
39
|
|
|
40
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
41
|
+
|
|
40
42
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
41
43
|
|
|
42
44
|
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; } }
|
|
@@ -54,6 +56,13 @@ var style = function style(theme) {
|
|
|
54
56
|
color: _renderUi.color.text(),
|
|
55
57
|
marginBottom: theme.spacing.unit * 2,
|
|
56
58
|
fontSize: 'inherit'
|
|
59
|
+
},
|
|
60
|
+
teacherInstructions: {
|
|
61
|
+
marginBottom: theme.spacing.unit * 2
|
|
62
|
+
},
|
|
63
|
+
editor: {
|
|
64
|
+
marginBottom: theme.spacing.unit * 2,
|
|
65
|
+
borderRadius: '4px'
|
|
57
66
|
}
|
|
58
67
|
};
|
|
59
68
|
};
|
|
@@ -103,7 +112,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
103
112
|
height = _ref.height;
|
|
104
113
|
|
|
105
114
|
var maxHeight = '40vh';
|
|
106
|
-
var toolbarOpts = {
|
|
115
|
+
var toolbarOpts = {
|
|
116
|
+
position: playersToolbarPosition === 'top' ? 'top' : 'bottom'
|
|
117
|
+
};
|
|
107
118
|
log('[render] disabled? ', disabled);
|
|
108
119
|
|
|
109
120
|
var teacherInstructionsDiv = /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
@@ -111,16 +122,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
111
122
|
prompt: teacherInstructions
|
|
112
123
|
});
|
|
113
124
|
|
|
114
|
-
switch (playersToolbarPosition) {
|
|
115
|
-
case 'top':
|
|
116
|
-
toolbarOpts.position = 'top';
|
|
117
|
-
break;
|
|
118
|
-
|
|
119
|
-
default:
|
|
120
|
-
toolbarOpts.position = 'bottom';
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
125
|
var languageCharactersProps = [];
|
|
125
126
|
|
|
126
127
|
if (spanishInput) {
|
|
@@ -140,20 +141,22 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
140
141
|
ref: function ref(_ref2) {
|
|
141
142
|
_this2.containerRef = _ref2;
|
|
142
143
|
}
|
|
143
|
-
}, teacherInstructions && /*#__PURE__*/_react["default"].createElement("div",
|
|
144
|
+
}, teacherInstructions && /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
className: classes.teacherInstructions
|
|
146
|
+
}, !animationsDisabled ? /*#__PURE__*/_react["default"].createElement(_renderUi.Collapsible, {
|
|
144
147
|
labels: {
|
|
145
148
|
hidden: 'Show Teacher Instructions',
|
|
146
149
|
visible: 'Hide Teacher Instructions'
|
|
147
150
|
},
|
|
148
151
|
className: classes.collapsible
|
|
149
|
-
}, teacherInstructionsDiv) : teacherInstructionsDiv
|
|
152
|
+
}, teacherInstructionsDiv) : teacherInstructionsDiv), model.prompt && /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
150
153
|
component: 'span',
|
|
151
154
|
className: classes.prompt
|
|
152
155
|
}, /*#__PURE__*/_react["default"].createElement(_renderUi.PreviewPrompt, {
|
|
153
156
|
defaultClassName: "prompt",
|
|
154
157
|
prompt: model.prompt
|
|
155
158
|
})), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
156
|
-
className: "response-area-editor
|
|
159
|
+
className: (0, _classnames["default"])(classes.editor, 'response-area-editor'),
|
|
157
160
|
onChange: this.changeSession,
|
|
158
161
|
markup: value || '',
|
|
159
162
|
width: width && width.toString(),
|
|
@@ -178,10 +181,10 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
178
181
|
}
|
|
179
182
|
},
|
|
180
183
|
languageCharactersProps: languageCharactersProps
|
|
181
|
-
}), feedback && /*#__PURE__*/_react["default"].createElement(
|
|
184
|
+
}), feedback && /*#__PURE__*/_react["default"].createElement(_renderUi.Feedback, {
|
|
182
185
|
correctness: "correct",
|
|
183
186
|
feedback: feedback
|
|
184
|
-
}))
|
|
187
|
+
}));
|
|
185
188
|
}
|
|
186
189
|
}]);
|
|
187
190
|
return Main;
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["log","style","theme","main","backgroundColor","color","background","text","prompt","width","marginBottom","spacing","unit","fontSize","Main","props","onChange","model","classes","session","dimensions","disabled","feedback","
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["log","style","theme","main","backgroundColor","color","background","text","prompt","width","marginBottom","spacing","unit","fontSize","teacherInstructions","editor","borderRadius","Main","props","onChange","model","classes","session","dimensions","disabled","feedback","mathInput","spanishInput","specialInput","animationsDisabled","playersToolbarPosition","spellCheckEnabled","value","height","maxHeight","toolbarOpts","position","teacherInstructionsDiv","languageCharactersProps","push","language","ref","containerRef","hidden","visible","collapsible","changeSession","toString","math","customKeys","keypadMode","equationEditor","controlledKeyp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A,oBAAoB,EAAE;AAJlB,WADK;AAOXC,UAAAA,KAAK,EAAE;AACL7B,YAAAA,QAAQ,EAAE;AADL,WAPI;AAUX8B,UAAAA,KAAK,EAAE;AACL9B,YAAAA,QAAQ,EAAE;AADL;AAVI,SAXf;AAyBE,QAAA,uBAAuB,EAAEc;AAzB3B,QA3BF,EAuDGb,QAAQ,iBAAI,gCAAC,kBAAD;AAAU,QAAA,WAAW,EAAC,SAAtB;AAAgC,QAAA,QAAQ,EAAEA;AAA1C,QAvDf,CADF;AA2DD;;;EA1GuB8B,kBAAMC,S;;;iCAAnBvC,I,eACQ;AACjBE,EAAAA,QAAQ,EAAEsC,sBAAUC,IAAV,CAAeC,UADR;AAEjBvC,EAAAA,KAAK,EAAEqC,sBAAUG,MAFA;AAGjBvC,EAAAA,OAAO,EAAEoC,sBAAUG,MAAV,CAAiBD,UAHT;AAIjBrC,EAAAA,OAAO,EAAEmC,sBAAUI,KAAV,CAAgB;AACvB7B,IAAAA,KAAK,EAAEyB,sBAAUK;AADM,GAAhB,EAENH;AANc,C;;eA4GN,wBAAW1D,KAAX,EAAkBgB,IAAlB,C","sourcesContent":["import React from 'react';\nimport EditableHTML from '@pie-lib/editable-html';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport debug from 'debug';\nimport debounce from 'lodash/debounce';\nimport { color, Feedback, Collapsible, PreviewPrompt } from '@pie-lib/render-ui';\nimport classnames from 'classnames';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst style = (theme) => ({\n main: {\n backgroundColor: color.background(),\n color: color.text(),\n },\n prompt: {\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing.unit * 2,\n fontSize: 'inherit',\n },\n teacherInstructions: {\n marginBottom: theme.spacing.unit * 2,\n },\n editor: {\n marginBottom: theme.spacing.unit * 2,\n borderRadius: '4px',\n },\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n classes: PropTypes.object.isRequired,\n session: PropTypes.shape({\n value: PropTypes.string,\n }).isRequired,\n };\n\n changeSession = debounce(this.props.onChange, 1500);\n\n render() {\n const { model, classes, session } = this.props;\n const {\n dimensions,\n disabled,\n feedback,\n teacherInstructions,\n mathInput,\n spanishInput,\n specialInput,\n animationsDisabled,\n playersToolbarPosition,\n spellCheckEnabled,\n } = model;\n const { value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = { position: playersToolbarPosition === 'top' ? 'top' : 'bottom' };\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const languageCharactersProps = [];\n\n if (spanishInput) {\n languageCharactersProps.push({ language: 'spanish' });\n }\n\n if (specialInput) {\n languageCharactersProps.push({ language: 'special' });\n }\n\n return (\n <div\n className={classes.main}\n ref={(ref) => {\n this.containerRef = ref;\n }}\n >\n {teacherInstructions && (\n <div className={classes.teacherInstructions}>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n className={classes.collapsible}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </div>\n )}\n\n {model.prompt && (\n <Typography component={'span'} className={classes.prompt}>\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </Typography>\n )}\n\n <EditableHTML\n className={classnames(classes.editor, 'response-area-editor')}\n onChange={this.changeSession}\n markup={value || ''}\n width={width && width.toString()}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n }}\n languageCharactersProps={languageCharactersProps}\n />\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </div>\n );\n }\n}\n\nexport default withStyles(style)(Main);\n"],"file":"main.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry",
|
|
3
|
-
"version": "9.0.1-next.
|
|
3
|
+
"version": "9.0.1-next.39+a42a408d1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react": "^16.8.1",
|
|
23
23
|
"react-dom": "^16.8.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "a42a408d1d238e52cbcf907fbbaec2ee98550385",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"postpublish": "../../scripts/postpublish"
|
|
28
28
|
},
|