@pie-element/explicit-constructed-response 3.9.3-next.508 → 3.9.3-next.519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
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
+ ## [3.11.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.7...@pie-element/explicit-constructed-response@3.11.8) (2021-12-23)
7
+
8
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.11.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.5...@pie-element/explicit-constructed-response@3.11.6) (2021-12-13)
15
+
16
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.11.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.2...@pie-element/explicit-constructed-response@3.11.3) (2021-12-01)
23
+
24
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
25
+
26
+
27
+
28
+
29
+
30
+ ## [3.11.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.11.1...@pie-element/explicit-constructed-response@3.11.2) (2021-11-29)
31
+
32
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
33
+
34
+
35
+
36
+
37
+
38
+ ## [3.11.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.5...@pie-element/explicit-constructed-response@3.11.1) (2021-11-11)
39
+
40
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
41
+
42
+
43
+
44
+
45
+
6
46
  # [3.11.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.9.2...@pie-element/explicit-constructed-response@3.11.0) (2021-11-11)
7
47
 
8
48
 
@@ -26,6 +66,52 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
26
66
 
27
67
 
28
68
 
69
+
70
+ ## [3.10.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.4...@pie-element/explicit-constructed-response@3.10.5) (2021-11-01)
71
+
72
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
73
+
74
+
75
+
76
+
77
+
78
+ ## [3.10.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.3...@pie-element/explicit-constructed-response@3.10.4) (2021-10-18)
79
+
80
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
81
+
82
+
83
+
84
+
85
+
86
+ ## [3.10.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.2...@pie-element/explicit-constructed-response@3.10.3) (2021-10-04)
87
+
88
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
89
+
90
+
91
+
92
+
93
+
94
+ ## [3.10.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.1...@pie-element/explicit-constructed-response@3.10.2) (2021-09-20)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
100
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
101
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
102
+
103
+
104
+
105
+
106
+
107
+ ## [3.10.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.10.0...@pie-element/explicit-constructed-response@3.10.1) (2021-09-01)
108
+
109
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response
110
+
111
+
112
+
113
+
114
+
29
115
  # [3.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response@3.9.2...@pie-element/explicit-constructed-response@3.10.0) (2021-08-05)
30
116
 
31
117
 
@@ -3,6 +3,46 @@
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
+ ## [3.6.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.7...@pie-element/explicit-constructed-response-configure@3.6.8) (2021-12-23)
7
+
8
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.6.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.5...@pie-element/explicit-constructed-response-configure@3.6.6) (2021-12-13)
15
+
16
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.6.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.2...@pie-element/explicit-constructed-response-configure@3.6.3) (2021-12-01)
23
+
24
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
25
+
26
+
27
+
28
+
29
+
30
+ ## [3.6.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.6.1...@pie-element/explicit-constructed-response-configure@3.6.2) (2021-11-29)
31
+
32
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
33
+
34
+
35
+
36
+
37
+
38
+ ## [3.6.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.31...@pie-element/explicit-constructed-response-configure@3.6.1) (2021-11-11)
39
+
40
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
41
+
42
+
43
+
44
+
45
+
6
46
  # [3.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.27...@pie-element/explicit-constructed-response-configure@3.6.0) (2021-11-11)
7
47
 
8
48
 
@@ -22,6 +62,36 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
22
62
 
23
63
 
24
64
 
65
+
66
+ ## [3.5.31](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.30...@pie-element/explicit-constructed-response-configure@3.5.31) (2021-10-18)
67
+
68
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
69
+
70
+
71
+
72
+
73
+
74
+ ## [3.5.30](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.29...@pie-element/explicit-constructed-response-configure@3.5.30) (2021-10-04)
75
+
76
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
77
+
78
+
79
+
80
+
81
+
82
+ ## [3.5.29](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.28...@pie-element/explicit-constructed-response-configure@3.5.29) (2021-09-20)
83
+
84
+
85
+ ### Bug Fixes
86
+
87
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
88
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
89
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
90
+
91
+
92
+
93
+
94
+
25
95
  ## [3.5.28](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-configure@3.5.27...@pie-element/explicit-constructed-response-configure@3.5.28) (2021-08-05)
