@pie-element/drawing-response 6.2.3-next.40 → 6.2.3-next.57
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/configure/lib/root.js
CHANGED
|
@@ -114,6 +114,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
114
114
|
var _ref = configuration || {},
|
|
115
115
|
_ref$backgroundImage = _ref.backgroundImage,
|
|
116
116
|
backgroundImage = _ref$backgroundImage === void 0 ? {} : _ref$backgroundImage,
|
|
117
|
+
_ref$contentDimension = _ref.contentDimensions,
|
|
118
|
+
contentDimensions = _ref$contentDimension === void 0 ? {} : _ref$contentDimension,
|
|
117
119
|
_ref$maxImageWidth = _ref.maxImageWidth,
|
|
118
120
|
maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
|
|
119
121
|
_ref$maxImageHeight = _ref.maxImageHeight,
|
|
@@ -150,6 +152,7 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
150
152
|
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
|
|
151
153
|
};
|
|
152
154
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
155
|
+
dimensions: contentDimensions,
|
|
153
156
|
hideSettings: settingsPanelDisabled,
|
|
154
157
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
155
158
|
model: model,
|
|
@@ -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","onConfigurationChanged","uploadSoundSupport","backgroundImage","maxImageWidth","maxImageHeight","settingsPanelDisabled","spellCheck","withRubric","backgroundImageEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","panelProperties","rubricEnabled","Settings","Properties","promptHolder","onTeacherInstructionsChanged","language","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","paddingTop","spacing","unit","marginBottom","width","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,iCAAMC,MAAN;AAAcJ,QAAAA,MAAM,EAANA;AAAd,SAAd;AACD,K;qHAE8B,UAACK,mBAAD,EAAyB;AACtD,yBAAkC,MAAKJ,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaG,QAAAA,mBAAmB,EAAnBA;AAAb,SAAd;AACD,K;+GAEwB,UAACC,UAAD,EAAgB;AACvC,yBAAkC,MAAKL,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaK,QAAAA,eAAe,EAAED;AAA9B,SAAd;AACD,K;sGAEe,UAACE,QAAD,EAAc;AAC5B,yBAAkC,MAAKP,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaM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Aa,EAAE,KAAKC,aAHtB;AAIE,QAAA,eAAe,EAAEtC,KAAK,CAACK;AAJzB,QAHF,CAjDJ,CADF;AA+DD;;;EAhIuBkC,kBAAMC,S;;;;AAmIhC,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBT,IAAAA,YAAY,EAAE;AACZU,MAAAA,UAAU,EAAED,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CADrB;AAEZC,MAAAA,YAAY,EAAEJ,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAFvB;AAGZE,MAAAA,KAAK,EAAE;AAHK;AADW,GAAZ;AAAA,CAAf;;AAQAlD,IAAI,CAACmD,SAAL,GAAiB;AACfzC,EAAAA,OAAO,EAAE0C,sBAAUC,MAAV,CAAiBC,UADX;AAEf3C,EAAAA,aAAa,EAAEyC,sBAAUC,MAFV;AAGflD,EAAAA,KAAK,EAAEiD,sBAAUC,MAAV,CAAiBC,UAHT;AAIf1C,EAAAA,YAAY,EAAEwC,sBAAUG,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEJ,sBAAUK,IADa;AAE5B,cAAQL,sBAAUK;AAFU,GAAhB,CAJC;AAQf3C,EAAAA,kBAAkB,EAAEsC,sBAAUG,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEJ,sBAAUK,IADmB;AAElC,cAAQL,sBAAUK;AAFgB,GAAhB,CARL;AAYfrD,EAAAA,cAAc,EAAEgD,sBAAUK,IAAV,CAAeH,UAZhB;AAafzC,EAAAA,sBAAsB,EAAEuC,sBAAUK,IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWV,MAAX,EAAmB5C,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({ ...update, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageDimensions: dimensions });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageUrl });\n };\n\n render() {\n const { classes, configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n backgroundImage = {},\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n backgroundImageEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n 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 backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.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 onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\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.promptHolder}>\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 <React.Fragment>\n <Typography variant=\"subheading\">Define Background Image</Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n promptHolder: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\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","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","backgroundImage","contentDimensions","maxImageWidth","maxImageHeight","settingsPanelDisabled","spellCheck","withRubric","backgroundImageEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","panelProperties","rubricEnabled","Settings","Properties","promptHolder","onTeacherInstructionsChanged","language","onPromptChanged","onUpdateImageDimension","onImageUpload","React","Component","styles","theme","paddingTop","spacing","unit","marginBottom","width","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,iCAAMC,MAAN;AAAcJ,QAAAA,MAAM,EAANA;AAAd,SAAd;AACD,K;qHAE8B,UAACK,mBAAD,EAAyB;AACtD,yBAAkC,MAAKJ,KAAvC;AAAA,UAAQC,KAAR,gBAAQA,KAAR;AAAA,UAAeC,cAAf,gBAAeA,cAAf;AAEAA,MAAAA,cAAc,iCAAMD,KAAN;AAAaG,QAAAA,mBAAmB,EAAnBA;AAAb,SAA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AAAA,kBAAkB,EAAEuC,sBAAUG,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEJ,sBAAUK,IADmB;AAElC,cAAQL,sBAAUK;AAFgB,GAAhB,CARL;AAYftD,EAAAA,cAAc,EAAEiD,sBAAUK,IAAV,CAAeH,UAZhB;AAaf1C,EAAAA,sBAAsB,EAAEwC,sBAAUK,IAAV,CAAeH;AAbxB,CAAjB;;eAgBe,wBAAWV,MAAX,EAAmB7C,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({ ...update, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onUpdateImageDimension = (dimensions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageDimensions: dimensions });\n };\n\n onImageUpload = (imageUrl) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, imageUrl });\n };\n\n render() {\n const { classes, configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n backgroundImage = {},\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n backgroundImageEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n 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 backgroundImageEnabled: backgroundImage.settings && toggle(backgroundImage.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\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.promptHolder}>\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 <React.Fragment>\n <Typography variant=\"subheading\">Define Background Image</Typography>\n\n <ImageContainer\n imageUrl={model.imageUrl}\n onUpdateImageDimension={this.onUpdateImageDimension}\n onImageUpload={this.onImageUpload}\n imageDimensions={model.imageDimensions}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nconst styles = (theme) => ({\n promptHolder: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\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/src/root.jsx
CHANGED
|
@@ -41,6 +41,7 @@ export class Root extends React.Component {
|
|
|
41
41
|
this.props;
|
|
42
42
|
const {
|
|
43
43
|
backgroundImage = {},
|
|
44
|
+
contentDimensions = {},
|
|
44
45
|
maxImageWidth = {},
|
|
45
46
|
maxImageHeight = {},
|
|
46
47
|
prompt = {},
|
|
@@ -77,6 +78,7 @@ export class Root extends React.Component {
|
|
|
77
78
|
|
|
78
79
|
return (
|
|
79
80
|
<layout.ConfigLayout
|
|
81
|
+
dimensions={contentDimensions}
|
|
80
82
|
hideSettings={settingsPanelDisabled}
|
|
81
83
|
settings={
|
|
82
84
|
<Panel
|
package/docs/config-schema.json
CHANGED
|
@@ -167,6 +167,56 @@
|
|
|
167
167
|
"default": "Item Stemm",
|
|
168
168
|
"type": "string",
|
|
169
169
|
"title": "promptLabel"
|
|
170
|
+
},
|
|
171
|
+
"contentDimensions": {
|
|
172
|
+
"description": "Indicates the dimensions configuration for the authoring container\nNote: Some items have a default minimum width because of their content, but if\nthe minWidth is lower than this, the overflow behavior will take care of that",
|
|
173
|
+
"default": ": {}",
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"maxHeight": {
|
|
177
|
+
"description": "Indicates the max height of the authoring container",
|
|
178
|
+
"default": "undefined",
|
|
179
|
+
"type": [
|
|
180
|
+
"string",
|
|
181
|
+
"number"
|
|
182
|
+
],
|
|
183
|
+
"title": "maxHeight"
|
|
184
|
+
},
|
|
185
|
+
"maxWidth": {
|
|
186
|
+
"description": "Indicates the max width of the authoring container",
|
|
187
|
+
"default": "undefined",
|
|
188
|
+
"type": [
|
|
189
|
+
"string",
|
|
190
|
+
"number"
|
|
191
|
+
],
|
|
192
|
+
"title": "maxWidth"
|
|
193
|
+
},
|
|
194
|
+
"minHeight": {
|
|
195
|
+
"description": "Indicates the min height of the authoring container",
|
|
196
|
+
"default": "undefined",
|
|
197
|
+
"type": [
|
|
198
|
+
"string",
|
|
199
|
+
"number"
|
|
200
|
+
],
|
|
201
|
+
"title": "minHeight"
|
|
202
|
+
},
|
|
203
|
+
"minWidth": {
|
|
204
|
+
"description": "Indicates the min width of the authoring container",
|
|
205
|
+
"default": "undefined",
|
|
206
|
+
"type": [
|
|
207
|
+
"string",
|
|
208
|
+
"number"
|
|
209
|
+
],
|
|
210
|
+
"title": "minWidth"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"title": "contentDimensions"
|
|
214
|
+
},
|
|
215
|
+
"settingsPartialScoring": {
|
|
216
|
+
"description": "Indicates whether the settings panel wil allow the author to modify settings for partial scoring",
|
|
217
|
+
"default": true,
|
|
218
|
+
"type": "boolean",
|
|
219
|
+
"title": "settingsPartialScoring"
|
|
170
220
|
}
|
|
171
221
|
},
|
|
172
222
|
"definitions": {
|
|
@@ -134,6 +134,46 @@ The label for the item stem/prompt field
|
|
|
134
134
|
|
|
135
135
|
Default: `"Item Stemm"`
|
|
136
136
|
|
|
137
|
+
# `contentDimensions` (object)
|
|
138
|
+
|
|
139
|
+
Indicates the dimensions configuration for the authoring container
|
|
140
|
+
Note: Some items have a default minimum width because of their content, but if
|
|
141
|
+
the minWidth is lower than this, the overflow behavior will take care of that
|
|
142
|
+
|
|
143
|
+
Properties of the `contentDimensions` object:
|
|
144
|
+
|
|
145
|
+
## `maxHeight` (string,number)
|
|
146
|
+
|
|
147
|
+
Indicates the max height of the authoring container
|
|
148
|
+
|
|
149
|
+
Default: `"undefined"`
|
|
150
|
+
|
|
151
|
+
## `maxWidth` (string,number)
|
|
152
|
+
|
|
153
|
+
Indicates the max width of the authoring container
|
|
154
|
+
|
|
155
|
+
Default: `"undefined"`
|
|
156
|
+
|
|
157
|
+
## `minHeight` (string,number)
|
|
158
|
+
|
|
159
|
+
Indicates the min height of the authoring container
|
|
160
|
+
|
|
161
|
+
Default: `"undefined"`
|
|
162
|
+
|
|
163
|
+
## `minWidth` (string,number)
|
|
164
|
+
|
|
165
|
+
Indicates the min width of the authoring container
|
|
166
|
+
|
|
167
|
+
Default: `"undefined"`
|
|
168
|
+
|
|
169
|
+
Default: `": {}"`
|
|
170
|
+
|
|
171
|
+
# `settingsPartialScoring` (boolean)
|
|
172
|
+
|
|
173
|
+
Indicates whether the settings panel wil allow the author to modify settings for partial scoring
|
|
174
|
+
|
|
175
|
+
Default: `true`
|
|
176
|
+
|
|
137
177
|
---
|
|
138
178
|
|
|
139
179
|
# Sub Schemas
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/drawing-response",
|
|
3
|
-
"version": "6.2.3-next.
|
|
3
|
+
"version": "6.2.3-next.57+f7af573fb",
|
|
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": "f7af573fb4e0491e4f5ff278103b157ac0120f98",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"postpublish": "../../scripts/postpublish"
|
|
30
30
|
},
|