@pie-element/multiple-choice 13.2.0-next.0 → 13.2.0-next.17
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 +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/index.js +4 -1
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +12 -6
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +6 -0
- package/controller/package.json +2 -2
- package/lib/choice-input.js +1 -7
- package/lib/choice-input.js.map +1 -1
- package/lib/choice.js +2 -7
- package/lib/choice.js.map +1 -1
- package/lib/index.js +0 -5
- package/lib/index.js.map +1 -1
- package/lib/multiple-choice.js +8 -23
- package/lib/multiple-choice.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +2 -2
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
# [13.2.0-next.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.0-next.0...@pie-element/multiple-choice@13.2.0-next.1) (2026-05-06)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump libs and shared modules PIE-440, PIE-436, PIE-439, PIE-519, PIE-216 ([932fc12](https://github.com/pie-framework/pie-elements/commit/932fc12557ba56a737cee005be898d54d5e590ef))
|
|
11
|
+
- fixed tests [PIE-439] ([aef44f6](https://github.com/pie-framework/pie-elements/commit/aef44f686c0d69c83f3fe464509092d68b32cbc1))
|
|
12
|
+
- make sure initial changes to the model are applied to what is needed [PIE-439] ([892a3cc](https://github.com/pie-framework/pie-elements/commit/892a3cc4c6f0b37cb65f42cfdd9a9a01db447aed))
|
|
13
|
+
|
|
6
14
|
# [13.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.0.1...@pie-element/multiple-choice@13.1.0) (2026-05-04)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
# [10.1.0-next.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.0-next.0...@pie-element/multiple-choice-configure@10.1.0-next.1) (2026-05-06)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump libs and shared modules PIE-440, PIE-436, PIE-439, PIE-519, PIE-216 ([932fc12](https://github.com/pie-framework/pie-elements/commit/932fc12557ba56a737cee005be898d54d5e590ef))
|
|
11
|
+
- fixed tests [PIE-439] ([aef44f6](https://github.com/pie-framework/pie-elements/commit/aef44f686c0d69c83f3fe464509092d68b32cbc1))
|
|
12
|
+
- make sure initial changes to the model are applied to what is needed [PIE-439] ([892a3cc](https://github.com/pie-framework/pie-elements/commit/892a3cc4c6f0b37cb65f42cfdd9a9a01db447aed))
|
|
13
|
+
|
|
6
14
|
## [10.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.0.0...@pie-element/multiple-choice-configure@10.0.1) (2026-04-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/multiple-choice-configure
|
package/configure/lib/index.js
CHANGED
|
@@ -101,7 +101,10 @@ class MultipleChoice extends HTMLElement {
|
|
|
101
101
|
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, resetValue));
|
|
102
102
|
}
|
|
103
103
|
onModelChanged(m, reset) {
|
|
104
|
-
this._model =
|
|
104
|
+
this._model = {
|
|
105
|
+
...this._model,
|
|
106
|
+
...m
|
|
107
|
+
};
|
|
105
108
|
this._render();
|
|
106
109
|
this.dispatchModelUpdated(reset);
|
|
107
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_debug","_pieConfigureEvents","_main","_configUi","_lodashEs","_defaults","log","debug","generateFormattedChoices","choices","choiceCount","length","formattedChoices","i","push","value","label","feedback","type","prepareCustomizationObject","config","model","configuration","defaults","sensibleDefaults","answerChoiceCount","MultipleChoice","HTMLElement","constructor","_root","_reactContainer","_model","createDefaultModel","_configuration","onModelChanged","bind","onConfigurationChanged","s","_render","c","info","newConfiguration","language","enabled","languageChoices","options","settings","find","option","disableSidePanel","_disableSidePanel","dispatchModelUpdated","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","element","React","createElement","Main","imageSupport","add","delete","uploadSoundSupport","document","className","appendChild","createRoot","render","error","console","stack","connectedCallback","disconnectedCallback","unmount","exports","default","_defineProperty2","normalizedModel","utils","normalizeChoices","choicesLayout","verticalMode"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\nimport {\n DeleteImageEvent,\n InsertImageEvent,\n ModelUpdatedEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\n\nimport Main from './main';\nimport { choiceUtils as utils } from '@pie-lib/config-ui';\nimport { defaults } from 'lodash-es';\n\nimport sensibleDefaults from './defaults';\n\nconst log = debug('multiple-choice:configure');\n\nconst generateFormattedChoices = (choices, choiceCount = 0) => {\n if (!choices || choices.length === 0) {\n let formattedChoices = [];\n\n for (let i = 0; i < choiceCount; i++) {\n formattedChoices.push({\n value: `${i}`,\n label: '',\n feedback: {\n type: 'none',\n value: '',\n },\n });\n }\n\n return formattedChoices;\n }\n\n return choices;\n};\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model: {\n ...model,\n choices: generateFormattedChoices(\n (model && model.choices) || [],\n configuration && configuration.answerChoiceCount,\n ),\n },\n };\n};\n\nexport default class MultipleChoice extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n const normalizedModel = utils.normalizeChoices({\n ...sensibleDefaults.model,\n ...model,\n choices: generateFormattedChoices((model && model.choices) || []),\n });\n\n // This is used for offering support for old models which have the property \"verticalMode\"\n normalizedModel.choicesLayout =\n model.choicesLayout || (model.verticalMode === false && 'horizontal') || sensibleDefaults.model.choicesLayout;\n\n return normalizedModel;\n };\n\n constructor() {\n super();\n this._root = null;\n this._reactContainer = null;\n this._model = MultipleChoice.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = MultipleChoice.createDefaultModel(s);\n\n this._render();\n }\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n\n this.onModelChanged(info.model);\n\n const newConfiguration = {\n ...sensibleDefaults.configuration,\n ...info.configuration,\n };\n this._configuration = newConfiguration;\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (newConfiguration?.language?.enabled) {\n if (newConfiguration?.languageChoices?.options?.length) {\n this._model.language = newConfiguration?.languageChoices.options[0].value;\n }\n } else if (newConfiguration.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = m;\n this._render();\n\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n /** @param {done, progress, file} handler */\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 log('_render - Starting render');\n log('_render - Model:', this._model ? 'present' : 'missing');\n log('_render - Configuration:', this._configuration ? 'present' : 'missing');\n log('_render - Root exists:', !!this._root);\n\n try {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\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 if (!this._root) {\n log('_render - Creating React container');\n\n // Create a container div for React to render into\n this._reactContainer = document.createElement('div');\n this._reactContainer.className = 'pie-configure-wrapper';\n this.appendChild(this._reactContainer);\n\n log('_render - Creating new React root');\n this._root = createRoot(this._reactContainer);\n log('_render - React root created successfully');\n }\n\n log('_render - Calling root.render()');\n this._root.render(element);\n log('_render - Render completed successfully');\n } catch (error) {\n console.error('❌ [multiple-choice-configure] Render error:', error);\n console.error('Error stack:', error.stack);\n throw error;\n }\n }\n\n connectedCallback() {\n log('connectedCallback - Component connected to DOM');\n log('connectedCallback - Model:', this._model ? 'present' : 'missing');\n log('connectedCallback - Configuration:', this._configuration ? 'present' : 'missing');\n }\n\n disconnectedCallback() {\n log('disconnectedCallback - Component disconnected from DOM');\n if (this._root) {\n log('disconnectedCallback - Unmounting React root');\n this._root.unmount();\n this._root = null;\n }\n if (this._reactContainer) {\n this._reactContainer = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,IAAAO,SAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,MAAMQ,GAAG,GAAG,IAAAC,cAAK,EAAC,2BAA2B,CAAC;AAE9C,MAAMC,wBAAwB,GAAGA,CAACC,OAAO,EAAEC,WAAW,GAAG,CAAC,KAAK;EAC7D,IAAI,CAACD,OAAO,IAAIA,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACpC,IAAIC,gBAAgB,GAAG,EAAE;IAEzB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,WAAW,EAAEG,CAAC,EAAE,EAAE;MACpCD,gBAAgB,CAACE,IAAI,CAAC;QACpBC,KAAK,EAAE,GAAGF,CAAC,EAAE;QACbG,KAAK,EAAE,EAAE;QACTC,QAAQ,EAAE;UACRC,IAAI,EAAE,MAAM;UACZH,KAAK,EAAE;QACT;MACF,CAAC,CAAC;IACJ;IAEA,OAAOH,gBAAgB;EACzB;EAEA,O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AAIA,KAAK,CAACZ,OAAO,IAAK,EAAE;EAClE,CAAC,CAAC;;EAEF;EACAiF,eAAe,CAACG,aAAa,GAC3BxE,KAAK,CAACwE,aAAa,IAAKxE,KAAK,CAACyE,YAAY,KAAK,KAAK,IAAI,YAAa,IAAItE,iBAAgB,CAACH,KAAK,CAACwE,aAAa;EAE/G,OAAOH,eAAe;AACxB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_debug","_pieConfigureEvents","_main","_configUi","_lodashEs","_defaults","log","debug","generateFormattedChoices","choices","choiceCount","length","formattedChoices","i","push","value","label","feedback","type","prepareCustomizationObject","config","model","configuration","defaults","sensibleDefaults","answerChoiceCount","MultipleChoice","HTMLElement","constructor","_root","_reactContainer","_model","createDefaultModel","_configuration","onModelChanged","bind","onConfigurationChanged","s","_render","c","info","newConfiguration","language","enabled","languageChoices","options","settings","find","option","disableSidePanel","_disableSidePanel","dispatchModelUpdated","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","element","React","createElement","Main","imageSupport","add","delete","uploadSoundSupport","document","className","appendChild","createRoot","render","error","console","stack","connectedCallback","disconnectedCallback","unmount","exports","default","_defineProperty2","normalizedModel","utils","normalizeChoices","choicesLayout","verticalMode"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\nimport {\n DeleteImageEvent,\n InsertImageEvent,\n ModelUpdatedEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\n\nimport Main from './main';\nimport { choiceUtils as utils } from '@pie-lib/config-ui';\nimport { defaults } from 'lodash-es';\n\nimport sensibleDefaults from './defaults';\n\nconst log = debug('multiple-choice:configure');\n\nconst generateFormattedChoices = (choices, choiceCount = 0) => {\n if (!choices || choices.length === 0) {\n let formattedChoices = [];\n\n for (let i = 0; i < choiceCount; i++) {\n formattedChoices.push({\n value: `${i}`,\n label: '',\n feedback: {\n type: 'none',\n value: '',\n },\n });\n }\n\n return formattedChoices;\n }\n\n return choices;\n};\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model: {\n ...model,\n choices: generateFormattedChoices(\n (model && model.choices) || [],\n configuration && configuration.answerChoiceCount,\n ),\n },\n };\n};\n\nexport default class MultipleChoice extends HTMLElement {\n static createDefaultModel = (model = {}) => {\n const normalizedModel = utils.normalizeChoices({\n ...sensibleDefaults.model,\n ...model,\n choices: generateFormattedChoices((model && model.choices) || []),\n });\n\n // This is used for offering support for old models which have the property \"verticalMode\"\n normalizedModel.choicesLayout =\n model.choicesLayout || (model.verticalMode === false && 'horizontal') || sensibleDefaults.model.choicesLayout;\n\n return normalizedModel;\n };\n\n constructor() {\n super();\n this._root = null;\n this._reactContainer = null;\n this._model = MultipleChoice.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = MultipleChoice.createDefaultModel(s);\n\n this._render();\n }\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n\n this.onModelChanged(info.model);\n\n const newConfiguration = {\n ...sensibleDefaults.configuration,\n ...info.configuration,\n };\n this._configuration = newConfiguration;\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (newConfiguration?.language?.enabled) {\n if (newConfiguration?.languageChoices?.options?.length) {\n this._model.language = newConfiguration?.languageChoices.options[0].value;\n }\n } else if (newConfiguration.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find((option) => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = {\n ...this._model,\n ...m,\n };\n this._render();\n\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n /** @param {done, progress, file} handler */\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 log('_render - Starting render');\n log('_render - Model:', this._model ? 'present' : 'missing');\n log('_render - Configuration:', this._configuration ? 'present' : 'missing');\n log('_render - Root exists:', !!this._root);\n\n try {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\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 if (!this._root) {\n log('_render - Creating React container');\n\n // Create a container div for React to render into\n this._reactContainer = document.createElement('div');\n this._reactContainer.className = 'pie-configure-wrapper';\n this.appendChild(this._reactContainer);\n\n log('_render - Creating new React root');\n this._root = createRoot(this._reactContainer);\n log('_render - React root created successfully');\n }\n\n log('_render - Calling root.render()');\n this._root.render(element);\n log('_render - Render completed successfully');\n } catch (error) {\n console.error('❌ [multiple-choice-configure] Render error:', error);\n console.error('Error stack:', error.stack);\n throw error;\n }\n }\n\n connectedCallback() {\n log('connectedCallback - Component connected to DOM');\n log('connectedCallback - Model:', this._model ? 'present' : 'missing');\n log('connectedCallback - Configuration:', this._configuration ? 'present' : 'missing');\n }\n\n disconnectedCallback() {\n log('disconnectedCallback - Component disconnected from DOM');\n if (this._root) {\n log('disconnectedCallback - Unmounting React root');\n this._root.unmount();\n this._root = null;\n }\n if (this._reactContainer) {\n this._reactContainer = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAQA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,IAAAO,SAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,MAAMQ,GAAG,GAAG,IAAAC,cAAK,EAAC,2BAA2B,CAAC;AAE9C,MAAMC,wBAAwB,GAAGA,CAACC,OAAO,EAAEC,WAAW,GAAG,CAAC,KAAK;EAC7D,IAAI,CAACD,OAAO,IAAIA,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACpC,IAAIC,gBAAgB,GAAG,EAAE;IAEzB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,WAAW,EAAEG,CAAC,EAAE,EAAE;MACpCD,gBAAgB,CAACE,IAAI,CAAC;QACpBC,KAAK,EAAE,GAAGF,CAAC,EAAE;QAC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L,CAACL,KAAK,GAAG,CAAC,CAAC,KAAK;EAC1C,MAAMqE,eAAe,GAAGC,qBAAK,CAACC,gBAAgB,CAAC;IAC7C,GAAGpE,iBAAgB,CAACH,KAAK;IACzB,GAAGA,KAAK;IACRZ,OAAO,EAAED,wBAAwB,CAAEa,KAAK,IAAIA,KAAK,CAACZ,OAAO,IAAK,EAAE;EAClE,CAAC,CAAC;;EAEF;EACAiF,eAAe,CAACG,aAAa,GAC3BxE,KAAK,CAACwE,aAAa,IAAKxE,KAAK,CAACyE,YAAY,KAAK,KAAK,IAAI,YAAa,IAAItE,iBAAgB,CAACH,KAAK,CAACwE,aAAa;EAE/G,OAAOH,eAAe;AACxB,CAAC","ignoreList":[]}
|
package/configure/lib/main.js
CHANGED
|
@@ -349,7 +349,9 @@ class Main extends _react.default.Component {
|
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
351
|
model.choices.splice(index, 1);
|
|
352
|
-
onModelChanged(
|
|
352
|
+
onModelChanged({
|
|
353
|
+
choices: model.choices
|
|
354
|
+
});
|
|
353
355
|
});
|
|
354
356
|
(0, _defineProperty2.default)(this, "onAddChoice", () => {
|
|
355
357
|
const {
|
|
@@ -378,7 +380,9 @@ class Main extends _react.default.Component {
|
|
|
378
380
|
type: 'none'
|
|
379
381
|
}
|
|
380
382
|
});
|
|
381
|
-
onModelChanged(
|
|
383
|
+
onModelChanged({
|
|
384
|
+
choices: model.choices
|
|
385
|
+
});
|
|
382
386
|
});
|
|
383
387
|
(0, _defineProperty2.default)(this, "onChoiceChanged", (index, choice) => {
|
|
384
388
|
const {
|
|
@@ -391,17 +395,17 @@ class Main extends _react.default.Component {
|
|
|
391
395
|
}));
|
|
392
396
|
}
|
|
393
397
|
model.choices.splice(index, 1, choice);
|
|
394
|
-
onModelChanged(
|
|
398
|
+
onModelChanged({
|
|
399
|
+
choices: model.choices
|
|
400
|
+
});
|
|
395
401
|
});
|
|
396
402
|
(0, _defineProperty2.default)(this, "onPromptChanged", prompt => {
|
|
397
403
|
this.props.onModelChanged({
|
|
398
|
-
...this.props.model,
|
|
399
404
|
prompt
|
|
400
405
|
});
|
|
401
406
|
});
|
|
402
407
|
(0, _defineProperty2.default)(this, "onTeacherInstructionsChanged", teacherInstructions => {
|
|
403
408
|
this.props.onModelChanged({
|
|
404
|
-
...this.props.model,
|
|
405
409
|
teacherInstructions
|
|
406
410
|
});
|
|
407
411
|
});
|
|
@@ -426,7 +430,9 @@ class Main extends _react.default.Component {
|
|
|
426
430
|
return c;
|
|
427
431
|
});
|
|
428
432
|
}
|
|
429
|
-
onModelChanged(
|
|
433
|
+
onModelChanged({
|
|
434
|
+
choices: model.choices
|
|
435
|
+
}, true);
|
|
430
436
|
break;
|
|
431
437
|
}
|
|
432
438
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_editableHtmlTipTap","_configUi","_renderUi","_Button","_Tooltip","_Typography","_Box","_Info","_lodashEs","_utils","Panel","toggle","radio","dropdown","settings","MAX_CHOICES","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","RationaleHolder","flex","marginTop","marginLeft","ChoiceConfigurationHolder","display","flexDirection","AddButton","Button","float","DisableButton","cursor","pointerEvents","backgroundColor","color","disabled","FlexContainer","Box","alignItems","TitleText","Typography","fontSize","typography","marginRight","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","palette","error","main","Design","props","model","configuration","onPromptChanged","onChoiceChanged","onRemoveChoice","onAddChoice","imageSupport","uploadSoundSupport","onChangeModel","onConfigurationChanged","onTeacherInstructionsChanged","addChoiceButton","contentDimensions","feedback","deleteChoice","choiceMode","choicePrefix","partialScoring","lockChoiceOrder","teacherInstructions","studentInstructions","rationale","scoringType","sequentialChoiceLabels","settingsPanelDisabled","choicesLayout","spellCheck","gridColumns","maxImageWidth","maxImageHeight","prompt","withRubric","mathMlOptions","language","languageChoices","maxAnswerChoices","limitChoicesNumber","teacherInstructionsEnabled","rationaleEnabled","feedbackEnabled","promptEnabled","spellCheckEnabled","choices","errors","toolbarEditorPosition","extraCSSRules","answerChoices","answerChoicesError","choicesErrors","correctResponse","correctResponseError","promptError","rationaleErrors","teacherInstructionsError","nrOfColumnsAvailable","length","Array","from","_","i","baseInputConfiguration","toolbarOpts","position","getPluginProps","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","addChoiceButtonTooltip","panelSettings","label","enabled","options","panelProperties","studentInstructionsEnabled","rubricEnabled","default","createElement","layout","ConfigLayout","dimensions","hideSettings","classes","onChangeConfiguration","groups","Settings","Properties","markup","onChange","nonEmpty","disableUnderline","pluginProps","inputConfiguration","languageCharactersProps","component","disableFocusListener","disableTouchListener","placement","title","map","choice","index","key","ChoiceConfiguration","useLetterOrdering","mode","data","defaultFeedback","disableImageAlignmentButtons","onDelete","c","allowFeedBack","allowDelete","noLabels","pluginOpts","value","noCorrectAnswerError","variant","onClick","Main","React","Component","constructor","args","_defineProperty2","showWarning","onModelChanged","minAnswerChoices","setState","splice","push","utils","firstAvailableIndex","type","correct","merge","correctFound","render","state","Fragment","AlertDialog","open","text","onConfirm","_extends2","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport {\n AlertDialog,\n InputContainer,\n ChoiceConfiguration,\n settings,\n layout,\n choiceUtils as utils,\n} from '@pie-lib/config-ui';\nimport { color } from '@pie-lib/render-ui';\nimport Button from '@mui/material/Button';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport Info from '@mui/icons-material/Info';\nimport { merge } from 'lodash-es';\nimport { generateValidationMessage } from './utils';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst MAX_CHOICES = 9;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst RationaleHolder = styled(InputContainer)(({ theme }) => ({\n flex: 1,\n marginTop: theme.spacing(1.5),\n paddingTop: theme.spacing(2),\n marginLeft: theme.spacing(3.5),\n}));\n\nconst ChoiceConfigurationHolder = styled(InputContainer)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n marginBottom: theme.spacing(1),\n width: '100%',\n}));\n\n\nconst AddButton = styled(Button)(({ theme }) => ({\n marginTop: theme.spacing(1),\n float: 'right',\n}));\n\nconst DisableButton = styled(AddButton)({\n cursor: 'not-allowed',\n pointerEvents: 'all',\n backgroundColor: color.disabled(),\n '&:hover': {\n backgroundColor: color.disabled(),\n },\n '&:focus': {\n backgroundColor: color.disabled(),\n },\n});\n\nconst FlexContainer = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst TitleText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginRight: theme.spacing(1),\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst Design = (props) => {\n const {\n model,\n configuration,\n onPromptChanged,\n onChoiceChanged,\n onRemoveChoice,\n onAddChoice,\n imageSupport,\n uploadSoundSupport,\n onChangeModel,\n onConfigurationChanged,\n onTeacherInstructionsChanged,\n } = props;\n\n const {\n addChoiceButton = {},\n contentDimensions = {},\n feedback = {},\n deleteChoice = {},\n choiceMode = {},\n choicePrefix = {},\n partialScoring = {},\n lockChoiceOrder = {},\n teacherInstructions = {},\n studentInstructions = {},\n rationale = {},\n scoringType = {},\n sequentialChoiceLabels = {},\n settingsPanelDisabled,\n choicesLayout,\n spellCheck = {},\n gridColumns,\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n } = configuration || {};\n let { maxAnswerChoices } = configuration || {};\n const {\n limitChoicesNumber,\n teacherInstructionsEnabled,\n rationaleEnabled,\n feedbackEnabled,\n promptEnabled,\n spellCheckEnabled,\n choices,\n errors,\n toolbarEditorPosition,\n extraCSSRules,\n } = model || {};\n\n const {\n answerChoices: answerChoicesError,\n choices: choicesErrors,\n correctResponse: correctResponseError,\n prompt: promptError,\n rationale: rationaleErrors,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const nrOfColumnsAvailable = choices?.length ? Array.from({ length: choices.length }, (_, i) => `${i + 1}`) : [];\n\n const { baseInputConfiguration = {} } = configuration;\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n // if old property is used, set maxAnswerChoices to 9\n if (limitChoicesNumber) {\n maxAnswerChoices = MAX_CHOICES;\n }\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n\n const validationMessage = generateValidationMessage(configuration);\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const addChoiceButtonTooltip =\n maxAnswerChoices && choices?.length >= maxAnswerChoices ? `Only ${maxAnswerChoices} allowed maximum` : '';\n\n const panelSettings = {\n choiceMode: choiceMode.settings && radio(choiceMode.label, ['checkbox', 'radio']),\n 'sequentialChoiceLabels.enabled': sequentialChoiceLabels.settings && toggle(sequentialChoiceLabels.label, true),\n choicePrefix: choicePrefix.settings && radio(choicePrefix.label, ['numbers', 'letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n choicesLayout: choicesLayout.settings && dropdown(choicesLayout.label, ['vertical', 'grid', 'horizontal']),\n gridColumns:\n choicesLayout.settings &&\n model.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.length > 0 &&\n dropdown(gridColumns.label, nrOfColumnsAvailable),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n extraCSSRules={extraCSSRules}\n classes={{}}\n settings={\n <Panel\n model={model}\n onChangeModel={onChangeModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.teacherInstructions?.inputConfiguration)}\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 mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.prompt}\n maxImageHeight={maxImageHeight && maxImageHeight.prompt}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <TitleText component={'div'}>\n Choices\n </TitleText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </StyledTooltip>\n </FlexContainer>\n\n {choices.map((choice, index) => (\n <ChoiceConfigurationHolder key={`choice-${index}`}>\n <ChoiceConfiguration\n key={index}\n index={index + 1}\n useLetterOrdering={model.choicePrefix === 'letters'}\n mode={model.choiceMode}\n data={choice}\n defaultFeedback={{}}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onDelete={() => onRemoveChoice(index)}\n onChange={(c) => onChoiceChanged(index, c)}\n allowFeedBack={feedbackEnabled}\n allowDelete={deleteChoice.settings}\n noLabels\n pluginOpts={getPluginProps(configuration?.choices?.inputConfiguration)}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n error={choicesErrors?.[choice.value] || null}\n noCorrectAnswerError={correctResponseError}\n maxImageWidth={(maxImageWidth && maxImageWidth.choices) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.choices) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n\n {rationaleEnabled && (\n <RationaleHolder key={`rationale-${index}`} label={rationale.label}>\n <EditableHtml\n markup={choice.rationale || ''}\n onChange={(c) => onChoiceChanged(index, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n error={rationaleErrors?.[choice.value] || null}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleErrors?.[choice.value] && (\n <ErrorText>{rationaleErrors?.[choice.value]}</ErrorText>\n )}\n </RationaleHolder>\n )}\n </ChoiceConfigurationHolder>\n ))}\n\n {correctResponseError && <ErrorText>{correctResponseError}</ErrorText>}\n {answerChoicesError && <ErrorText>{answerChoicesError}</ErrorText>}\n\n {addChoiceButton.settings && (\n <StyledTooltip title={addChoiceButtonTooltip}>\n {maxAnswerChoices && choices?.length >= maxAnswerChoices ? (\n <DisableButton\n variant=\"contained\"\n color=\"primary\"\n onClick={onAddChoice}\n disabled\n >\n {addChoiceButton.label}\n </DisableButton>\n ) : (\n <AddButton\n variant=\"contained\"\n color=\"primary\"\n onClick={onAddChoice}\n >\n {addChoiceButton.label}\n </AddButton>\n )}\n </StyledTooltip>\n )}\n </layout.ConfigLayout>\n );\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = { showWarning: false };\n\n onRemoveChoice = (index) => {\n const { model, configuration, onModelChanged } = this.props;\n const { minAnswerChoices } = configuration || {};\n\n if (minAnswerChoices && model.choices.length === minAnswerChoices) {\n this.setState({ showWarning: true });\n\n return;\n }\n\n model.choices.splice(index, 1);\n onModelChanged(model);\n };\n\n onAddChoice = () => {\n const { model, configuration, onModelChanged } = this.props;\n let { maxAnswerChoices } = configuration || {};\n const { limitChoicesNumber } = model || {};\n\n // if old property is used, set maxAnswerChoices to 9\n if (limitChoicesNumber) {\n maxAnswerChoices = MAX_CHOICES;\n }\n\n if (maxAnswerChoices && model.choices.length >= maxAnswerChoices) {\n return;\n }\n\n model.choices.push({\n label: '',\n value: utils.firstAvailableIndex(\n model.choices.map((c) => c.value),\n 0,\n ),\n feedback: { type: 'none' },\n });\n\n onModelChanged(model);\n };\n\n onChoiceChanged = (index, choice) => {\n const { model, onModelChanged } = this.props;\n\n if (choice.correct && model.choiceMode === 'radio') {\n model.choices = model.choices.map((c) => merge({}, c, { correct: false }));\n }\n\n model.choices.splice(index, 1, choice);\n onModelChanged(model);\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({\n ...this.props.model,\n prompt,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n ...this.props.model,\n teacherInstructions,\n });\n };\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n switch (key) {\n case 'choiceMode': {\n let value = model.choiceMode;\n\n if (value === 'radio') {\n let correctFound = false;\n\n model.choices = model.choices.map((c) => {\n if (correctFound) {\n c.correct = false;\n\n return c;\n }\n\n if (c.correct) {\n correctFound = true;\n }\n\n return c;\n });\n }\n\n onModelChanged(model, true);\n break;\n }\n\n default:\n onModelChanged(model);\n break;\n }\n };\n\n render() {\n const { configuration: { minAnswerChoices } = {} } = this.props;\n const { showWarning } = this.state;\n\n return (\n <React.Fragment>\n <AlertDialog\n open={showWarning}\n title=\"Warning\"\n text={`There can't be less than ${minAnswerChoices || 0} choices.`}\n onConfirm={() => this.setState({ showWarning: false })}\n />\n <Design\n {...this.props}\n onChangeModel={this.onModelChanged}\n onRemoveChoice={this.onRemoveChoice}\n onChoiceChanged={this.onChoiceChanged}\n onAddChoice={this.onAddChoice}\n onPromptChanged={this.onPromptChanged}\n onTeacherInstructionsChanged={this.onTeacherInstructionsChanged}\n />\n </React.Fragment>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAQA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,IAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,KAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAEA,MAAM;EAAEa,KAAK;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAS,CAAC,GAAGC,kBAAQ;AAEnD,MAAMC,WAAW,GAAG,CAAC;AAErB,MAAMC,YAAY,GAAG,IAAAC,cAAM,EAACC,wBAAc,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC1DC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAEF,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;EAC5BC,YAAY,EAAEJ,KAAK,CAACG,OAAO,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,MAAME,eAAe,GAAG,IAAAP,cAAM,EAACC,wBAAc,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC7DM,IAAI,EAAE,CAAC;E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CQ,4BAA4B,EAAE,IAAI,CAACA;IAA6B,EACjE,CACa,CAAC;EAErB;AACF;AAACuI,OAAA,CAAA1B,IAAA,GAAAA,IAAA;AAAA,IAAAK,gBAAA,CAAAhD,OAAA,EA3IY2C,IAAI,eACI;EACjBvH,KAAK,EAAEkJ,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCnJ,aAAa,EAAEiJ,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1CC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChCxB,cAAc,EAAEoB,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzC3I,sBAAsB,EAAEyI,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjD9I,YAAY,EAAE4I,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC;AACH,CAAC;AAAA,IAAAO,QAAA,GAAAV,OAAA,CAAArE,OAAA,GAkIY2C,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_editableHtmlTipTap","_configUi","_renderUi","_Button","_Tooltip","_Typography","_Box","_Info","_lodashEs","_utils","Panel","toggle","radio","dropdown","settings","MAX_CHOICES","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","RationaleHolder","flex","marginTop","marginLeft","ChoiceConfigurationHolder","display","flexDirection","AddButton","Button","float","DisableButton","cursor","pointerEvents","backgroundColor","color","disabled","FlexContainer","Box","alignItems","TitleText","Typography","fontSize","typography","marginRight","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","palette","error","main","Design","props","model","configuration","onPromptChanged","onChoiceChanged","onRemoveChoice","onAddChoice","imageSupport","uploadSoundSupport","onChangeModel","onConfigurationChanged","onTeacherInstructionsChanged","addChoiceButton","contentDimensions","feedback","deleteChoice","choiceMode","choicePrefix","partialScoring","lockChoiceOrder","teacherInstructions","studentInstructions","rationale","scoringType","sequentialChoiceLabels","settingsPanelDisabled","choicesLayout","spellCheck","gridColumns","maxImageWidth","maxImageHeight","prompt","withRubric","mathMlOptions","language","languageChoices","maxAnswerChoices","limitChoicesNumber","teacherInstructionsEnabled","rationaleEnabled","feedbackEnabled","promptEnabled","spellCheckEnabled","choices","errors","toolbarEditorPosition","extraCSSRules","answerChoices","answerChoicesError","choicesErrors","correctResponse","correctResponseError","promptError","rationaleErrors","teacherInstructionsError","nrOfColumnsAvailable","length","Array","from","_","i","baseInputConfiguration","toolbarOpts","position","getPluginProps","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","addChoiceButtonTooltip","panelSettings","label","enabled","options","panelProperties","studentInstructionsEnabled","rubricEnabled","default","createElement","layout","ConfigLayout","dimensions","hideSettings","classes","onChangeConfiguration","groups","Settings","Properties","markup","onChange","nonEmpty","disableUnderline","pluginProps","inputConfiguration","languageCharactersProps","component","disableFocusListener","disableTouchListener","placement","title","map","choice","index","key","ChoiceConfiguration","useLetterOrdering","mode","data","defaultFeedback","disableImageAlignmentButtons","onDelete","c","allowFeedBack","allowDelete","noLabels","pluginOpts","value","noCorrectAnswerError","variant","onClick","Main","React","Component","constructor","args","_defineProperty2","showWarning","onModelChanged","minAnswerChoices","setState","splice","push","utils","firstAvailableIndex","type","correct","merge","correctFound","render","state","Fragment","AlertDialog","open","text","onConfirm","_extends2","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport {\n AlertDialog,\n InputContainer,\n ChoiceConfiguration,\n settings,\n layout,\n choiceUtils as utils,\n} from '@pie-lib/config-ui';\nimport { color } from '@pie-lib/render-ui';\nimport Button from '@mui/material/Button';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport Info from '@mui/icons-material/Info';\nimport { merge } from 'lodash-es';\nimport { generateValidationMessage } from './utils';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst MAX_CHOICES = 9;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst RationaleHolder = styled(InputContainer)(({ theme }) => ({\n flex: 1,\n marginTop: theme.spacing(1.5),\n paddingTop: theme.spacing(2),\n marginLeft: theme.spacing(3.5),\n}));\n\nconst ChoiceConfigurationHolder = styled(InputContainer)(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n marginBottom: theme.spacing(1),\n width: '100%',\n}));\n\n\nconst AddButton = styled(Button)(({ theme }) => ({\n marginTop: theme.spacing(1),\n float: 'right',\n}));\n\nconst DisableButton = styled(AddButton)({\n cursor: 'not-allowed',\n pointerEvents: 'all',\n backgroundColor: color.disabled(),\n '&:hover': {\n backgroundColor: color.disabled(),\n },\n '&:focus': {\n backgroundColor: color.disabled(),\n },\n});\n\nconst FlexContainer = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst TitleText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginRight: theme.spacing(1),\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst Design = (props) => {\n const {\n model,\n configuration,\n onPromptChanged,\n onChoiceChanged,\n onRemoveChoice,\n onAddChoice,\n imageSupport,\n uploadSoundSupport,\n onChangeModel,\n onConfigurationChanged,\n onTeacherInstructionsChanged,\n } = props;\n\n const {\n addChoiceButton = {},\n contentDimensions = {},\n feedback = {},\n deleteChoice = {},\n choiceMode = {},\n choicePrefix = {},\n partialScoring = {},\n lockChoiceOrder = {},\n teacherInstructions = {},\n studentInstructions = {},\n rationale = {},\n scoringType = {},\n sequentialChoiceLabels = {},\n settingsPanelDisabled,\n choicesLayout,\n spellCheck = {},\n gridColumns,\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n } = configuration || {};\n let { maxAnswerChoices } = configuration || {};\n const {\n limitChoicesNumber,\n teacherInstructionsEnabled,\n rationaleEnabled,\n feedbackEnabled,\n promptEnabled,\n spellCheckEnabled,\n choices,\n errors,\n toolbarEditorPosition,\n extraCSSRules,\n } = model || {};\n\n const {\n answerChoices: answerChoicesError,\n choices: choicesErrors,\n correctResponse: correctResponseError,\n prompt: promptError,\n rationale: rationaleErrors,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const nrOfColumnsAvailable = choices?.length ? Array.from({ length: choices.length }, (_, i) => `${i + 1}`) : [];\n\n const { baseInputConfiguration = {} } = configuration;\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n // if old property is used, set maxAnswerChoices to 9\n if (limitChoicesNumber) {\n maxAnswerChoices = MAX_CHOICES;\n }\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n\n const validationMessage = generateValidationMessage(configuration);\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const addChoiceButtonTooltip =\n maxAnswerChoices && choices?.length >= maxAnswerChoices ? `Only ${maxAnswerChoices} allowed maximum` : '';\n\n const panelSettings = {\n choiceMode: choiceMode.settings && radio(choiceMode.label, ['checkbox', 'radio']),\n 'sequentialChoiceLabels.enabled': sequentialChoiceLabels.settings && toggle(sequentialChoiceLabels.label, true),\n choicePrefix: choicePrefix.settings && radio(choicePrefix.label, ['numbers', 'letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n choicesLayout: choicesLayout.settings && dropdown(choicesLayout.label, ['vertical', 'grid', 'horizontal']),\n gridColumns:\n choicesLayout.settings &&\n model.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.length > 0 &&\n dropdown(gridColumns.label, nrOfColumnsAvailable),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n extraCSSRules={extraCSSRules}\n classes={{}}\n settings={\n <Panel\n model={model}\n onChangeModel={onChangeModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.teacherInstructions?.inputConfiguration)}\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 mathMlOptions={mathMlOptions}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.prompt}\n maxImageHeight={maxImageHeight && maxImageHeight.prompt}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <TitleText component={'div'}>\n Choices\n </TitleText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </StyledTooltip>\n </FlexContainer>\n\n {choices.map((choice, index) => (\n <ChoiceConfigurationHolder key={`choice-${index}`}>\n <ChoiceConfiguration\n key={index}\n index={index + 1}\n useLetterOrdering={model.choicePrefix === 'letters'}\n mode={model.choiceMode}\n data={choice}\n defaultFeedback={{}}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onDelete={() => onRemoveChoice(index)}\n onChange={(c) => onChoiceChanged(index, c)}\n allowFeedBack={feedbackEnabled}\n allowDelete={deleteChoice.settings}\n noLabels\n pluginOpts={getPluginProps(configuration?.choices?.inputConfiguration)}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n error={choicesErrors?.[choice.value] || null}\n noCorrectAnswerError={correctResponseError}\n maxImageWidth={(maxImageWidth && maxImageWidth.choices) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.choices) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n />\n\n {rationaleEnabled && (\n <RationaleHolder key={`rationale-${index}`} label={rationale.label}>\n <EditableHtml\n markup={choice.rationale || ''}\n onChange={(c) => onChoiceChanged(index, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n error={rationaleErrors?.[choice.value] || null}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(configuration?.rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n />\n {rationaleErrors?.[choice.value] && (\n <ErrorText>{rationaleErrors?.[choice.value]}</ErrorText>\n )}\n </RationaleHolder>\n )}\n </ChoiceConfigurationHolder>\n ))}\n\n {correctResponseError && <ErrorText>{correctResponseError}</ErrorText>}\n {answerChoicesError && <ErrorText>{answerChoicesError}</ErrorText>}\n\n {addChoiceButton.settings && (\n <StyledTooltip title={addChoiceButtonTooltip}>\n {maxAnswerChoices && choices?.length >= maxAnswerChoices ? (\n <DisableButton\n variant=\"contained\"\n color=\"primary\"\n onClick={onAddChoice}\n disabled\n >\n {addChoiceButton.label}\n </DisableButton>\n ) : (\n <AddButton\n variant=\"contained\"\n color=\"primary\"\n onClick={onAddChoice}\n >\n {addChoiceButton.label}\n </AddButton>\n )}\n </StyledTooltip>\n )}\n </layout.ConfigLayout>\n );\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = { showWarning: false };\n\n onRemoveChoice = (index) => {\n const { model, configuration, onModelChanged } = this.props;\n const { minAnswerChoices } = configuration || {};\n\n if (minAnswerChoices && model.choices.length === minAnswerChoices) {\n this.setState({ showWarning: true });\n\n return;\n }\n\n model.choices.splice(index, 1);\n onModelChanged({\n choices: model.choices,\n });\n };\n\n onAddChoice = () => {\n const { model, configuration, onModelChanged } = this.props;\n let { maxAnswerChoices } = configuration || {};\n const { limitChoicesNumber } = model || {};\n\n // if old property is used, set maxAnswerChoices to 9\n if (limitChoicesNumber) {\n maxAnswerChoices = MAX_CHOICES;\n }\n\n if (maxAnswerChoices && model.choices.length >= maxAnswerChoices) {\n return;\n }\n\n model.choices.push({\n label: '',\n value: utils.firstAvailableIndex(\n model.choices.map((c) => c.value),\n 0,\n ),\n feedback: { type: 'none' },\n });\n\n onModelChanged({\n choices: model.choices,\n });\n };\n\n onChoiceChanged = (index, choice) => {\n const { model, onModelChanged } = this.props;\n\n if (choice.correct && model.choiceMode === 'radio') {\n model.choices = model.choices.map((c) => merge({}, c, { correct: false }));\n }\n\n model.choices.splice(index, 1, choice);\n onModelChanged({\n choices: model.choices,\n });\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({\n prompt,\n });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({\n teacherInstructions,\n });\n };\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n switch (key) {\n case 'choiceMode': {\n let value = model.choiceMode;\n\n if (value === 'radio') {\n let correctFound = false;\n\n model.choices = model.choices.map((c) => {\n if (correctFound) {\n c.correct = false;\n\n return c;\n }\n\n if (c.correct) {\n correctFound = true;\n }\n\n return c;\n });\n }\n\n onModelChanged({\n choices: model.choices,\n }, true);\n break;\n }\n\n default:\n onModelChanged(model);\n break;\n }\n };\n\n render() {\n const { configuration: { minAnswerChoices } = {} } = this.props;\n const { showWarning } = this.state;\n\n return (\n <React.Fragment>\n <AlertDialog\n open={showWarning}\n title=\"Warning\"\n text={`There can't be less than ${minAnswerChoices || 0} choices.`}\n onConfirm={() => this.setState({ showWarning: false })}\n />\n <Design\n {...this.props}\n onChangeModel={this.onModelChanged}\n onRemoveChoice={this.onRemoveChoice}\n onChoiceChanged={this.onChoiceChanged}\n onAddChoice={this.onAddChoice}\n onPromptChanged={this.onPromptChanged}\n onTeacherInstructionsChanged={this.onTeacherInstructionsChanged}\n />\n </React.Fragment>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAQA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,IAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,KAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAEA,MAAM;EAAEa,KAAK;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAS,CAAC,GAAGC,kBAAQ;AAEnD,MAAMC,WAAW,GAAG,CAAC;AAErB,MAAMC,YAAY,GAAG,IAAAC,cAAM,EAACC,wBAAc,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC1DC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAEF,KAAK,CAACG,OAAO,CAAC,CA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CAAAC,aAAA,CAAC/E,MAAM,MAAAkJ,SAAA,CAAApE,OAAA,MACD,IAAI,CAAC7E,KAAK;MACdS,aAAa,EAAE,IAAI,CAACsH,cAAe;MACnC1H,cAAc,EAAE,IAAI,CAACA,cAAe;MACpCD,eAAe,EAAE,IAAI,CAACA,eAAgB;MACtCE,WAAW,EAAE,IAAI,CAACA,WAAY;MAC9BH,eAAe,EAAE,IAAI,CAACA,eAAgB;MACtCQ,4BAA4B,EAAE,IAAI,CAACA;IAA6B,EACjE,CACa,CAAC;EAErB;AACF;AAACuI,OAAA,CAAA1B,IAAA,GAAAA,IAAA;AAAA,IAAAK,gBAAA,CAAAhD,OAAA,EAjJY2C,IAAI,eACI;EACjBvH,KAAK,EAAEkJ,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCnJ,aAAa,EAAEiJ,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1CC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChCxB,cAAc,EAAEoB,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzC3I,sBAAsB,EAAEyI,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjD9I,YAAY,EAAE4I,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC;AACH,CAAC;AAAA,IAAAO,QAAA,GAAAV,OAAA,CAAArE,OAAA,GAwIY2C,IAAI","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "10.1.0-next.
|
|
3
|
+
"version": "10.1.0-next.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"@mui/icons-material": "^7.3.4",
|
|
11
11
|
"@mui/material": "^7.3.4",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "13.0.
|
|
14
|
-
"@pie-lib/editable-html-tip-tap": "2.
|
|
15
|
-
"@pie-lib/render-ui": "6.0.
|
|
13
|
+
"@pie-lib/config-ui": "13.0.3",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "2.1.1",
|
|
15
|
+
"@pie-lib/render-ui": "6.1.0-next.2",
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"lodash-es": "^4.17.23",
|
|
18
18
|
"prop-types": "^15.8.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# [8.1.0-next.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.1.0-next.0...@pie-element/multiple-choice-controller@8.1.0-next.1) (2026-05-06)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump libs and shared modules PIE-440, PIE-436, PIE-439, PIE-519, PIE-216 ([932fc12](https://github.com/pie-framework/pie-elements/commit/932fc12557ba56a737cee005be898d54d5e590ef))
|
|
11
|
+
|
|
6
12
|
## [8.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-controller@8.0.0...@pie-element/multiple-choice-controller@8.0.1) (2026-04-28)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @pie-element/multiple-choice-controller
|
package/controller/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "8.1.0-next.
|
|
4
|
+
"version": "8.1.0-next.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@pie-lib/controller-utils": "2.0.
|
|
11
|
+
"@pie-lib/controller-utils": "2.0.2-next.1",
|
|
12
12
|
"debug": "^4.1.1",
|
|
13
13
|
"lodash-es": "^4.17.23"
|
|
14
14
|
}
|
package/lib/choice-input.js
CHANGED
|
@@ -322,13 +322,7 @@ class ChoiceInput extends _react.default.Component {
|
|
|
322
322
|
}
|
|
323
323
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
324
324
|
"aria-hidden": "true"
|
|
325
|
-
}, displayKey ? `${displayKey}.` : '')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, screenReaderLabel, /*#__PURE__*/_react.default.createElement(Tag,
|
|
326
|
-
slotProps: {
|
|
327
|
-
input: {
|
|
328
|
-
ref: this.props.autoFocusRef
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
})));
|
|
325
|
+
}, displayKey ? `${displayKey}.` : '')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, screenReaderLabel, /*#__PURE__*/_react.default.createElement(Tag, tagProps));
|
|
332
326
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
333
327
|
className: (0, _classnames.default)(className, 'corespring-' + classSuffix, 'choice-input')
|
|
334
328
|
}, /*#__PURE__*/_react.default.createElement(Row, null, !hideTick && isEvaluateMode && /*#__PURE__*/_react.default.createElement(_feedbackTick.default, {
|
package/lib/choice-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-input.js","names":["_FormControlLabel","_interopRequireDefault","require","_react","_propTypes","_styles","_Box","_Checkbox","_renderUi","_Radio","_classnames","_feedbackTick","CLASS_NAME","Row","styled","Box","display","alignItems","backgroundColor","color","background","CheckboxHolder","flex","marginLeft","text","fontSize","padding","BelowSelectionComponent","theme","spacing","SrOnly","position","left","top","width","height","overflow","StyledFormControlLabel","exports","FormControlLabel","letterSpacing","cursor","colorStyle","varName","fallback","getInputStyles","correctness","key","k","primaryLight","incorrect","correct","primary","disabled","opacity","pointerEvents","focusVisibleUnchecked","outline","focusUncheckedBorder","focusUnchecked","focusVisibleChecked","focusCheckedBorder","focusChecked","StyledCheckboxBase","Checkbox","shouldForwardProp","prop","styles","StyledCheckbox","props","checked","onChange","value","id","onKeyDown","inputRef","miniProps","default","createElement","_extends2","slotProps","input","ref","disableRipple","className","StyledRadioBase","Radio","StyledRadio","tagName","name","ChoiceInput","React","Component","constructor","_defineProperty2","event","choiceMode","isArrowDown","isArrowUp","preventDefault","currentEl","document","getElementById","choiceId","fieldset","closest","groupCheckboxes","Array","from","querySelectorAll","currentIndex","findIndex","el","nextIndex","nextEl","focus","onToggleChoice","bind","generateChoiceId","descId","Math","random","toFixed","render","displayKey","feedback","label","rationale","hideTick","isEvaluateMode","choicesLayout","isSelectionButtonBelow","Tag","classSuffix","holderSx","margin","justifyContent","hasMathOrImage","includes","screenReaderLabel","choicelabel","Fragment","component","PreviewPrompt","prompt","tagProps","handleKeyDown","control","style","autoFocusRef","classNames","sx","htmlFor","labelPlacement","undefined","defaultClassName","Feedback","PropTypes","oneOf","string","bool","isRequired","func","_default"],"sources":["../src/choice-input.jsx"],"sourcesContent":["import FormControlLabel from '@mui/material/FormControlLabel';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport Checkbox from '@mui/material/Checkbox';\nimport { Feedback, color, PreviewPrompt } from '@pie-lib/render-ui';\nimport Radio from '@mui/material/Radio';\nimport classNames from 'classnames';\n\nimport FeedbackTick from './feedback-tick';\n\nconst CLASS_NAME = 'multiple-choice-component';\n\nconst Row = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n});\n\nconst CheckboxHolder = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n flex: 1,\n '& .MuiFormControlLabel-root': {\n marginLeft: '-14px', // to be consistent to previous versions before MUI v5 upgrade\n },\n '& label': {\n color: color.text(),\n '& > span': {\n fontSize: 'inherit',\n },\n '& > .MuiButtonBase-root': {\n padding: '12px', // to be consistent to previous versions before MUI v5 upgrade\n },\n },\n});\n\nconst BelowSelectionComponent = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n '& > span': {\n // visually reduce right padding, but maintain accessibility padding for checkbox indicators to be circles\n marginLeft: `-${theme.spacing(1)}`,\n },\n}));\n\nconst SrOnly = styled('span')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport const StyledFormControlLabel = styled(FormControlLabel)({\n '& .MuiFormControlLabel-label': {\n color: `${color.text()} !important`,\n backgroundColor: color.background(),\n letterSpacing: 'normal',\n },\n '&.Mui-disabled *': {\n cursor: 'not-allowed !important',\n },\n});\n\nconst colorStyle = (varName, fallback) => ({\n [`&.${CLASS_NAME}`]: {\n color: `var(--choice-input-${varName}, ${fallback}) !important`,\n },\n});\n\nconst getInputStyles = (correctness) => {\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [key('root')]: {\n ...colorStyle('color', color.text()),\n ...(correctness ? {} : {\n '&:hover': { color: `${color.primaryLight()} !important` },\n }),\n ...(correctness === 'correct' ? colorStyle('correct-color', color.text()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-color', color.incorrect()) : {}),\n },\n [key('checked')]: {\n ...(correctness === 'correct' ? colorStyle('correct-selected-color', color.correct()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-checked', color.incorrect()) : {}),\n ...(!correctness ? colorStyle('selected-color', color.primary()) : {}),\n },\n [key('disabled')]: {\n ...colorStyle('disabled-color', color.text()),\n ...(correctness === 'correct' ? colorStyle('correct-disabled-color', color.disabled()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-disabled-color', color.disabled()) : {}),\n opacity: 0.6,\n cursor: 'not-allowed !important',\n pointerEvents: 'initial !important',\n },\n focusVisibleUnchecked: {\n outline: `2px solid ${color.focusUncheckedBorder()}`,\n backgroundColor: color.focusUnchecked(),\n },\n focusVisibleChecked: {\n outline: `2px solid ${color.focusCheckedBorder()}`,\n backgroundColor: color.focusChecked(),\n },\n };\n};\n\nconst StyledCheckboxBase = styled(Checkbox, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledCheckbox = (props) => {\n const { correctness, checked, onChange, disabled, value, id, onKeyDown, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledCheckboxBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n onKeyDown={onKeyDown}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n />\n );\n};\n\nconst StyledRadioBase = styled(Radio, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledRadio = (props) => {\n const { correctness, checked, onChange, disabled, value, id, tagName, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledRadioBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n name={tagName}\n />\n );\n};\n\nexport class ChoiceInput extends React.Component {\n static propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n displayKey: PropTypes.string,\n checked: PropTypes.bool.isRequired,\n correctness: PropTypes.string,\n disabled: PropTypes.bool.isRequired,\n feedback: PropTypes.string,\n label: PropTypes.string.isRequired,\n rationale: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n className: PropTypes.string,\n tagName: PropTypes.string,\n hideTick: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n isSelectionButtonBelow: PropTypes.bool,\n };\n\n static defaultProps = {\n rationale: null,\n checked: false,\n isEvaluateMode: false,\n };\n\n constructor(props) {\n super(props);\n this.onToggleChoice = this.onToggleChoice.bind(this);\n this.choiceId = this.generateChoiceId();\n this.descId = `${this.choiceId}-desc`;\n }\n\n onToggleChoice(event) {\n this.props.onChange(event);\n }\n\n generateChoiceId() {\n return 'choice-' + (Math.random() * 10000).toFixed();\n }\n\n handleKeyDown = (event) => {\n const { choiceMode } = this.props;\n\n if (choiceMode !== 'checkbox') return;\n\n const isArrowDown = event.key === 'ArrowDown';\n const isArrowUp = event.key === 'ArrowUp';\n\n if (!isArrowDown && !isArrowUp) return;\n\n event.preventDefault();\n\n const currentEl = document.getElementById(this.choiceId);\n if (!currentEl) return;\n\n const fieldset = currentEl.closest('fieldset');\n if (!fieldset) return;\n\n const groupCheckboxes = Array.from(fieldset.querySelectorAll('input[type=\"checkbox\"]'));\n\n const currentIndex = groupCheckboxes.findIndex((el) => el === currentEl);\n if (currentIndex === -1) return;\n\n const nextIndex = isArrowDown ? currentIndex + 1 : currentIndex - 1;\n const nextEl = groupCheckboxes[nextIndex];\n\n if (nextEl) {\n nextEl.focus();\n }\n };\n\n render() {\n const {\n choiceMode,\n disabled,\n displayKey,\n feedback,\n label,\n correctness,\n className,\n rationale,\n hideTick,\n isEvaluateMode,\n choicesLayout,\n value,\n checked,\n tagName,\n isSelectionButtonBelow,\n } = this.props;\n\n const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;\n const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';\n\n const holderSx = {\n ...(choicesLayout === 'horizontal' && {\n [`& .${CLASS_NAME}`]: {\n padding: '8px',\n margin: '4px 0 4px 4px',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout !== 'grid' && {\n '& > label': {\n alignItems: 'flex-start',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout === 'grid' && {\n justifyContent: 'center',\n '& > label': {\n alignItems: 'center',\n },\n }),\n };\n\n const hasMathOrImage =\n typeof label === 'string' &&\n (label.includes('<math') ||\n label.includes('\\\\(') ||\n label.includes('\\\\[') ||\n label.includes('<img') ||\n label.includes('data-latex') ||\n label.includes('data-raw') ||\n label.includes('<mjx-container'));\n\n const screenReaderLabel = displayKey ? (\n <SrOnly id={this.descId}>\n {hasMathOrImage ? `Pick the answer below, ${displayKey}` : displayKey}\n </SrOnly>\n ) : null;\n\n const choicelabel = (\n <>\n {displayKey && !isSelectionButtonBelow ? (\n <Row component=\"span\">\n <span aria-hidden=\"true\">{displayKey}.{'\\u00A0'}</span>\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n </Row>\n ) : (\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n )}\n </>\n );\n\n const tagProps = {\n disabled,\n checked,\n correctness,\n tagName,\n value,\n id: this.choiceId,\n onChange: this.onToggleChoice,\n onKeyDown: this.handleKeyDown,\n ...(screenReaderLabel ? { 'aria-describedby': this.descId } : {}),\n };\n\n const control = isSelectionButtonBelow ? (\n <BelowSelectionComponent>\n {screenReaderLabel}\n <Tag {...tagProps} style={{ padding: 0 }} />\n <span aria-hidden=\"true\">{displayKey ? `${displayKey}.` : ''}</span>\n </BelowSelectionComponent>\n ) : (\n <>\n {screenReaderLabel}\n <Tag {...tagProps} slotProps={{ input: { ref: this.props.autoFocusRef } }} />\n </>\n );\n\n return (\n <div className={classNames(className, 'corespring-' + classSuffix, 'choice-input')}>\n <Row>\n {!hideTick && isEvaluateMode && <FeedbackTick correctness={correctness} />}\n <CheckboxHolder className=\"checkbox-holder\" sx={holderSx}>\n <StyledFormControlLabel\n label={choicelabel}\n value={value}\n htmlFor={this.choiceId}\n labelPlacement={isSelectionButtonBelow ? 'top' : undefined}\n control={control}\n />\n </CheckboxHolder>\n </Row>\n {rationale && <PreviewPrompt className=\"rationale\" defaultClassName=\"rationale\" prompt={rationale} />}\n <Feedback feedback={feedback} correctness={correctness} />\n </div>\n );\n }\n}\n\nexport default ChoiceInput;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,MAAMU,UAAU,GAAG,2BAA2B;AAE9C,MAAMC,GAAG,GAAG,IAAAC,cAAM,EAACC,YAAG,CAAC,CAAC;EACtBC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC;AACpC,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAG,IAAAP,cAAM,EAACC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,UAAU;EACnCzF,KAAK,EAAEqF,kBAAS,CAACE,MAAM,CAACE,UAAU;EAClC7E,SAAS,EAAEyE,kBAAS,CAACE,MAAM;EAC3BvE,OAAO,EAAEqE,kBAAS,CAACE,MAAM;EACzB/B,QAAQ,EAAE6B,kBAAS,CAACG,IAAI;EACxB/B,cAAc,EAAE4B,kBAAS,CAACG,IAAI;EAC9B9B,aAAa,EAAE2B,kBAAS,CAACC,KAAK,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;EAClE3B,sBAAsB,EAAE0B,kBAAS,CAACG;AACpC,CAAC;AAAA,IAAAlE,gBAAA,CAAAjB,OAAA,EAlBUa,WAAW,kBAoBA;EACpBqC,SAAS,EAAE,IAAI;EACfzD,OAAO,EAAE,KAAK;EACd2D,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAkC,QAAA,GAAA7H,OAAA,CAAAuC,OAAA,GAqKYa,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"choice-input.js","names":["_FormControlLabel","_interopRequireDefault","require","_react","_propTypes","_styles","_Box","_Checkbox","_renderUi","_Radio","_classnames","_feedbackTick","CLASS_NAME","Row","styled","Box","display","alignItems","backgroundColor","color","background","CheckboxHolder","flex","marginLeft","text","fontSize","padding","BelowSelectionComponent","theme","spacing","SrOnly","position","left","top","width","height","overflow","StyledFormControlLabel","exports","FormControlLabel","letterSpacing","cursor","colorStyle","varName","fallback","getInputStyles","correctness","key","k","primaryLight","incorrect","correct","primary","disabled","opacity","pointerEvents","focusVisibleUnchecked","outline","focusUncheckedBorder","focusUnchecked","focusVisibleChecked","focusCheckedBorder","focusChecked","StyledCheckboxBase","Checkbox","shouldForwardProp","prop","styles","StyledCheckbox","props","checked","onChange","value","id","onKeyDown","inputRef","miniProps","default","createElement","_extends2","slotProps","input","ref","disableRipple","className","StyledRadioBase","Radio","StyledRadio","tagName","name","ChoiceInput","React","Component","constructor","_defineProperty2","event","choiceMode","isArrowDown","isArrowUp","preventDefault","currentEl","document","getElementById","choiceId","fieldset","closest","groupCheckboxes","Array","from","querySelectorAll","currentIndex","findIndex","el","nextIndex","nextEl","focus","onToggleChoice","bind","generateChoiceId","descId","Math","random","toFixed","render","displayKey","feedback","label","rationale","hideTick","isEvaluateMode","choicesLayout","isSelectionButtonBelow","Tag","classSuffix","holderSx","margin","justifyContent","hasMathOrImage","includes","screenReaderLabel","choicelabel","Fragment","component","PreviewPrompt","prompt","tagProps","handleKeyDown","control","style","classNames","sx","htmlFor","labelPlacement","undefined","defaultClassName","Feedback","PropTypes","oneOf","string","bool","isRequired","func","_default"],"sources":["../src/choice-input.jsx"],"sourcesContent":["import FormControlLabel from '@mui/material/FormControlLabel';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport Checkbox from '@mui/material/Checkbox';\nimport { Feedback, color, PreviewPrompt } from '@pie-lib/render-ui';\nimport Radio from '@mui/material/Radio';\nimport classNames from 'classnames';\n\nimport FeedbackTick from './feedback-tick';\n\nconst CLASS_NAME = 'multiple-choice-component';\n\nconst Row = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n});\n\nconst CheckboxHolder = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n flex: 1,\n '& .MuiFormControlLabel-root': {\n marginLeft: '-14px', // to be consistent to previous versions before MUI v5 upgrade\n },\n '& label': {\n color: color.text(),\n '& > span': {\n fontSize: 'inherit',\n },\n '& > .MuiButtonBase-root': {\n padding: '12px', // to be consistent to previous versions before MUI v5 upgrade\n },\n },\n});\n\nconst BelowSelectionComponent = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n '& > span': {\n // visually reduce right padding, but maintain accessibility padding for checkbox indicators to be circles\n marginLeft: `-${theme.spacing(1)}`,\n },\n}));\n\nconst SrOnly = styled('span')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport const StyledFormControlLabel = styled(FormControlLabel)({\n '& .MuiFormControlLabel-label': {\n color: `${color.text()} !important`,\n backgroundColor: color.background(),\n letterSpacing: 'normal',\n },\n '&.Mui-disabled *': {\n cursor: 'not-allowed !important',\n },\n});\n\nconst colorStyle = (varName, fallback) => ({\n [`&.${CLASS_NAME}`]: {\n color: `var(--choice-input-${varName}, ${fallback}) !important`,\n },\n});\n\nconst getInputStyles = (correctness) => {\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [key('root')]: {\n ...colorStyle('color', color.text()),\n ...(correctness ? {} : {\n '&:hover': { color: `${color.primaryLight()} !important` },\n }),\n ...(correctness === 'correct' ? colorStyle('correct-color', color.text()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-color', color.incorrect()) : {}),\n },\n [key('checked')]: {\n ...(correctness === 'correct' ? colorStyle('correct-selected-color', color.correct()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-checked', color.incorrect()) : {}),\n ...(!correctness ? colorStyle('selected-color', color.primary()) : {}),\n },\n [key('disabled')]: {\n ...colorStyle('disabled-color', color.text()),\n ...(correctness === 'correct' ? colorStyle('correct-disabled-color', color.disabled()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-disabled-color', color.disabled()) : {}),\n opacity: 0.6,\n cursor: 'not-allowed !important',\n pointerEvents: 'initial !important',\n },\n focusVisibleUnchecked: {\n outline: `2px solid ${color.focusUncheckedBorder()}`,\n backgroundColor: color.focusUnchecked(),\n },\n focusVisibleChecked: {\n outline: `2px solid ${color.focusCheckedBorder()}`,\n backgroundColor: color.focusChecked(),\n },\n };\n};\n\nconst StyledCheckboxBase = styled(Checkbox, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledCheckbox = (props) => {\n const { correctness, checked, onChange, disabled, value, id, onKeyDown, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledCheckboxBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n onKeyDown={onKeyDown}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n />\n );\n};\n\nconst StyledRadioBase = styled(Radio, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledRadio = (props) => {\n const { correctness, checked, onChange, disabled, value, id, tagName, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledRadioBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n name={tagName}\n />\n );\n};\n\nexport class ChoiceInput extends React.Component {\n static propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n displayKey: PropTypes.string,\n checked: PropTypes.bool.isRequired,\n correctness: PropTypes.string,\n disabled: PropTypes.bool.isRequired,\n feedback: PropTypes.string,\n label: PropTypes.string.isRequired,\n rationale: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n className: PropTypes.string,\n tagName: PropTypes.string,\n hideTick: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n isSelectionButtonBelow: PropTypes.bool,\n };\n\n static defaultProps = {\n rationale: null,\n checked: false,\n isEvaluateMode: false,\n };\n\n constructor(props) {\n super(props);\n this.onToggleChoice = this.onToggleChoice.bind(this);\n this.choiceId = this.generateChoiceId();\n this.descId = `${this.choiceId}-desc`;\n }\n\n onToggleChoice(event) {\n this.props.onChange(event);\n }\n\n generateChoiceId() {\n return 'choice-' + (Math.random() * 10000).toFixed();\n }\n\n handleKeyDown = (event) => {\n const { choiceMode } = this.props;\n\n if (choiceMode !== 'checkbox') return;\n\n const isArrowDown = event.key === 'ArrowDown';\n const isArrowUp = event.key === 'ArrowUp';\n\n if (!isArrowDown && !isArrowUp) return;\n\n event.preventDefault();\n\n const currentEl = document.getElementById(this.choiceId);\n if (!currentEl) return;\n\n const fieldset = currentEl.closest('fieldset');\n if (!fieldset) return;\n\n const groupCheckboxes = Array.from(fieldset.querySelectorAll('input[type=\"checkbox\"]'));\n\n const currentIndex = groupCheckboxes.findIndex((el) => el === currentEl);\n if (currentIndex === -1) return;\n\n const nextIndex = isArrowDown ? currentIndex + 1 : currentIndex - 1;\n const nextEl = groupCheckboxes[nextIndex];\n\n if (nextEl) {\n nextEl.focus();\n }\n };\n\n render() {\n const {\n choiceMode,\n disabled,\n displayKey,\n feedback,\n label,\n correctness,\n className,\n rationale,\n hideTick,\n isEvaluateMode,\n choicesLayout,\n value,\n checked,\n tagName,\n isSelectionButtonBelow,\n } = this.props;\n\n const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;\n const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';\n\n const holderSx = {\n ...(choicesLayout === 'horizontal' && {\n [`& .${CLASS_NAME}`]: {\n padding: '8px',\n margin: '4px 0 4px 4px',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout !== 'grid' && {\n '& > label': {\n alignItems: 'flex-start',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout === 'grid' && {\n justifyContent: 'center',\n '& > label': {\n alignItems: 'center',\n },\n }),\n };\n\n const hasMathOrImage =\n typeof label === 'string' &&\n (label.includes('<math') ||\n label.includes('\\\\(') ||\n label.includes('\\\\[') ||\n label.includes('<img') ||\n label.includes('data-latex') ||\n label.includes('data-raw') ||\n label.includes('<mjx-container'));\n\n const screenReaderLabel = displayKey ? (\n <SrOnly id={this.descId}>\n {hasMathOrImage ? `Pick the answer below, ${displayKey}` : displayKey}\n </SrOnly>\n ) : null;\n\n const choicelabel = (\n <>\n {displayKey && !isSelectionButtonBelow ? (\n <Row component=\"span\">\n <span aria-hidden=\"true\">{displayKey}.{'\\u00A0'}</span>\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n </Row>\n ) : (\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n )}\n </>\n );\n\n const tagProps = {\n disabled,\n checked,\n correctness,\n tagName,\n value,\n id: this.choiceId,\n onChange: this.onToggleChoice,\n onKeyDown: this.handleKeyDown,\n ...(screenReaderLabel ? { 'aria-describedby': this.descId } : {}),\n };\n\n const control = isSelectionButtonBelow ? (\n <BelowSelectionComponent>\n {screenReaderLabel}\n <Tag {...tagProps} style={{ padding: 0 }} />\n <span aria-hidden=\"true\">{displayKey ? `${displayKey}.` : ''}</span>\n </BelowSelectionComponent>\n ) : (\n <>\n {screenReaderLabel}\n <Tag {...tagProps} />\n </>\n );\n\n return (\n <div className={classNames(className, 'corespring-' + classSuffix, 'choice-input')}>\n <Row>\n {!hideTick && isEvaluateMode && <FeedbackTick correctness={correctness} />}\n <CheckboxHolder className=\"checkbox-holder\" sx={holderSx}>\n <StyledFormControlLabel\n label={choicelabel}\n value={value}\n htmlFor={this.choiceId}\n labelPlacement={isSelectionButtonBelow ? 'top' : undefined}\n control={control}\n />\n </CheckboxHolder>\n </Row>\n {rationale && <PreviewPrompt className=\"rationale\" defaultClassName=\"rationale\" prompt={rationale} />}\n <Feedback feedback={feedback} correctness={correctness} />\n </div>\n );\n }\n}\n\nexport default ChoiceInput;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,MAAMU,UAAU,GAAG,2BAA2B;AAE9C,MAAMC,GAAG,GAAG,IAAAC,cAAM,EAACC,YAAG,CAAC,CAAC;EACtBC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC;AACpC,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAG,IAAAP,cAAM,EAACC,YAAG,CAAC,CAAC;EACjCC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC,CAAC;EACnCE,IAAI,EAAE,CAAC;EACP,6BAA6B,EAAE;IAC7BC,UAAU,EAAE,OAAO,CAAE;EACvB,CAAC;EACD,SAAS,EAAE;IACTJ,KAAK,EAAEA,eAAK,CAACK,IAAI,CAAC,CAAC;IACnB,UAAU,EAAE;MACVC,QAAQ,EAAE;IACZ,CAAC;IACD,yBAAyB,EAAE;MACzBC,OAAO,EAAE,MAAM,CAAE;IACnB;EACF;AACF,CAAC,CAAC;AAEF,MAAMC,uBAAuB,GAAG,IAAAb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a,WAAW","ignoreList":[]}
|
package/lib/choice.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.Choice = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -84,7 +83,6 @@ class Choice extends _react.default.Component {
|
|
|
84
83
|
hoverAnswerBackgroundColor,
|
|
85
84
|
hoverAnswerStrokeColor,
|
|
86
85
|
hoverAnswerStrokeWidth,
|
|
87
|
-
autoFocusRef,
|
|
88
86
|
tagName
|
|
89
87
|
} = this.props;
|
|
90
88
|
const {
|
|
@@ -162,9 +160,7 @@ class Choice extends _react.default.Component {
|
|
|
162
160
|
component: "div",
|
|
163
161
|
noBorder: noBorder,
|
|
164
162
|
horizontalLayout: horizontalLayout
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(_choiceInput.default,
|
|
166
|
-
autoFocusRef: autoFocusRef
|
|
167
|
-
}))));
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_choiceInput.default, choiceProps)));
|
|
168
164
|
}
|
|
169
165
|
}
|
|
170
166
|
exports.Choice = Choice;
|
|
@@ -190,8 +186,7 @@ Choice.propTypes = {
|
|
|
190
186
|
hoverAnswerStrokeColor: _propTypes.default.string,
|
|
191
187
|
hoverAnswerStrokeWidth: _propTypes.default.string,
|
|
192
188
|
tagName: _propTypes.default.string,
|
|
193
|
-
isSelectionButtonBelow: _propTypes.default.bool
|
|
194
|
-
autoFocusRef: _propTypes.default.object
|
|
189
|
+
isSelectionButtonBelow: _propTypes.default.bool
|
|
195
190
|
};
|
|
196
191
|
var _default = exports.default = Choice;
|
|
197
192
|
//# sourceMappingURL=choice.js.map
|