26
96
 
27
97
  **Note:** Version bump only for package @pie-element/explicit-constructed-response-configure
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","color","fontFamily","fontSize","lineHeight","marginTop","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","newVal","props","onModelChanged","model","rationale","teacherInstructions","slateMarkup","choices","maxLengthPerChoice","index","newValLength","length","label","value","splice","domMarkup","allRespAreas","querySelectorAll","allChoices","updatedMaxLengthPerChoice","forEach","el","newChoices","dataset","undefinedLengths","setState","Object","values","choice","labelLengthsArr","map","Math","max","classes","configuration","onConfigurationChanged","imageSupport","partialScoring","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","maxLengthPerChoiceEnabled","toolbarOpts","toolbarEditorPosition","position","onModelChange","Settings","Properties","onTeacherInstructionsChanged","onPromptChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","correctChoice","data","get","onChangeResponse","onChange","onBlur","onResponsesChanged","onLengthChanged","onRationaleChanged","React","Component","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,MAAR,GAA0BC,kBAA1B,CAAQD,MAAR;AAAA,IAAgBE,KAAhB,GAA0BD,kBAA1B,CAAgBC,KAAhB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,aAAa,EAAEH,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAFxB;AAGZC,MAAAA,YAAY,EAAEN,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB;AAHvB,KADS;AAMvBE,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAD3B;AAENH,MAAAA,KAAK,EAAE;AAFD,KANe;AAUvBO,IAAAA,MAAM,EAAE;AACNC,MAAAA,SAAS,EAAE,OADL;AAENF,MAAA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AAM,EAAE2B,KAAK,CAACC,SAAN,IAAmB,EAF7B;AAGE,QAAA,QAAQ,EAAE,KAAK6D,kBAHjB;AAIE,QAAA,YAAY,EAAE7B,YAJhB;AAKE,QAAA,WAAW,EAAEM;AALf,QAJF,CAlFJ,CA5BF,CADF,CADF;AAiID;;;EApTuBwB,kBAAMC,S;;;iCAAnBpE,I,eACQ;AACjBmC,EAAAA,aAAa,EAAEkC,sBAAUC,MAAV,CAAiBC,UADf;AAEjBnE,EAAAA,KAAK,EAAEiE,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBC,EAAAA,gBAAgB,EAAEH,sBAAUI,IAHX;AAIjBtE,EAAAA,cAAc,EAAEkE,sBAAUK,IAAV,CAAeH,UAJd;AAKjBnC,EAAAA,sBAAsB,EAAEiC,sBAAUK,IAAV,CAAeH,UALtB;AAMjBrC,EAAAA,OAAO,EAAEmC,sBAAUC,MAAV,CAAiBC,UANT;AAOjBlC,EAAAA,YAAY,EAAEgC,sBAAUM,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEP,sBAAUK,IAAV,CAAeH,UADQ;AAE5B,cAAQF,sBAAUK,IAAV,CAAeH;AAFK,GAAhB;AAPG,C;AAsTrB,IAAMM,MAAM,GAAG,wBAAW5G,MAAX,EAAmB+B,IAAnB,CAAf;eAEe6E,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ECRToolbar from './ecr-toolbar';\nimport AlternateResponses from './alternateResponses';\nimport { getAdjustedLength } from './markupUtils';\n\nconst { toggle, Panel } = settings;\n\nconst styles = theme => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px'\n }\n },\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0\n },\n addButton: {\n float: 'right'\n },\n text: {\n color: '#495B8F',\n fontFamily: 'Cerebri Sans',\n fontSize: '16px',\n lineHeight: '19px',\n marginTop: theme.spacing.unit * 4\n }\n});\n\nconst createElementFromHTML = htmlString => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired\n })\n };\n\n state = {};\n\n componentDidMount() {\n const {\n model: { slateMarkup, choices, maxLengthPerChoice = []},\n onModelChanged\n } = this.props;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n this.setState({ markup: slateMarkup });\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = (choice || []).map(choice => (choice.label || '').length);\n const length = getAdjustedLength(Math.max(...labelLengthsArr));\n\n if (undefinedLengths || !maxLengthPerChoice[index] || maxLengthPerChoice[index] < length) {\n maxLengthPerChoice[index] = length;\n }\n });\n\n onModelChanged({\n ...this.props.model,\n maxLengthPerChoice\n });\n }\n\n onModelChange = newVal => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal\n });\n };\n\n onPromptChanged = prompt => {\n this.props.onModelChanged({\n ...this.props.model,\n prompt\n });\n };\n\n onRationaleChanged = rationale => {\n this.props.onModelChanged({\n ...this.props.model,\n rationale\n });\n };\n\n onTeacherInstructionsChanged = teacherInstructions => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n teacherInstructions\n });\n };\n\n onMarkupChanged = slateMarkup => {\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup\n });\n };\n\n onResponsesChanged = choices => {\n this.props.onModelChanged({\n ...this.props.model,\n choices\n });\n };\n\n onLengthChanged = maxLengthPerChoice => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n maxLengthPerChoice\n });\n };\n\n onChangeResponse = (index, newVal) => {\n const { model, onModelChanged} = this.props;\n const { choices, maxLengthPerChoice } = model;\n const newValLength = getAdjustedLength((newVal || '').length);\n\n if (!choices[index]) {\n choices[index] = [{ label: '', value: '0' }];\n maxLengthPerChoice.splice(index, 0, newValLength);\n }\n\n choices[index][0].label = newVal || '';\n\n if (maxLengthPerChoice && newVal && maxLengthPerChoice[index] < newValLength) {\n maxLengthPerChoice[index] = newValLength;\n }\n\n onModelChanged({\n ...model,\n choices,\n maxLengthPerChoice\n });\n };\n\n onChange = markup => {\n const {\n model: { choices, maxLengthPerChoice }\n } = this.props;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll(\n '[data-type=\"explicit_constructed_response\"]'\n );\n\n const allChoices = {};\n const updatedMaxLengthPerChoice = [];\n\n allRespAreas.forEach((el, index) => {\n const newChoices = cloneDeep(choices[el.dataset.index]);\n\n if (newChoices) {\n newChoices[0] = {\n label: el.dataset.value || '',\n value: '0'\n };\n\n updatedMaxLengthPerChoice[index] = maxLengthPerChoice[el.dataset.index];\n }\n\n allChoices[index] = newChoices;\n el.dataset.index = index;\n });\n\n this.props.onModelChanged({\n ...this.props.model,\n choices: allChoices,\n slateMarkup: domMarkup.innerHTML,\n maxLengthPerChoice: updatedMaxLengthPerChoice\n });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n imageSupport\n } = this.props;\n const {\n prompt = {},\n partialScoring = {},\n rationale = {},\n teacherInstructions = {},\n maxLengthPerChoice = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, maxLengthPerChoiceEnabled } = model || {};\n const toolbarOpts = {};\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={model => this.onModelChange(model)}\n onChangeConfiguration={configuration =>\n onConfigurationChanged(configuration, true)\n }\n groups={{\n Settings: {\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n maxLengthPerChoiceEnabled:\n maxLengthPerChoice.settings && toggle(maxLengthPerChoice.label),\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n rationaleEnabled:\n rationale.settings && toggle(rationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label)\n }\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n <Typography className={classes.text}>\n Define Template, Choices, and Correct Responses\n </Typography>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'explicit-constructed-response',\n options: {\n duplicates: true\n },\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { model } = this.props;\n const correctChoice = (model.choices[\n node.data.get('index')\n ] || [])[0];\n\n return () => (\n <ECRToolbar\n onChangeResponse={newVal =>\n this.onChangeResponse(node.data.get('index'), newVal)\n }\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n correctChoice={correctChoice}\n />\n );\n }\n }}\n className={classes.markup}\n markup={model.slateMarkup}\n onChange={this.onChange}\n imageSupport={imageSupport}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n />\n {!isEmpty(model.choices) && (\n <Typography className={classes.text}>\n {`Define Alternates ${maxLengthPerChoiceEnabled ? 'and Character Limits' : ''}`}\n </Typography>\n )}\n <AlternateResponses\n model={model}\n onChange={this.onResponsesChanged}\n onLengthChange={this.onLengthChanged}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n />\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","color","fontFamily","fontSize","lineHeight","marginTop","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","newVal","props","onModelChanged","model","rationale","teacherInstructions","slateMarkup","choices","maxLengthPerChoice","index","newValLength","length","label","value","splice","domMarkup","allRespAreas","querySelectorAll","allChoices","updatedMaxLengthPerChoice","forEach","el","newChoices","dataset","undefinedLengths","setState","Object","values","choice","labelLengthsArr","map","Math","max","classes","configuration","onConfigurationChanged","imageSupport","partialScoring","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","maxLengthPerChoiceEnabled","toolbarOpts","toolbarEditorPosition","position","onModelChange","Settings","Properties","onTeacherInstructionsChanged","onPromptChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","correctChoice","data","get","onChangeResponse","onChange","onBlur","onResponsesChanged","onLengthChanged","onRationaleChanged","React","Component","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,MAAR,GAA0BC,kBAA1B,CAAQD,MAAR;AAAA,IAAgBE,KAAhB,GAA0BD,kBAA1B,CAAgBC,KAAhB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,aAAa,EAAEH,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAFxB;AAGZC,MAAAA,YAAY,EAAEN,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB;AAHvB,KADS;AAMvBE,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAD3B;AAENH,MAAAA,KAAK,EAAE;AAFD,KANe;AAUvBO,IAAAA,MAAM,EAAE;AACNC,MAAAA,SAAS,EAAE,OADL;AAENF,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAF3B;AAGNH,MAAAA,KAAK,EAAE,MAHD;AAIN,sCAAgC;AAC9BQ,QAAAA,SAAS,EAAE;AADmB;AAJ1B,KAVe;AAkBvBC,IAAAA,M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ADF,CADF;AAiID;;;EApTuBwB,kBAAMC,S;;;iCAAnBpE,I,eACQ;AACjBmC,EAAAA,aAAa,EAAEkC,sBAAUC,MAAV,CAAiBC,UADf;AAEjBnE,EAAAA,KAAK,EAAEiE,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBC,EAAAA,gBAAgB,EAAEH,sBAAUI,IAHX;AAIjBtE,EAAAA,cAAc,EAAEkE,sBAAUK,IAAV,CAAeH,UAJd;AAKjBnC,EAAAA,sBAAsB,EAAEiC,sBAAUK,IAAV,CAAeH,UALtB;AAMjBrC,EAAAA,OAAO,EAAEmC,sBAAUC,MAAV,CAAiBC,UANT;AAOjBlC,EAAAA,YAAY,EAAEgC,sBAAUM,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEP,sBAAUK,IAAV,CAAeH,UADQ;AAE5B,cAAQF,sBAAUK,IAAV,CAAeH;AAFK,GAAhB;AAPG,C;AAsTrB,IAAMM,MAAM,GAAG,wBAAW5G,MAAX,EAAmB+B,IAAnB,CAAf;eAEe6E,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport EditableHtml, {ALL_PLUGINS} from '@pie-lib/editable-html';\nimport {InputContainer, layout, settings} from '@pie-lib/config-ui';\nimport {withStyles} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ECRToolbar from './ecr-toolbar';\nimport AlternateResponses from './alternateResponses';\nimport { getAdjustedLength } from './markupUtils';\n\nconst { toggle, Panel } = settings;\n\nconst styles = theme => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px'\n }\n },\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0\n },\n addButton: {\n float: 'right'\n },\n text: {\n color: '#495B8F',\n fontFamily: 'Cerebri Sans',\n fontSize: '16px',\n lineHeight: '19px',\n marginTop: theme.spacing.unit * 4\n }\n});\n\nconst createElementFromHTML = htmlString => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired\n })\n };\n\n state = {};\n\n componentDidMount() {\n const {\n model: { slateMarkup, choices, maxLengthPerChoice = []},\n onModelChanged\n } = this.props;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n this.setState({ markup: slateMarkup });\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = (choice || []).map(choice => (choice.label || '').length);\n const length = getAdjustedLength(Math.max(...labelLengthsArr));\n\n if (undefinedLengths || !maxLengthPerChoice[index] || maxLengthPerChoice[index] < length) {\n maxLengthPerChoice[index] = length;\n }\n });\n\n onModelChanged({\n ...this.props.model,\n maxLengthPerChoice\n });\n }\n\n onModelChange = newVal => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal\n });\n };\n\n onPromptChanged = prompt => {\n this.props.onModelChanged({\n ...this.props.model,\n prompt\n });\n };\n\n onRationaleChanged = rationale => {\n this.props.onModelChanged({\n ...this.props.model,\n rationale\n });\n };\n\n onTeacherInstructionsChanged = teacherInstructions => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n teacherInstructions\n });\n };\n\n onMarkupChanged = slateMarkup => {\n this.props.onModelChanged({\n ...this.props.model,\n slateMarkup\n });\n };\n\n onResponsesChanged = choices => {\n this.props.onModelChanged({\n ...this.props.model,\n choices\n });\n };\n\n onLengthChanged = maxLengthPerChoice => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({\n ...model,\n maxLengthPerChoice\n });\n };\n\n onChangeResponse = (index, newVal) => {\n const { model, onModelChanged} = this.props;\n const { choices, maxLengthPerChoice } = model;\n const newValLength = getAdjustedLength((newVal || '').length);\n\n if (!choices[index]) {\n choices[index] = [{ label: '', value: '0' }];\n maxLengthPerChoice.splice(index, 0, newValLength);\n }\n\n choices[index][0].label = newVal || '';\n\n if (maxLengthPerChoice && newVal && maxLengthPerChoice[index] < newValLength) {\n maxLengthPerChoice[index] = newValLength;\n }\n\n onModelChanged({\n ...model,\n choices,\n maxLengthPerChoice\n });\n };\n\n onChange = markup => {\n const {\n model: { choices, maxLengthPerChoice }\n } = this.props;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll(\n '[data-type=\"explicit_constructed_response\"]'\n );\n\n const allChoices = {};\n const updatedMaxLengthPerChoice = [];\n\n allRespAreas.forEach((el, index) => {\n const newChoices = cloneDeep(choices[el.dataset.index]);\n\n if (newChoices) {\n newChoices[0] = {\n label: el.dataset.value || '',\n value: '0'\n };\n\n updatedMaxLengthPerChoice[index] = maxLengthPerChoice[el.dataset.index];\n }\n\n allChoices[index] = newChoices;\n el.dataset.index = index;\n });\n\n this.props.onModelChanged({\n ...this.props.model,\n choices: allChoices,\n slateMarkup: domMarkup.innerHTML,\n maxLengthPerChoice: updatedMaxLengthPerChoice\n });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n imageSupport\n } = this.props;\n const {\n prompt = {},\n partialScoring = {},\n rationale = {},\n teacherInstructions = {},\n maxLengthPerChoice = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, maxLengthPerChoiceEnabled } = model || {};\n const toolbarOpts = {};\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={model => this.onModelChange(model)}\n onChangeConfiguration={configuration =>\n onConfigurationChanged(configuration, true)\n }\n groups={{\n Settings: {\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n maxLengthPerChoiceEnabled:\n maxLengthPerChoice.settings && toggle(maxLengthPerChoice.label),\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n rationaleEnabled:\n rationale.settings && toggle(rationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label)\n }\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n <Typography className={classes.text}>\n Define Template, Choices, and Correct Responses\n </Typography>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'explicit-constructed-response',\n options: {\n duplicates: true\n },\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { model } = this.props;\n const correctChoice = (model.choices[\n node.data.get('index')\n ] || [])[0];\n\n return () => (\n <ECRToolbar\n onChangeResponse={newVal =>\n this.onChangeResponse(node.data.get('index'), newVal)\n }\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n correctChoice={correctChoice}\n />\n );\n }\n }}\n className={classes.markup}\n markup={model.slateMarkup}\n onChange={this.onChange}\n imageSupport={imageSupport}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n />\n {!isEmpty(model.choices) && (\n <Typography className={classes.text}>\n {`Define Alternates ${maxLengthPerChoiceEnabled ? 'and Character Limits' : ''}`}\n </Typography>\n )}\n <AlternateResponses\n model={model}\n onChange={this.onResponsesChanged}\n onLengthChange={this.onLengthChanged}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n />\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response-configure",
3
- "version": "3.6.0",
3
+ "version": "3.6.8",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "modue": "src/index.js",
@@ -8,8 +8,8 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.2.0",
11
- "@pie-lib/config-ui": "^10.10.14",
12
- "@pie-lib/editable-html": "^7.17.14",
11
+ "@pie-lib/config-ui": "^10.10.15",
12
+ "@pie-lib/editable-html": "^7.17.15",
13
13
  "classnames": "^2.2.6",
14
14
  "debug": "^3.1.0",
15
15
  "lodash": "^4.17.15",
@@ -3,6 +3,30 @@
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
+ ## [3.4.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.4.2...@pie-element/explicit-constructed-response-controller@3.4.3) (2021-12-01)
7
+
8
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.4.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.4.1...@pie-element/explicit-constructed-response-controller@3.4.2) (2021-11-29)
15
+
16
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.4.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.3.3...@pie-element/explicit-constructed-response-controller@3.4.1) (2021-11-11)
23
+
24
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
25
+
26
+
27
+
28
+
29
+
6
30
  # [3.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.3.2...@pie-element/explicit-constructed-response-controller@3.4.0) (2021-11-11)
7
31
 
8
32
 
@@ -15,6 +39,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
15
39
 
16
40
 
17
41
 
42
+
43
+ ## [3.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.3.2...@pie-element/explicit-constructed-response-controller@3.3.3) (2021-10-18)
44
+
45
+ **Note:** Version bump only for package @pie-element/explicit-constructed-response-controller
46
+
47
+
48
+
49
+
50
+
18
51
  ## [3.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@3.3.0...@pie-element/explicit-constructed-response-controller@3.3.2) (2021-08-05)
19
52
 
20
53
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/explicit-constructed-response-controller",
3
3
  "private": true,
4
- "version": "3.4.0",
4
+ "version": "3.4.6",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -1,6 +1,6 @@
1
- import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_material_ui__icons, _dll_react_dom, _dll_debug} from "../../../@pie-lib/shared-module@^1.2.15/module/index.js";
2
- import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.16/module/index.js";
3
- import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.16/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_material_ui__icons, _dll_react_dom, _dll_debug} from "../../../@pie-lib/shared-module@^1.2.16/module/index.js";
2
+ import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.0.17/module/index.js";
3
+ import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.17/module/index.js";
4
4
  function getDefaultExportFromCjs(x) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6
6
  }