@pie-element/multi-trait-rubric 1.4.3-next.133 → 1.4.3-next.1335
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 +224 -0
- package/configure/CHANGELOG.md +193 -0
- package/configure/lib/common.js +51 -11
- package/configure/lib/common.js.map +1 -1
- package/configure/lib/defaults.js +5 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +18 -4
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +53 -36
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/modals.js +1 -1
- package/configure/lib/modals.js.map +1 -1
- package/configure/lib/scale.js +11 -4
- package/configure/lib/scale.js.map +1 -1
- package/configure/lib/trait.js +17 -7
- package/configure/lib/trait.js.map +1 -1
- package/configure/lib/traitsHeader.js +12 -5
- package/configure/lib/traitsHeader.js.map +1 -1
- package/configure/package.json +7 -7
- package/controller/CHANGELOG.md +16 -0
- package/controller/lib/index.js +5 -3
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +17 -1
- package/docs/config-schema.json.md +13 -1
- package/docs/pie-schema.json +7 -1
- package/docs/pie-schema.json.md +4 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +1 -1
- package/lib/main.js.map +1 -1
- package/lib/scale.js +1 -1
- package/lib/scale.js.map +1 -1
- package/lib/trait.js.map +1 -1
- package/package.json +3 -3
package/configure/lib/scale.js
CHANGED
|
@@ -47,7 +47,7 @@ var _modals = require("./modals");
|
|
|
47
47
|
|
|
48
48
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
49
49
|
|
|
50
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
50
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
51
|
|
|
52
52
|
var AdjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
53
53
|
|
|
@@ -342,7 +342,9 @@ var Scale = /*#__PURE__*/function (_React$Component) {
|
|
|
342
342
|
showLevelTagInput = _ref15.showLevelTagInput,
|
|
343
343
|
showScorePointLabels = _ref15.showScorePointLabels,
|
|
344
344
|
enableDragAndDrop = _ref15.enableDragAndDrop,
|
|
345
|
-
|
|
345
|
+
spellCheck = _ref15.spellCheck,
|
|
346
|
+
width = _ref15.width,
|
|
347
|
+
uploadSoundSupport = _ref15.uploadSoundSupport;
|
|
346
348
|
|
|
347
349
|
var _ref16 = scale || {},
|
|
348
350
|
maxPoints = _ref16.maxPoints,
|
|
@@ -398,7 +400,9 @@ var Scale = /*#__PURE__*/function (_React$Component) {
|
|
|
398
400
|
scaleIndex: scaleIndex,
|
|
399
401
|
showDeleteScaleModal: this.showDeleteScaleModal,
|
|
400
402
|
currentPosition: currentPosition,
|
|
401
|
-
secondaryBlockWidth: secondaryBlockWidth
|
|
403
|
+
secondaryBlockWidth: secondaryBlockWidth,
|
|
404
|
+
spellCheck: spellCheck,
|
|
405
|
+
uploadSoundSupport: uploadSoundSupport
|
|
402
406
|
}), traits.map(function (trait, index) {
|
|
403
407
|
return /*#__PURE__*/_react["default"].createElement(_trait["default"], {
|
|
404
408
|
key: index,
|
|
@@ -417,7 +421,9 @@ var Scale = /*#__PURE__*/function (_React$Component) {
|
|
|
417
421
|
showDescription: showDescription,
|
|
418
422
|
currentPosition: currentPosition,
|
|
419
423
|
enableDragAndDrop: enableDragAndDrop,
|
|
420
|
-
secondaryBlockWidth: secondaryBlockWidth
|
|
424
|
+
secondaryBlockWidth: secondaryBlockWidth,
|
|
425
|
+
spellCheck: spellCheck,
|
|
426
|
+
uploadSoundSupport: uploadSoundSupport
|
|
421
427
|
});
|
|
422
428
|
}), /*#__PURE__*/_react["default"].createElement(_common.Arrow, {
|
|
423
429
|
width: "".concat(AdjustedBlockWidth / 2, "px"),
|
|
@@ -477,6 +483,7 @@ Scale.propTypes = {
|
|
|
477
483
|
showStandards: _propTypes["default"].bool,
|
|
478
484
|
showLevelTagInput: _propTypes["default"].bool,
|
|
479
485
|
showDescription: _propTypes["default"].bool,
|
|
486
|
+
uploadSoundSupport: _propTypes["default"].object,
|
|
480
487
|
showScorePointLabels: _propTypes["default"].bool,
|
|
481
488
|
enableDragAndDrop: _propTypes["default"].bool
|
|
482
489
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/scale.jsx"],"names":["AdjustedBlockWidth","BlockWidth","styles","scaleWrapper","display","flexDirection","margin","wordBreak","padding","DragHandleSpace","position","maxPoints","width","trait","background","color","secondaryBackground","Scale","showDecreaseMaxPointsDialog","showDeleteScaleDialog","showDeleteTraitDialog","currentPosition","showRight","showLeft","newState","setState","target","props","scale","scaleIndex","onScaleChanged","scorePointsLabels","traits","numberValue","parseInt","value","secondaryBlockRef","scrollWidth","offsetWidth","showDecreaseMaxPointsModal","newMaxPoints","i","push","forEach","index","scorePointsDescriptors","set","undefined","state","hideDecreaseMaxPointsModal","onScaleRemoved","hideDeleteScaleModal","traitToDeleteIndex","length","slice","hideDeleteTraitModal","name","description","standards","Array","from","traitIndex","source","newIndex","oldIndex","cup","remainingTraits","filter","item","newTraits","decreasedPosition","increasedPosition","nextProps","excludeZero","showStandards","showDescription","classes","showLevelTagInput","showScorePointLabels","enableDragAndDrop","traitLabel","scorePointsValues","secondaryBlockWidth","PrimaryBlockWidth","pointValue","ref","params","label","updateMaxPointsFieldValue","showDeleteScaleModal","map","showDeleteTraitModal","onTraitChanged","onTraitDropped","decreasePosition","increasePosition","onTraitAdded","__html","changeMaxPoints","deleteScale","onTraitRemoved","React","Component","propTypes","PropTypes","object","shape","number","arrayOf","string","bool","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AAOA;;;;;;AAMA,IAAMA,kBAAkB,GAAGC,qBAAc,IAAI,CAA7C,C,CAAiD;;AAEjD,IAAMC,MAAM,GAAG;AACbC,EAAAA,YAAY,EAAE;AACZC,IAAAA,OAAO,EAAE,MADG;AAEZC,IAAAA,aAAa,EAAE,QAFH;AAGZC,IAAAA,MAAM,EAAE,QAHI;AAIZC,IAAAA,SAAS,EAAE,YAJC;AAKZC,IAAAA,OAAO,wBAAiBC,uBAAjB,OALK;AAMZC,IAAAA,QAAQ,EAAE;AANE,GADD;AASbC,EAAAA,SAAS,EAAE;AACTC,IAAAA,KAAK,EAAE,OADE;AAETN,IAAAA,MAAM,EAAE;AAFC,GATE;AAabO,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAEC,gBAAMC,mBAAN,EADP;AAELV,IAAAA,MAAM,EAAE,QAFH;AAGLE,IAAAA,OAAO,EAAE;AAHJ;AAbM,CAAf;;IAoBaS,K;;;;;;;;;;;;;;;8FACH;AACNC,MAAAA,2BAA2B,EAAE,KADvB;AAENC,MAAAA,qBAAqB,EAAE,KAFjB;AAGNC,MAAAA,qBAAqB,EAAE,KAHjB;AAINC,MAAAA,eAAe,EAAE,CAJX;AAKNC,MAAAA,SAAS,EAAE,IALL;AAMNC,MAAAA,QAAQ,EAAE;AANJ,K;4FASF,UAACC,QAAD;AAAA,aAAc,MAAKC,QAAL,CAAcD,QAAd,CAAd;AAAA,K;kHAqBsB,gBAAgB;AAAA,UAAbE,MAAa,QAAbA,MAAa;;AAAA,k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,CAAgB;AACrB/F,IAAAA,SAAS,EAAE6F,sBAAUG,MADA;AAErB5E,IAAAA,iBAAiB,EAAEyE,sBAAUI,OAAV,CAAkBJ,sBAAUK,MAA5B,CAFE;AAGrB7B,IAAAA,UAAU,EAAEwB,sBAAUK,MAHD;AAIrB7E,IAAAA,MAAM,EAAEwE,sBAAUI,OAAV,CAAkBJ,sBAAUE,KAAV,CAAgB;AACxClD,MAAAA,IAAI,EAAEgD,sBAAUK,MADwB;AAExCnD,MAAAA,SAAS,EAAE8C,sBAAUI,OAAV,CAAkBJ,sBAAUK,MAA5B,CAF6B;AAGxChE,MAAAA,sBAAsB,EAAE2D,sBAAUI,OAAV,CAAkBJ,sBAAUK,MAA5B,CAHgB;AAIxCpD,MAAAA,WAAW,EAAE+C,sBAAUK;AAJiB,KAAhB,CAAlB;AAJa,GAAhB,CAFS;AAahBjG,EAAAA,KAAK,EAAE4F,sBAAUK,MAbD;AAchBpC,EAAAA,WAAW,EAAE+B,sBAAUM,IAdP;AAehBjF,EAAAA,UAAU,EAAE2E,sBAAUG,MAfN;AAgBhB7E,EAAAA,cAAc,EAAE0E,sBAAUO,IAhBV;AAiBhB7D,EAAAA,cAAc,EAAEsD,sBAAUO,IAjBV;AAkBhBrC,EAAAA,aAAa,EAAE8B,sBAAUM,IAlBT;AAmBhBjC,EAAAA,iBAAiB,EAAE2B,sBAAUM,IAnBb;AAoBhBnC,EAAAA,eAAe,EAAE6B,sBAAUM,IApBX;AAqBhBhC,EAAAA,oBAAoB,EAAE0B,sBAAUM,IArBhB;AAsBhB/B,EAAAA,iBAAiB,EAAEyB,sBAAUM;AAtBb,CAAlB;;eAyBe,2BAAgB,wBAAW5G,MAAX,EAAmBe,KAAnB,CAAhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';\nimport ArrowForwardIosIcon from '@material-ui/icons/ArrowForwardIos';\n\nimport { withDragContext } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nimport TraitsHeader from './traitsHeader';\nimport TraitTile from './trait';\nimport {\n Arrow,\n BlockWidth,\n DragHandleSpace,\n MultiTraitButton,\n PrimaryBlockWidth\n} from './common';\nimport {\n DecreaseMaxPoints,\n DeleteScale,\n DeleteTrait,\n} from './modals';\n\nconst AdjustedBlockWidth = BlockWidth + (2 * 8); // 8 is padding\n\nconst styles = {\n scaleWrapper: {\n display: 'flex',\n flexDirection: 'column',\n margin: '12px 0',\n wordBreak: 'break-word',\n padding: `16px 0 16px ${DragHandleSpace}px`,\n position: 'relative'\n },\n maxPoints: {\n width: '300px',\n margin: '16px 0 32px'\n },\n trait: {\n background: color.secondaryBackground(),\n margin: '16px 0',\n padding: '16px'\n }\n};\n\nexport class Scale extends React.Component {\n state = {\n showDecreaseMaxPointsDialog: false,\n showDeleteScaleDialog: false,\n showDeleteTraitDialog: false,\n currentPosition: 0,\n showRight: null,\n showLeft: null\n };\n\n set = (newState) => this.setState(newState);\n\n componentDidMount() {\n if (this.state.showRight === null && this.secondaryBlockRef) {\n this.setState({ showRight: this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth });\n }\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.excludeZero !== this.props.excludeZero ||\n nextProps.showStandards !== this.props.showStandards ||\n nextProps.showDescription !== this.props.showDescription) {\n this.setState({\n currentPosition: 0,\n showLeft: false,\n showRight: this.secondaryBlockRef && this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth\n });\n }\n }\n\n // Max Points\n updateMaxPointsFieldValue = ({ target }) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { maxPoints, scorePointsLabels, traits } = scale;\n\n const numberValue = parseInt(target.value, 10);\n\n this.setState({\n currentPosition: 0,\n showLeft: false,\n showRight: this.secondaryBlockRef && this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth\n });\n\n if (numberValue < maxPoints) {\n this.showDecreaseMaxPointsModal({ newMaxPoints: numberValue });\n } else {\n for (let i = 0; i <= numberValue; i++) {\n if (!scorePointsLabels[i]) {\n scorePointsLabels.push('');\n }\n\n traits.forEach((trait, index) => {\n if (!traits[index].scorePointsDescriptors[i]) {\n traits[index].scorePointsDescriptors.push('');\n }\n });\n\n }\n\n onScaleChanged(scaleIndex, { maxPoints: numberValue, scorePointsLabels, traits })\n }\n }\n\n showDecreaseMaxPointsModal = ({ newMaxPoints }) => this.set({ showDecreaseMaxPointsDialog: true, newMaxPoints });\n\n hideDecreaseMaxPointsModal = () => this.set({ showDecreaseMaxPointsDialog: false, newMaxPoints: undefined });\n\n changeMaxPoints = () => {\n const { newMaxPoints } = this.state || {};\n const { scaleIndex, onScaleChanged } = this.props || {};\n\n if (newMaxPoints) {\n onScaleChanged(scaleIndex, { maxPoints: newMaxPoints });\n }\n\n this.hideDecreaseMaxPointsModal();\n }\n\n // Delete Scale\n showDeleteScaleModal = () => this.set({ showDeleteScaleDialog: true });\n\n hideDeleteScaleModal = () => this.set({ showDeleteScaleDialog: false });\n\n deleteScale = () => {\n const { scaleIndex, onScaleRemoved } = this.props || {};\n\n this.hideDeleteScaleModal();\n\n onScaleRemoved(scaleIndex);\n }\n\n // Delete Trait\n showDeleteTraitModal = (traitToDeleteIndex) => this.set({ showDeleteTraitDialog: true, traitToDeleteIndex });\n\n hideDeleteTraitModal = () => this.set({ showDeleteTraitDialog: false, traitToDeleteIndex: undefined });\n\n onTraitRemoved = () => {\n const { traitToDeleteIndex } = this.state;\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n let { traits } = scale || {};\n\n if (traitToDeleteIndex < 0 || traitToDeleteIndex >= traits.length) return;\n\n traits = [\n ...traits.slice(0, traitToDeleteIndex),\n ...traits.slice(traitToDeleteIndex + 1)\n ];\n\n onScaleChanged(scaleIndex, { traits });\n\n this.hideDeleteTraitModal();\n }\n\n onTraitAdded = () => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits, scorePointsLabels } = scale || {};\n\n traits.push({\n name: '',\n description: '',\n standards: [],\n scorePointsDescriptors: Array.from(\n { length: scorePointsLabels.length },\n () => ''\n ),\n });\n\n onScaleChanged(scaleIndex, { traits });\n }\n\n onTraitChanged = (traitIndex, trait) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits } = scale || {};\n\n if (traitIndex >= 0 && traitIndex < traits.length) {\n traits[traitIndex] = trait;\n\n onScaleChanged(scaleIndex, { traits });\n }\n }\n\n onTraitDropped = (source, newIndex) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits } = scale || {};\n const { index: oldIndex } = source;\n const cup = traits[oldIndex];\n\n const remainingTraits = traits.filter((item, index) => index !== oldIndex);\n\n const newTraits = [\n ...remainingTraits.slice(0, newIndex),\n cup,\n ...remainingTraits.slice(newIndex),\n ];\n\n onScaleChanged(scaleIndex, { traits: newTraits });\n }\n\n decreasePosition = () => {\n const { currentPosition } = this.state;\n const decreasedPosition = currentPosition - (currentPosition === AdjustedBlockWidth / 2 ? AdjustedBlockWidth / 2 : AdjustedBlockWidth);\n\n this.setState({\n currentPosition: decreasedPosition,\n showRight: decreasedPosition < this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth,\n showLeft: decreasedPosition > 0\n });\n }\n\n increasePosition = () => {\n const { currentPosition } = this.state;\n const increasedPosition = currentPosition + (currentPosition === 0 ? AdjustedBlockWidth / 2 : AdjustedBlockWidth);\n\n this.setState({\n currentPosition: increasedPosition,\n showRight: increasedPosition < this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth,\n showLeft: increasedPosition > 0\n });\n }\n\n render() {\n const {\n classes,\n scale,\n scaleIndex,\n showStandards,\n onScaleChanged,\n excludeZero,\n showDescription,\n showLevelTagInput,\n showScorePointLabels,\n enableDragAndDrop,\n width\n } = this.props || {};\n const {\n maxPoints,\n scorePointsLabels,\n traitLabel,\n traits\n } = scale || {};\n\n const {\n showDecreaseMaxPointsDialog,\n showDeleteScaleDialog,\n showDeleteTraitDialog,\n currentPosition,\n showRight,\n showLeft\n } = this.state;\n\n const scorePointsValues = [];\n const secondaryBlockWidth = (parseInt(width) - DragHandleSpace - PrimaryBlockWidth) || 320; // 320 is minWidth\n\n // determining the score points values\n for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {\n scorePointsValues.push(pointValue);\n }\n\n return (\n <div\n key={`scale-${scaleIndex}`}\n className={classes.scaleWrapper}\n ref={ref => {\n this.scaleWrapper = ref;\n }}\n >\n <TraitsHeader\n setSecondaryBlockRef={ref => {\n if (ref) {\n this.secondaryBlockRef = ref;\n }\n }}\n key={'header-key'}\n traitLabel={traitLabel}\n scorePointsValues={scorePointsValues}\n scorePointsLabels={scorePointsLabels}\n onScaleChange={(params) => onScaleChanged(scaleIndex, params)}\n onTraitLabelChange={label => onScaleChanged(scaleIndex, { traitLabel: label })}\n showStandards={showStandards}\n showDescription={showDescription}\n showLevelTagInput={showLevelTagInput}\n showScorePointLabels={showScorePointLabels}\n maxPoints={maxPoints}\n updateMaxPointsFieldValue={this.updateMaxPointsFieldValue}\n scaleIndex={scaleIndex}\n showDeleteScaleModal={this.showDeleteScaleModal}\n currentPosition={currentPosition}\n secondaryBlockWidth={secondaryBlockWidth}\n />\n\n {traits.map((trait, index) => (\n <TraitTile\n key={index}\n index={index}\n trait={trait}\n scorePointsValues={scorePointsValues}\n scorePointsLabels={scorePointsLabels}\n onTraitRemoved={() => this.showDeleteTraitModal(index)}\n onTraitChanged={trait => this.onTraitChanged(index, trait)}\n onTraitDropped={this.onTraitDropped}\n showStandards={showStandards}\n showDescription={showDescription}\n currentPosition={currentPosition}\n enableDragAndDrop={enableDragAndDrop}\n secondaryBlockWidth={secondaryBlockWidth}\n />\n ))}\n\n <Arrow\n width={`${AdjustedBlockWidth / 2}px`}\n show={showLeft}\n onClick={this.decreasePosition}\n left={`${PrimaryBlockWidth + DragHandleSpace}px`}\n showLevelTagInput={showLevelTagInput}\n >\n <ArrowBackIosIcon/>\n </Arrow>\n <Arrow\n width={`${AdjustedBlockWidth / 2}px`}\n show={showRight}\n onClick={this.increasePosition}\n showLevelTagInput={showLevelTagInput}\n >\n <ArrowForwardIosIcon/>\n </Arrow>\n\n <MultiTraitButton onClick={this.onTraitAdded}>\n <div dangerouslySetInnerHTML={{ __html: `Add ${traitLabel || ' Trait'}` }}/>\n </MultiTraitButton>\n\n <DecreaseMaxPoints\n open={!!showDecreaseMaxPointsDialog}\n deleteScorePoints={this.changeMaxPoints}\n cancel={this.hideDecreaseMaxPointsModal}\n />\n\n <DeleteScale\n open={!!showDeleteScaleDialog}\n scaleIndex={scaleIndex}\n deleteScale={this.deleteScale}\n cancel={this.hideDeleteScaleModal}\n />\n\n <DeleteTrait\n open={!!showDeleteTraitDialog}\n deleteTrait={this.onTraitRemoved}\n cancel={this.hideDeleteTraitModal}\n />\n </div>\n );\n }\n}\n\nScale.propTypes = {\n classes: PropTypes.object,\n scale: PropTypes.shape({\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }))\n }),\n width: PropTypes.string,\n excludeZero: PropTypes.bool,\n scaleIndex: PropTypes.number,\n onScaleChanged: PropTypes.func,\n onScaleRemoved: PropTypes.func,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n showScorePointLabels: PropTypes.bool,\n enableDragAndDrop: PropTypes.bool,\n}\n\nexport default withDragContext(withStyles(styles)(Scale));\n"],"file":"scale.js"}
|
|
1
|
+
{"version":3,"sources":["../src/scale.jsx"],"names":["AdjustedBlockWidth","BlockWidth","styles","scaleWrapper","display","flexDirection","margin","wordBreak","padding","DragHandleSpace","position","maxPoints","width","trait","background","color","secondaryBackground","Scale","showDecreaseMaxPointsDialog","showDeleteScaleDialog","showDeleteTraitDialog","currentPosition","showRight","showLeft","newState","setState","target","props","scale","scaleIndex","onScaleChanged","scorePointsLabels","traits","numberValue","parseInt","value","secondaryBlockRef","scrollWidth","offsetWidth","showDecreaseMaxPointsModal","newMaxPoints","i","push","forEach","index","scorePointsDescriptors","set","undefined","state","hideDecreaseMaxPointsModal","onScaleRemoved","hideDeleteScaleModal","traitToDeleteIndex","length","slice","hideDeleteTraitModal","name","description","standards","Array","from","traitIndex","source","newIndex","oldIndex","cup","remainingTraits","filter","item","newTraits","decreasedPosition","increasedPosition","nextProps","excludeZero","showStandards","showDescription","classes","showLevelTagInput","showScorePointLabels","enableDragAndDrop","spellCheck","uploadSoundSupport","traitLabel","scorePointsValues","secondaryBlockWidth","PrimaryBlockWidth","pointValue","ref","params","label","updateMaxPointsFieldValue","showDeleteScaleModal","map","showDeleteTraitModal","onTraitChanged","onTraitDropped","decreasePosition","increasePosition","onTraitAdded","__html","changeMaxPoints","deleteScale","onTraitRemoved","React","Component","propTypes","PropTypes","object","shape","number","arrayOf","string","bool","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AAOA;;;;;;AAMA,IAAMA,kBAAkB,GAAGC,qBAAc,IAAI,CAA7C,C,CAAiD;;AAEjD,IAAMC,MAAM,GAAG;AACbC,EAAAA,YAAY,EAAE;AACZC,IAAAA,OAAO,EAAE,MADG;AAEZC,IAAAA,aAAa,EAAE,QAFH;AAGZC,IAAAA,MAAM,EAAE,QAHI;AAIZC,IAAAA,SAAS,EAAE,YAJC;AAKZC,IAAAA,OAAO,wBAAiBC,uBAAjB,OALK;AAMZC,IAAAA,QAAQ,EAAE;AANE,GADD;AASbC,EAAAA,SAAS,EAAE;AACTC,IAAAA,KAAK,EAAE,OADE;AAETN,IAAAA,M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AAIxCtD,MAAAA,WAAW,EAAEiD,sBAAUK;AAJiB,KAAhB,CAAlB;AAJa,GAAhB,CAFS;AAahBnG,EAAAA,KAAK,EAAE8F,sBAAUK,MAbD;AAchBtC,EAAAA,WAAW,EAAEiC,sBAAUM,IAdP;AAehBnF,EAAAA,UAAU,EAAE6E,sBAAUG,MAfN;AAgBhB/E,EAAAA,cAAc,EAAE4E,sBAAUO,IAhBV;AAiBhB/D,EAAAA,cAAc,EAAEwD,sBAAUO,IAjBV;AAkBhBvC,EAAAA,aAAa,EAAEgC,sBAAUM,IAlBT;AAmBhBnC,EAAAA,iBAAiB,EAAE6B,sBAAUM,IAnBb;AAoBhBrC,EAAAA,eAAe,EAAE+B,sBAAUM,IApBX;AAqBhB/B,EAAAA,kBAAkB,EAAEyB,sBAAUC,MArBd;AAsBhB7B,EAAAA,oBAAoB,EAAE4B,sBAAUM,IAtBhB;AAuBhBjC,EAAAA,iBAAiB,EAAE2B,sBAAUM;AAvBb,CAAlB;;eA0Be,2BAAgB,wBAAW9G,MAAX,EAAmBe,KAAnB,CAAhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';\nimport ArrowForwardIosIcon from '@material-ui/icons/ArrowForwardIos';\n\nimport { withDragContext } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nimport TraitsHeader from './traitsHeader';\nimport TraitTile from './trait';\nimport {\n Arrow,\n BlockWidth,\n DragHandleSpace,\n MultiTraitButton,\n PrimaryBlockWidth\n} from './common';\nimport {\n DecreaseMaxPoints,\n DeleteScale,\n DeleteTrait,\n} from './modals';\n\nconst AdjustedBlockWidth = BlockWidth + (2 * 8); // 8 is padding\n\nconst styles = {\n scaleWrapper: {\n display: 'flex',\n flexDirection: 'column',\n margin: '12px 0',\n wordBreak: 'break-word',\n padding: `16px 0 16px ${DragHandleSpace}px`,\n position: 'relative'\n },\n maxPoints: {\n width: '300px',\n margin: '16px 0 32px'\n },\n trait: {\n background: color.secondaryBackground(),\n margin: '16px 0',\n padding: '16px'\n }\n};\n\nexport class Scale extends React.Component {\n state = {\n showDecreaseMaxPointsDialog: false,\n showDeleteScaleDialog: false,\n showDeleteTraitDialog: false,\n currentPosition: 0,\n showRight: null,\n showLeft: null\n };\n\n set = (newState) => this.setState(newState);\n\n componentDidMount() {\n if (this.state.showRight === null && this.secondaryBlockRef) {\n this.setState({ showRight: this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth });\n }\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.excludeZero !== this.props.excludeZero ||\n nextProps.showStandards !== this.props.showStandards ||\n nextProps.showDescription !== this.props.showDescription) {\n this.setState({\n currentPosition: 0,\n showLeft: false,\n showRight: this.secondaryBlockRef && this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth\n });\n }\n }\n\n // Max Points\n updateMaxPointsFieldValue = ({ target }) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { maxPoints, scorePointsLabels, traits } = scale;\n\n const numberValue = parseInt(target.value, 10);\n\n this.setState({\n currentPosition: 0,\n showLeft: false,\n showRight: this.secondaryBlockRef && this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth\n });\n\n if (numberValue < maxPoints) {\n this.showDecreaseMaxPointsModal({ newMaxPoints: numberValue });\n } else {\n for (let i = 0; i <= numberValue; i++) {\n if (!scorePointsLabels[i]) {\n scorePointsLabels.push('');\n }\n\n traits.forEach((trait, index) => {\n if (!traits[index].scorePointsDescriptors[i]) {\n traits[index].scorePointsDescriptors.push('');\n }\n });\n\n }\n\n onScaleChanged(scaleIndex, { maxPoints: numberValue, scorePointsLabels, traits })\n }\n }\n\n showDecreaseMaxPointsModal = ({ newMaxPoints }) => this.set({ showDecreaseMaxPointsDialog: true, newMaxPoints });\n\n hideDecreaseMaxPointsModal = () => this.set({ showDecreaseMaxPointsDialog: false, newMaxPoints: undefined });\n\n changeMaxPoints = () => {\n const { newMaxPoints } = this.state || {};\n const { scaleIndex, onScaleChanged } = this.props || {};\n\n if (newMaxPoints) {\n onScaleChanged(scaleIndex, { maxPoints: newMaxPoints });\n }\n\n this.hideDecreaseMaxPointsModal();\n }\n\n // Delete Scale\n showDeleteScaleModal = () => this.set({ showDeleteScaleDialog: true });\n\n hideDeleteScaleModal = () => this.set({ showDeleteScaleDialog: false });\n\n deleteScale = () => {\n const { scaleIndex, onScaleRemoved } = this.props || {};\n\n this.hideDeleteScaleModal();\n\n onScaleRemoved(scaleIndex);\n }\n\n // Delete Trait\n showDeleteTraitModal = (traitToDeleteIndex) => this.set({ showDeleteTraitDialog: true, traitToDeleteIndex });\n\n hideDeleteTraitModal = () => this.set({ showDeleteTraitDialog: false, traitToDeleteIndex: undefined });\n\n onTraitRemoved = () => {\n const { traitToDeleteIndex } = this.state;\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n let { traits } = scale || {};\n\n if (traitToDeleteIndex < 0 || traitToDeleteIndex >= traits.length) return;\n\n traits = [\n ...traits.slice(0, traitToDeleteIndex),\n ...traits.slice(traitToDeleteIndex + 1)\n ];\n\n onScaleChanged(scaleIndex, { traits });\n\n this.hideDeleteTraitModal();\n }\n\n onTraitAdded = () => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits, scorePointsLabels } = scale || {};\n\n traits.push({\n name: '',\n description: '',\n standards: [],\n scorePointsDescriptors: Array.from(\n { length: scorePointsLabels.length },\n () => ''\n ),\n });\n\n onScaleChanged(scaleIndex, { traits });\n }\n\n onTraitChanged = (traitIndex, trait) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits } = scale || {};\n\n if (traitIndex >= 0 && traitIndex < traits.length) {\n traits[traitIndex] = trait;\n\n onScaleChanged(scaleIndex, { traits });\n }\n }\n\n onTraitDropped = (source, newIndex) => {\n const { scale, scaleIndex, onScaleChanged } = this.props || {};\n const { traits } = scale || {};\n const { index: oldIndex } = source;\n const cup = traits[oldIndex];\n\n const remainingTraits = traits.filter((item, index) => index !== oldIndex);\n\n const newTraits = [\n ...remainingTraits.slice(0, newIndex),\n cup,\n ...remainingTraits.slice(newIndex),\n ];\n\n onScaleChanged(scaleIndex, { traits: newTraits });\n }\n\n decreasePosition = () => {\n const { currentPosition } = this.state;\n const decreasedPosition = currentPosition - (currentPosition === AdjustedBlockWidth / 2 ? AdjustedBlockWidth / 2 : AdjustedBlockWidth);\n\n this.setState({\n currentPosition: decreasedPosition,\n showRight: decreasedPosition < this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth,\n showLeft: decreasedPosition > 0\n });\n }\n\n increasePosition = () => {\n const { currentPosition } = this.state;\n const increasedPosition = currentPosition + (currentPosition === 0 ? AdjustedBlockWidth / 2 : AdjustedBlockWidth);\n\n this.setState({\n currentPosition: increasedPosition,\n showRight: increasedPosition < this.secondaryBlockRef.scrollWidth - this.secondaryBlockRef.offsetWidth,\n showLeft: increasedPosition > 0\n });\n }\n\n render() {\n const {\n classes,\n scale,\n scaleIndex,\n showStandards,\n onScaleChanged,\n excludeZero,\n showDescription,\n showLevelTagInput,\n showScorePointLabels,\n enableDragAndDrop,\n spellCheck,\n width,\n uploadSoundSupport\n } = this.props || {};\n\n const {\n maxPoints,\n scorePointsLabels,\n traitLabel,\n traits\n } = scale || {};\n\n const {\n showDecreaseMaxPointsDialog,\n showDeleteScaleDialog,\n showDeleteTraitDialog,\n currentPosition,\n showRight,\n showLeft\n } = this.state;\n\n const scorePointsValues = [];\n const secondaryBlockWidth = (parseInt(width) - DragHandleSpace - PrimaryBlockWidth) || 320; // 320 is minWidth\n\n // determining the score points values\n for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {\n scorePointsValues.push(pointValue);\n }\n\n return (\n <div\n key={`scale-${scaleIndex}`}\n className={classes.scaleWrapper}\n ref={ref => {\n this.scaleWrapper = ref;\n }}\n >\n <TraitsHeader\n setSecondaryBlockRef={ref => {\n if (ref) {\n this.secondaryBlockRef = ref;\n }\n }}\n key={'header-key'}\n traitLabel={traitLabel}\n scorePointsValues={scorePointsValues}\n scorePointsLabels={scorePointsLabels}\n onScaleChange={(params) => onScaleChanged(scaleIndex, params)}\n onTraitLabelChange={label => onScaleChanged(scaleIndex, { traitLabel: label })}\n showStandards={showStandards}\n showDescription={showDescription}\n showLevelTagInput={showLevelTagInput}\n showScorePointLabels={showScorePointLabels}\n maxPoints={maxPoints}\n updateMaxPointsFieldValue={this.updateMaxPointsFieldValue}\n scaleIndex={scaleIndex}\n showDeleteScaleModal={this.showDeleteScaleModal}\n currentPosition={currentPosition}\n secondaryBlockWidth={secondaryBlockWidth}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n\n {traits.map((trait, index) => (\n <TraitTile\n key={index}\n index={index}\n trait={trait}\n scorePointsValues={scorePointsValues}\n scorePointsLabels={scorePointsLabels}\n onTraitRemoved={() => this.showDeleteTraitModal(index)}\n onTraitChanged={trait => this.onTraitChanged(index, trait)}\n onTraitDropped={this.onTraitDropped}\n showStandards={showStandards}\n showDescription={showDescription}\n currentPosition={currentPosition}\n enableDragAndDrop={enableDragAndDrop}\n secondaryBlockWidth={secondaryBlockWidth}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n ))}\n\n <Arrow\n width={`${AdjustedBlockWidth / 2}px`}\n show={showLeft}\n onClick={this.decreasePosition}\n left={`${PrimaryBlockWidth + DragHandleSpace}px`}\n showLevelTagInput={showLevelTagInput}\n >\n <ArrowBackIosIcon/>\n </Arrow>\n <Arrow\n width={`${AdjustedBlockWidth / 2}px`}\n show={showRight}\n onClick={this.increasePosition}\n showLevelTagInput={showLevelTagInput}\n >\n <ArrowForwardIosIcon/>\n </Arrow>\n\n <MultiTraitButton onClick={this.onTraitAdded}>\n <div dangerouslySetInnerHTML={{ __html: `Add ${traitLabel || ' Trait'}` }}/>\n </MultiTraitButton>\n\n <DecreaseMaxPoints\n open={!!showDecreaseMaxPointsDialog}\n deleteScorePoints={this.changeMaxPoints}\n cancel={this.hideDecreaseMaxPointsModal}\n />\n\n <DeleteScale\n open={!!showDeleteScaleDialog}\n scaleIndex={scaleIndex}\n deleteScale={this.deleteScale}\n cancel={this.hideDeleteScaleModal}\n />\n\n <DeleteTrait\n open={!!showDeleteTraitDialog}\n deleteTrait={this.onTraitRemoved}\n cancel={this.hideDeleteTraitModal}\n />\n </div>\n );\n }\n}\n\nScale.propTypes = {\n classes: PropTypes.object,\n scale: PropTypes.shape({\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }))\n }),\n width: PropTypes.string,\n excludeZero: PropTypes.bool,\n scaleIndex: PropTypes.number,\n onScaleChanged: PropTypes.func,\n onScaleRemoved: PropTypes.func,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n uploadSoundSupport: PropTypes.object,\n showScorePointLabels: PropTypes.bool,\n enableDragAndDrop: PropTypes.bool,\n}\n\nexport default withDragContext(withStyles(styles)(Scale));\n"],"file":"scale.js"}
|
package/configure/lib/trait.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] = exports.
|
|
8
|
+
exports["default"] = exports.TraitTile = exports.StyledTrait = void 0;
|
|
9
9
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
@@ -51,7 +51,7 @@ var _DragIndicator = _interopRequireDefault(require("@material-ui/icons/DragIndi
|
|
|
51
51
|
|
|
52
52
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
53
53
|
|
|
54
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
54
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
55
55
|
|
|
56
56
|
var log = (0, _debug["default"])('@pie-element:placement-ordering:configure:trait-tile');
|
|
57
57
|
var styles = {
|
|
@@ -165,7 +165,9 @@ var TraitTile = /*#__PURE__*/function (_React$Component) {
|
|
|
165
165
|
showDescription = _this$props2.showDescription,
|
|
166
166
|
enableDragAndDrop = _this$props2.enableDragAndDrop,
|
|
167
167
|
currentPosition = _this$props2.currentPosition,
|
|
168
|
-
secondaryBlockWidth = _this$props2.secondaryBlockWidth
|
|
168
|
+
secondaryBlockWidth = _this$props2.secondaryBlockWidth,
|
|
169
|
+
spellCheck = _this$props2.spellCheck,
|
|
170
|
+
uploadSoundSupport = _this$props2.uploadSoundSupport;
|
|
169
171
|
var anchorEl = this.state.anchorEl;
|
|
170
172
|
var pluginProps = {
|
|
171
173
|
image: {
|
|
@@ -207,7 +209,9 @@ var TraitTile = /*#__PURE__*/function (_React$Component) {
|
|
|
207
209
|
});
|
|
208
210
|
},
|
|
209
211
|
pluginProps: _utils.labelPlugins,
|
|
210
|
-
placeholder: "Enter Trait"
|
|
212
|
+
placeholder: "Enter Trait",
|
|
213
|
+
spellCheck: spellCheck,
|
|
214
|
+
uploadSoundSupport: uploadSoundSupport
|
|
211
215
|
})), /*#__PURE__*/_react["default"].createElement(_common.SecondaryBlock, {
|
|
212
216
|
setRef: function setRef(ref) {
|
|
213
217
|
_this2.secondaryBlock = ref;
|
|
@@ -221,7 +225,9 @@ var TraitTile = /*#__PURE__*/function (_React$Component) {
|
|
|
221
225
|
standards: standards.split(',')
|
|
222
226
|
});
|
|
223
227
|
},
|
|
224
|
-
pluginProps: pluginProps
|
|
228
|
+
pluginProps: pluginProps,
|
|
229
|
+
spellCheck: spellCheck,
|
|
230
|
+
uploadSoundSupport: uploadSoundSupport
|
|
225
231
|
})), showDescription && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement(_common.ExpandedInput, {
|
|
226
232
|
placeholder: "Description",
|
|
227
233
|
markup: description,
|
|
@@ -230,7 +236,9 @@ var TraitTile = /*#__PURE__*/function (_React$Component) {
|
|
|
230
236
|
description: description
|
|
231
237
|
});
|
|
232
238
|
},
|
|
233
|
-
pluginProps: pluginProps
|
|
239
|
+
pluginProps: pluginProps,
|
|
240
|
+
spellCheck: spellCheck,
|
|
241
|
+
uploadSoundSupport: uploadSoundSupport
|
|
234
242
|
})), (scorePointsValues || []).map(function (scorePointsValue, index) {
|
|
235
243
|
var adjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
236
244
|
|
|
@@ -257,7 +265,9 @@ var TraitTile = /*#__PURE__*/function (_React$Component) {
|
|
|
257
265
|
},
|
|
258
266
|
pluginProps: pluginProps,
|
|
259
267
|
alignToRight: remainingSpace < 296 // 296 is the space required for the toolbar
|
|
260
|
-
|
|
268
|
+
,
|
|
269
|
+
spellCheck: spellCheck,
|
|
270
|
+
uploadSoundSupport: uploadSoundSupport
|
|
261
271
|
}));
|
|
262
272
|
}))))));
|
|
263
273
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/trait.jsx"],"names":["log","styles","actions","color","text","controls","display","justifyContent","position","top","right","cursor","dragHandle","left","DragHandleSpace","removeLabel","whiteSpace","TraitTile","params","props","trait","onTraitChanged","Object","keys","forEach","key","descriptor","value","scorePointsDescriptors","length","event","setState","anchorEl","currentTarget","secondaryBlock","scrollTo","onTraitRemoved","handleClose","nextProps","currentPosition","scrollLeft","scrollToPosition","classes","connectDragSource","connectDropTarget","connectDragPreview","name","standards","description","scorePointsValues","showStandards","showDescription","enableDragAndDrop","secondaryBlockWidth","state","pluginProps","image","disabled","math","handleClick","openMenu","__html","labelPlugins","ref","join","split","map","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointDescriptorChange","React","Component","propTypes","PropTypes","func","isRequired","object","isDragging","bool","id","any","isOver","number","shape","string","arrayOf","StyledTrait","NAME","traitSource","beginDrag","StyledSource","connect","monitor","dragSource","dragPreview","traitTarget","hover","drop","item","getItem","didDrop","onTraitDropped","StyledSourceAndTarget","dropTarget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAUA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,sDAAN,CAAZ;AAEA,IAAMC,MAAM,GAAG;AACbC,EAAAA,OAAO,EAAE;AACPC,IAAAA,KAAK,EAAEA,gBAAMC,IAAN;AADA,GADI;AAIbC,EAAAA,QAAQ,EAAE;AACRC,IAAAA,OAAO,EAAE,MADD;AAERC,IAAAA,cAAc,EAAE,UAFR;AAGRC,IAAAA,QAAQ,EAAE,UAHF;AAIRC,IAAAA,GAAG,EAAE,MAJG;AAKRC,IAAAA,KAAK,EAAE,KALC;AAMRC,IAAAA,MAAM,EAAE;AANA,GAJG;AAYbC,EAAAA,UAAU,EAAE;AACVJ,IAAAA,QAAQ,EAAE,UADA;AAEVC,IAAAA,GAAG,EAAE,MAF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OAJM,EAIG;AACnB,QAAMM,IAAI,GAAGN,OAAO,CAACO,OAAR,EAAb;AACAxG,IAAAA,GAAG,CAAC,eAAD,EAAkBuG,IAAlB,EAAwB,UAAxB,EAAoCN,OAAO,CAACQ,OAAR,EAApC,CAAH;AAEAtF,IAAAA,KAAK,CAACuF,cAAN,CAAqBH,IAArB,EAA2BpF,KAAK,CAACiD,KAAjC;AACD;AATiB,CAApB;AAYA,IAAMuC,qBAAqB,GAAG,0BAC5Bf,IAD4B,EAE5BQ,WAF4B,EAG5B,UAACJ,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACrBrD,IAAAA,iBAAiB,EAAEoD,OAAO,CAACY,UAAR,EADE;AAErBtB,IAAAA,MAAM,EAAEW,OAAO,CAACX,MAAR;AAFa,GAAvB;AAAA,CAH4B,EAO5BS,YAP4B,CAA9B;eASeY,qB","sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { DragSource, DropTarget } from 'react-dnd';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport {\n Block,\n BlockWidth,\n DragHandleSpace,\n ExpandedInput,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n UnderlinedInput\n} from './common';\nimport { labelPlugins } from './utils';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport DragIndicatorIcon from '@material-ui/icons/DragIndicator';\n\nconst log = debug('@pie-element:placement-ordering:configure:trait-tile');\n\nconst styles = {\n actions: {\n color: color.text()\n },\n controls: {\n display: 'flex',\n justifyContent: 'flex-end',\n position: 'absolute',\n top: '28px',\n right: '8px',\n cursor: 'pointer',\n },\n dragHandle: {\n position: 'absolute',\n top: '80px',\n left: `-${DragHandleSpace}px`,\n cursor: 'move'\n },\n removeLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces'\n }\n};\n\nexport class TraitTile extends React.Component {\n state = {};\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition || (this.secondaryBlock && this.secondaryBlock.scrollLeft !== nextProps.currentPosition)) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onTraitChanged = (params) => {\n const { trait, onTraitChanged } = this.props;\n\n if (isEmpty(params)) return;\n\n Object.keys(params).forEach(key => {\n trait[key] = params[key];\n });\n\n onTraitChanged(trait);\n };\n\n onScorePointDescriptorChange = ({ descriptor, value }) => {\n const { trait: { scorePointsDescriptors } } = this.props;\n\n if (value < 0 || value >= scorePointsDescriptors.length) return;\n\n scorePointsDescriptors[value] = descriptor;\n\n this.onTraitChanged({ scorePointsDescriptors });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = position => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.onTraitRemoved();\n this.handleClose();\n };\n\n render() {\n const {\n classes,\n connectDragSource,\n connectDropTarget,\n connectDragPreview,\n trait: {\n name,\n standards,\n description,\n scorePointsDescriptors\n },\n scorePointsValues,\n showStandards,\n showDescription,\n enableDragAndDrop,\n currentPosition,\n secondaryBlockWidth\n } = this.props;\n const { anchorEl } = this.state;\n\n const pluginProps = {\n image: { disabled: true },\n math: { disabled: true }\n };\n\n return (\n connectDragPreview(\n connectDropTarget(\n <div>\n <Row>\n <PrimaryBlock>\n {enableDragAndDrop ?\n connectDragSource(\n <span className={classes.dragHandle}>\n <DragIndicatorIcon className={classes.actions}/>\n </span>) : null\n }\n <div className={classes.controls}>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={this.handleClick}\n >\n <MoreVertIcon/>\n </IconButton>\n <Menu\n id=\"long-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={!!anchorEl}\n onClose={this.handleClose}\n >\n <MenuItem onClick={this.openMenu}>\n <div\n className={classes.removeLabel}\n dangerouslySetInnerHTML={{__html: `Remove ${name}`}}\n />\n </MenuItem>\n </Menu>\n </div>\n\n <UnderlinedInput\n markup={name}\n onChange={name => this.onTraitChanged({ name })}\n pluginProps={labelPlugins}\n placeholder='Enter Trait'\n />\n </PrimaryBlock>\n <SecondaryBlock\n setRef={ref => {\n this.secondaryBlock = ref;\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && standards && (\n <Block>\n <ExpandedInput\n placeholder=\"Standards\"\n markup={standards.join(',')}\n onChange={standards => this.onTraitChanged({ standards: standards.split(',') })}\n pluginProps={pluginProps}\n />\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <ExpandedInput\n placeholder=\"Description\"\n markup={description}\n onChange={description => this.onTraitChanged({ description })}\n pluginProps={pluginProps}\n />\n </Block>\n )}\n\n {(scorePointsValues || []).map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 98;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`key-key-${index}`}>\n <ExpandedInput\n placeholder='Enter Description Here'\n markup={scoreDescriptor}\n onChange={descriptor => this.onScorePointDescriptorChange({ descriptor, value })}\n pluginProps={pluginProps}\n alignToRight={remainingSpace < 296} // 296 is the space required for the toolbar\n />\n </Block>\n )\n })}\n </SecondaryBlock>\n </Row>\n </div>\n ))\n );\n }\n}\n\nTraitTile.propTypes = {\n connectDragSource: PropTypes.func.isRequired,\n connectDropTarget: PropTypes.func.isRequired,\n connectDragPreview: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n isDragging: PropTypes.bool.isRequired,\n id: PropTypes.any,\n isOver: PropTypes.bool,\n index: PropTypes.number,\n onTraitChanged: PropTypes.func.isRequired,\n onTraitRemoved: PropTypes.func.isRequired,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n enableDragAndDrop: PropTypes.bool,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n};\n\nexport const StyledTrait = withStyles(styles)(TraitTile);\n\nconst NAME = 'trait-config';\n\nconst traitSource = {\n beginDrag(props) {\n return {\n name: props.trait.name,\n index: props.index\n };\n }\n};\n\nconst StyledSource = DragSource(\n NAME,\n traitSource,\n (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging()\n })\n)(StyledTrait);\n\nconst traitTarget = {\n hover() {\n log('[hover]');\n },\n drop(props, monitor) {\n const item = monitor.getItem();\n log('[drop] item: ', item, 'didDrop?', monitor.didDrop());\n\n props.onTraitDropped(item, props.index);\n }\n};\n\nconst StyledSourceAndTarget = DropTarget(\n NAME,\n traitTarget,\n (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver()\n })\n)(StyledSource);\n\nexport default StyledSourceAndTarget;\n"],"file":"trait.js"}
|
|
1
|
+
{"version":3,"sources":["../src/trait.jsx"],"names":["log","styles","actions","color","text","controls","display","justifyContent","position","top","right","cursor","dragHandle","left","DragHandleSpace","removeLabel","whiteSpace","TraitTile","params","props","trait","onTraitChanged","Object","keys","forEach","key","descriptor","value","scorePointsDescriptors","length","event","setState","anchorEl","currentTarget","secondaryBlock","scrollTo","onTraitRemoved","handleClose","nextProps","currentPosition","scrollLeft","scrollToPosition","classes","connectDragSource","connectDropTarget","connectDragPreview","name","standards","description","scorePointsValues","showStandards","showDescription","enableDragAndDrop","secondaryBlockWidth","spellCheck","uploadSoundSupport","state","pluginProps","image","disabled","math","handleClick","openMenu","__html","labelPlugins","ref","join","split","map","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointDescriptorChange","React","Component","propTypes","PropTypes","func","isRequired","object","isDragging","bool","id","any","isOver","number","shape","string","arrayOf","StyledTrait","NAME","traitSource","beginDrag","StyledSource","connect","monitor","dragSource","dragPreview","traitTarget","hover","drop","item","getItem","didDrop","onTraitDropped","StyledSourceAndTarget","dropTarget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAUA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,sDAAN,CAAZ;AAEA,IAAMC,MAAM,GAAG;AACbC,EAAAA,OAAO,EAAE;AACPC,IAAAA,KAAK,EAAEA,gBAAMC,IAAN;AADA,GADI;AAIbC,EAAAA,QAAQ,EAAE;AACRC,IAAAA,OAAO,EAAE,MADD;AAERC,IAAAA,cAAc,EAAE,UAFR;AAGRC,IAAAA,QAAQ,EAAE,UAHF;AAIRC,IAAAA,GAAG,EAAE,MAJG;AAKRC,IAAAA,KAAK,EAAE,KALC;AAMRC,IAAAA,MAAM,EAAE;AANA,GAJG;AAYbC,EAAAA,UAAU,EAAE;AACVJ,IAAAA,QAAQ,EAAE,UADA;AAEVC,IAAAA,GAAG,EAAE,MAFK;AAGVI,IAAAA,IAAI,aAAMC,uBAAN,OAHM;AAIVH,IAAAA,MAAM,EAAE;AAJE,GAZC;AAkBbI,EAAAA,WAAW,EAAE;AACXT,IAAAA,OAAO,EAAE,MADE;AAEXU,IAAAA,UAAU,EAAE;AAFD;AAlBA,CAAf;;IAwBaC,S;;;;;;;;;;;;;;;8FACH,E;uGAQS,UAACC,MAAD,EAAY;AAC3B,wBAAkC,MAAKC,KAAvC;AAAA,UAAQC,KAAR,eAAQA,KAAR;AAAA,UAAeC,cAAf,eA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Ja,EAINgF,OAJM,EAIG;AACnB,QAAMM,IAAI,GAAGN,OAAO,CAACO,OAAR,EAAb;AACA1G,IAAAA,GAAG,CAAC,eAAD,EAAkByG,IAAlB,EAAwB,UAAxB,EAAoCN,OAAO,CAACQ,OAAR,EAApC,CAAH;AAEAxF,IAAAA,KAAK,CAACyF,cAAN,CAAqBH,IAArB,EAA2BtF,KAAK,CAACmD,KAAjC;AACD;AATiB,CAApB;AAYA,IAAMuC,qBAAqB,GAAG,0BAC5Bf,IAD4B,EAE5BQ,WAF4B,EAG5B,UAACJ,OAAD,EAAUC,OAAV;AAAA,SAAuB;AACrBvD,IAAAA,iBAAiB,EAAEsD,OAAO,CAACY,UAAR,EADE;AAErBtB,IAAAA,MAAM,EAAEW,OAAO,CAACX,MAAR;AAFa,GAAvB;AAAA,CAH4B,EAO5BS,YAP4B,CAA9B;eASeY,qB","sourcesContent":["import React from 'react';\nimport debug from 'debug';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { DragSource, DropTarget } from 'react-dnd';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nimport {\n Block,\n BlockWidth,\n DragHandleSpace,\n ExpandedInput,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n UnderlinedInput\n} from './common';\nimport { labelPlugins } from './utils';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport DragIndicatorIcon from '@material-ui/icons/DragIndicator';\n\nconst log = debug('@pie-element:placement-ordering:configure:trait-tile');\n\nconst styles = {\n actions: {\n color: color.text()\n },\n controls: {\n display: 'flex',\n justifyContent: 'flex-end',\n position: 'absolute',\n top: '28px',\n right: '8px',\n cursor: 'pointer',\n },\n dragHandle: {\n position: 'absolute',\n top: '80px',\n left: `-${DragHandleSpace}px`,\n cursor: 'move'\n },\n removeLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces'\n }\n};\n\nexport class TraitTile extends React.Component {\n state = {};\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition || (this.secondaryBlock && this.secondaryBlock.scrollLeft !== nextProps.currentPosition)) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onTraitChanged = (params) => {\n const { trait, onTraitChanged } = this.props;\n\n if (isEmpty(params)) return;\n\n Object.keys(params).forEach(key => {\n trait[key] = params[key];\n });\n\n onTraitChanged(trait);\n };\n\n onScorePointDescriptorChange = ({ descriptor, value }) => {\n const { trait: { scorePointsDescriptors } } = this.props;\n\n if (value < 0 || value >= scorePointsDescriptors.length) return;\n\n scorePointsDescriptors[value] = descriptor;\n\n this.onTraitChanged({ scorePointsDescriptors });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = position => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.onTraitRemoved();\n this.handleClose();\n };\n\n render() {\n const {\n classes,\n connectDragSource,\n connectDropTarget,\n connectDragPreview,\n trait: {\n name,\n standards,\n description,\n scorePointsDescriptors\n },\n scorePointsValues,\n showStandards,\n showDescription,\n enableDragAndDrop,\n currentPosition,\n secondaryBlockWidth,\n spellCheck,\n uploadSoundSupport\n } = this.props;\n const { anchorEl } = this.state;\n\n const pluginProps = {\n image: { disabled: true },\n math: { disabled: true }\n };\n\n return (\n connectDragPreview(\n connectDropTarget(\n <div>\n <Row>\n <PrimaryBlock>\n {enableDragAndDrop ?\n connectDragSource(\n <span className={classes.dragHandle}>\n <DragIndicatorIcon className={classes.actions}/>\n </span>) : null\n }\n <div className={classes.controls}>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={this.handleClick}\n >\n <MoreVertIcon/>\n </IconButton>\n <Menu\n id=\"long-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={!!anchorEl}\n onClose={this.handleClose}\n >\n <MenuItem onClick={this.openMenu}>\n <div\n className={classes.removeLabel}\n dangerouslySetInnerHTML={{__html: `Remove ${name}`}}\n />\n </MenuItem>\n </Menu>\n </div>\n\n <UnderlinedInput\n markup={name}\n onChange={name => this.onTraitChanged({ name })}\n pluginProps={labelPlugins}\n placeholder='Enter Trait'\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n </PrimaryBlock>\n <SecondaryBlock\n setRef={ref => {\n this.secondaryBlock = ref;\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && standards && (\n <Block>\n <ExpandedInput\n placeholder=\"Standards\"\n markup={standards.join(',')}\n onChange={standards => this.onTraitChanged({ standards: standards.split(',') })}\n pluginProps={pluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <ExpandedInput\n placeholder=\"Description\"\n markup={description}\n onChange={description => this.onTraitChanged({ description })}\n pluginProps={pluginProps}\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n </Block>\n )}\n\n {(scorePointsValues || []).map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 98;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`key-key-${index}`}>\n <ExpandedInput\n placeholder='Enter Description Here'\n markup={scoreDescriptor}\n onChange={descriptor => this.onScorePointDescriptorChange({ descriptor, value })}\n pluginProps={pluginProps}\n alignToRight={remainingSpace < 296} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n </Block>\n )\n })}\n </SecondaryBlock>\n </Row>\n </div>\n ))\n );\n }\n}\n\nTraitTile.propTypes = {\n connectDragSource: PropTypes.func.isRequired,\n connectDropTarget: PropTypes.func.isRequired,\n connectDragPreview: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n isDragging: PropTypes.bool.isRequired,\n id: PropTypes.any,\n isOver: PropTypes.bool,\n index: PropTypes.number,\n onTraitChanged: PropTypes.func.isRequired,\n onTraitRemoved: PropTypes.func.isRequired,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n enableDragAndDrop: PropTypes.bool,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n};\n\nexport const StyledTrait = withStyles(styles)(TraitTile);\n\nconst NAME = 'trait-config';\n\nconst traitSource = {\n beginDrag(props) {\n return {\n name: props.trait.name,\n index: props.index\n };\n }\n};\n\nconst StyledSource = DragSource(\n NAME,\n traitSource,\n (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n connectDragPreview: connect.dragPreview(),\n isDragging: monitor.isDragging()\n })\n)(StyledTrait);\n\nconst traitTarget = {\n hover() {\n log('[hover]');\n },\n drop(props, monitor) {\n const item = monitor.getItem();\n log('[drop] item: ', item, 'didDrop?', monitor.didDrop());\n\n props.onTraitDropped(item, props.index);\n }\n};\n\nconst StyledSourceAndTarget = DropTarget(\n NAME,\n traitTarget,\n (connect, monitor) => ({\n connectDropTarget: connect.dropTarget(),\n isOver: monitor.isOver()\n })\n)(StyledSource);\n\nexport default StyledSourceAndTarget;\n"],"file":"trait.js"}
|
|
@@ -43,7 +43,7 @@ var _utils = require("./utils");
|
|
|
43
43
|
|
|
44
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
45
45
|
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
46
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
47
|
|
|
48
48
|
var styles = {
|
|
49
49
|
label: {
|
|
@@ -146,7 +146,9 @@ var TraitsHeaderTile = /*#__PURE__*/function (_React$Component) {
|
|
|
146
146
|
scaleIndex = _this$props2.scaleIndex,
|
|
147
147
|
showScorePointLabels = _this$props2.showScorePointLabels,
|
|
148
148
|
secondaryBlockWidth = _this$props2.secondaryBlockWidth,
|
|
149
|
-
setSecondaryBlockRef = _this$props2.setSecondaryBlockRef
|
|
149
|
+
setSecondaryBlockRef = _this$props2.setSecondaryBlockRef,
|
|
150
|
+
spellCheck = _this$props2.spellCheck,
|
|
151
|
+
uploadSoundSupport = _this$props2.uploadSoundSupport;
|
|
150
152
|
var anchorEl = this.state.anchorEl;
|
|
151
153
|
return /*#__PURE__*/_react["default"].createElement(_common.Row, {
|
|
152
154
|
className: classes.greyHeader,
|
|
@@ -157,7 +159,9 @@ var TraitsHeaderTile = /*#__PURE__*/function (_React$Component) {
|
|
|
157
159
|
markup: traitLabel || 'Trait',
|
|
158
160
|
onChange: onTraitLabelChange,
|
|
159
161
|
pluginProps: _utils.labelPlugins,
|
|
160
|
-
|
|
162
|
+
spellCheck: spellCheck,
|
|
163
|
+
label: "Level Label",
|
|
164
|
+
uploadSoundSupport: uploadSoundSupport
|
|
161
165
|
}), /*#__PURE__*/_react["default"].createElement(_common.ScaleSettings, null, /*#__PURE__*/_react["default"].createElement("div", null, "Scale ", scaleIndex + 1), /*#__PURE__*/_react["default"].createElement(_common.MaxPointsPicker, {
|
|
162
166
|
maxPoints: maxPoints,
|
|
163
167
|
onChange: updateMaxPointsFieldValue
|
|
@@ -216,7 +220,9 @@ var TraitsHeaderTile = /*#__PURE__*/function (_React$Component) {
|
|
|
216
220
|
});
|
|
217
221
|
},
|
|
218
222
|
alignToRight: remainingSpace < 296 // 296 is the space required for the toolbar
|
|
219
|
-
|
|
223
|
+
,
|
|
224
|
+
spellCheck: spellCheck,
|
|
225
|
+
uploadSoundSupport: uploadSoundSupport
|
|
220
226
|
}));
|
|
221
227
|
})));
|
|
222
228
|
}
|
|
@@ -242,7 +248,8 @@ TraitsHeaderTile.propTypes = {
|
|
|
242
248
|
secondaryBlockWidth: _propTypes["default"].number,
|
|
243
249
|
showDeleteScaleModal: _propTypes["default"].func,
|
|
244
250
|
showScorePointLabels: _propTypes["default"].bool,
|
|
245
|
-
setSecondaryBlockRef: _propTypes["default"].func
|
|
251
|
+
setSecondaryBlockRef: _propTypes["default"].func,
|
|
252
|
+
uploadSoundSupport: _propTypes["default"].object
|
|
246
253
|
};
|
|
247
254
|
|
|
248
255
|
var _default = (0, _styles.withStyles)(styles)(TraitsHeaderTile);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/traitsHeader.jsx"],"names":["styles","label","textAlign","width","border","margin","padding","display","alignItems","justifyContent","greyHeader","background","color","secondaryBackground","borderRadius","position","primaryBlockGreyHeader","paddingTop","TraitsHeaderTile","anchorEl","scorePointLabel","value","props","scorePointsLabels","onScaleChange","length","event","setState","currentTarget","secondaryBlock","scrollTo","left","showDeleteScaleModal","handleClose","nextProps","currentPosition","scrollToPosition","scorePointsValues","traitLabel","classes","showStandards","onTraitLabelChange","showDescription","showLevelTagInput","maxPoints","updateMaxPointsFieldValue","scaleIndex","showScorePointLabels","secondaryBlockWidth","setSecondaryBlockRef","state","HeaderHeightLarge","HeaderHeight","labelPlugins","handleClick","map","option","openMenu","ref","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointLabelChange","React","Component","propTypes","PropTypes","object","isRequired","func","arrayOf","number","string","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAaA;;;;;;AAEA,IAAMA,MAAM,GAAG;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,SAAS,EAAE,QADN;AAELC,IAAAA,KAAK,EAAE,OAFF;AAGLC,IAAAA,MAAM,EAAE,MAHH;AAILC,IAAAA,MAAM,EAAE,KAJH;AAKLC,IAAAA,OAAO,EAAE,QALJ;AAMLC,IAAAA,OAAO,EAAE,MANJ;AAOLC,IAAAA,UAAU,EAAE,QAPP;AAQLC,IAAAA,cAAc,EAAE;AARX,GADM;AAWbC,EAAAA,UAAU,EAAE;AACVC,IAAAA,UAAU,EAAEC,gBAAMC,mBAAN,EADF;AAEVC,IAAAA,YAAY,EAAE,KAFJ;AAGVC,IAAAA,QAAQ,EAAE;AAHA,GAXC;AAgBbC,EAAAA,sBAAsB,EAAE;AACtBC,IAAAA,UAAU,EAAE;AADU;AAhBX,CAAf;;IAqBaC,gB;;;;;;;;;;;;;;;8FACH;AACNC,MAAAA,QAAQ,EAAE;AADJ,K;gHAUkB,gBAAgC;AAAA,UAA7BC,eAA6B,QAA7BA,eAA6B;AAAA,UAAZC,KAAY,QAAZA,KAAY;AAAA,wBACX,MAAKC,KADM;AAAA,UAChDC,iBADgD,eAChDA,iBADgD;AAAA,UAC7BC,aAD6B,eAC7BA,aAD6B;AAGxD,UAAIH,KAAK,GAAG,CAAR,IAAaA,KAAK,IAAIE,iBAAiB,CAACE,MAA5C,EAAoD;AAEpDF,MAAAA,iBAAiB,CAACF,KAAD,CAAjB,GAA2BD,eAA3B;AAEAI,MAAAA,aAAa,CA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AAE0C,cAAc,GAAG,GANjC,CAMsC;;AANtC,UADF,CADF;AAYD,OAxBA,CA1BH,CAlDF,CADF;AAyGD;;;EA7JmCI,kBAAMC,S;;;AAgK5ClD,gBAAgB,CAACmD,SAAjB,GAA6B;AAC3B9B,EAAAA,OAAO,EAAE+B,sBAAUC,MAAV,CAAiBC,UADC;AAE3B/B,EAAAA,kBAAkB,EAAE6B,sBAAUG,IAFH;AAG3BjD,EAAAA,aAAa,EAAE8C,sBAAUG,IAHE;AAI3BpC,EAAAA,iBAAiB,EAAEiC,sBAAUI,OAAV,CAAkBJ,sBAAUK,MAA5B,CAJQ;AAK3BpD,EAAAA,iBAAiB,EAAE+C,sBAAUI,OAAV,CAAkBJ,sBAAUM,MAA5B,CALQ;AAM3BtC,EAAAA,UAAU,EAAEgC,sBAAUM,MANK;AAO3BpC,EAAAA,aAAa,EAAE8B,sBAAUO,IAPE;AAQ3BlC,EAAAA,iBAAiB,EAAE2B,sBAAUO,IARF;AAS3BnC,EAAAA,eAAe,EAAE4B,sBAAUO,IATA;AAU3BjC,EAAAA,SAAS,EAAE0B,sBAAUK,MAVM;AAW3B9B,EAAAA,yBAAyB,EAAEyB,sBAAUG,IAXV;AAY3B3B,EAAAA,UAAU,EAAEwB,sBAAUK,MAZK;AAa3BxC,EAAAA,eAAe,EAAEmC,sBAAUK,MAbA;AAc3B3B,EAAAA,mBAAmB,EAAEsB,sBAAUK,MAdJ;AAe3B3C,EAAAA,oBAAoB,EAAEsC,sBAAUG,IAfL;AAgB3B1B,EAAAA,oBAAoB,EAAEuB,sBAAUO,IAhBL;AAiB3B5B,EAAAA,oBAAoB,EAAEqB,sBAAUG;AAjBL,CAA7B;;eAoBe,wBAAWzE,MAAX,EAAmBkB,gBAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport { color } from '@pie-lib/render-ui';\n\nimport {\n Block,\n BlockWidth,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n ScorePoint,\n MaxPointsPicker,\n SimpleInput,\n ScaleSettings,\n HeaderHeight,\n HeaderHeightLarge\n} from './common';\nimport { labelPlugins } from './utils';\n\nconst styles = {\n label: {\n textAlign: 'center',\n width: '140px',\n border: 'none',\n margin: '8px',\n padding: '10px 0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-around'\n },\n greyHeader: {\n background: color.secondaryBackground(),\n borderRadius: '4px',\n position: 'relative'\n },\n primaryBlockGreyHeader: {\n paddingTop: '12px'\n }\n};\n\nexport class TraitsHeaderTile extends React.Component {\n state = {\n anchorEl: null,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onScorePointLabelChange = ({ scorePointLabel, value }) => {\n const { scorePointsLabels, onScaleChange } = this.props;\n\n if (value < 0 || value >= scorePointsLabels.length) return;\n\n scorePointsLabels[value] = scorePointLabel;\n\n onScaleChange({ scorePointsLabels });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = position => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.showDeleteScaleModal();\n this.handleClose();\n };\n\n render() {\n const {\n scorePointsValues,\n scorePointsLabels,\n traitLabel,\n classes,\n currentPosition,\n showStandards,\n onTraitLabelChange,\n showDescription,\n showLevelTagInput,\n maxPoints,\n updateMaxPointsFieldValue,\n scaleIndex,\n showScorePointLabels,\n secondaryBlockWidth,\n setSecondaryBlockRef,\n } = this.props;\n const { anchorEl } = this.state;\n\n return (\n <Row className={classes.greyHeader} height={showLevelTagInput ? HeaderHeightLarge : HeaderHeight}>\n <PrimaryBlock className={classes.primaryBlockGreyHeader}>\n {showLevelTagInput && (\n <SimpleInput\n markup={traitLabel || 'Trait'}\n onChange={onTraitLabelChange}\n pluginProps={labelPlugins}\n label='Level Label'\n />\n )}\n\n <ScaleSettings>\n <div>\n Scale {scaleIndex + 1}\n </div>\n\n <MaxPointsPicker\n maxPoints={maxPoints}\n onChange={updateMaxPointsFieldValue}\n />\n\n <div>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={this.handleClick}\n >\n <MoreVertIcon/>\n </IconButton>\n <Menu\n id=\"long-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={!!anchorEl}\n onClose={this.handleClose}\n >\n {['Remove Scale'].map((option) => (\n <MenuItem\n key={option}\n onClick={this.openMenu}\n >\n {option}\n </MenuItem>\n ))}\n </Menu>\n </div>\n </ScaleSettings>\n </PrimaryBlock>\n\n <SecondaryBlock\n setRef={ref => {\n if (ref) {\n this.secondaryBlock = ref;\n setSecondaryBlockRef(ref);\n }\n }}\n width={`${secondaryBlockWidth}px`}\n >\n\n {showStandards && (\n <Block>\n <div className={classes.label}>\n Standard(s)\n </div>\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <div className={classes.label}>\n Description\n </div>\n </Block>\n )}\n\n {scorePointsValues.map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsLabels[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`secondary-block-part-${index}`}>\n <ScorePoint\n scorePointsValue={scorePointsValue}\n scoreDescriptor={scoreDescriptor}\n pluginProps={labelPlugins}\n showScorePointLabels={showScorePointLabels}\n onChange={scorePointLabel => this.onScorePointLabelChange({ scorePointLabel, value })}\n alignToRight={remainingSpace < 296} // 296 is the space required for the toolbar\n />\n </Block>\n )\n })}\n </SecondaryBlock>\n </Row>\n );\n }\n}\n\nTraitsHeaderTile.propTypes = {\n classes: PropTypes.object.isRequired,\n onTraitLabelChange: PropTypes.func,\n onScaleChange: PropTypes.func,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n updateMaxPointsFieldValue: PropTypes.func,\n scaleIndex: PropTypes.number,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n showDeleteScaleModal: PropTypes.func,\n showScorePointLabels: PropTypes.bool,\n setSecondaryBlockRef: PropTypes.func\n};\n\nexport default withStyles(styles)(TraitsHeaderTile);\n"],"file":"traitsHeader.js"}
|
|
1
|
+
{"version":3,"sources":["../src/traitsHeader.jsx"],"names":["styles","label","textAlign","width","border","margin","padding","display","alignItems","justifyContent","greyHeader","background","color","secondaryBackground","borderRadius","position","primaryBlockGreyHeader","paddingTop","TraitsHeaderTile","anchorEl","scorePointLabel","value","props","scorePointsLabels","onScaleChange","length","event","setState","currentTarget","secondaryBlock","scrollTo","left","showDeleteScaleModal","handleClose","nextProps","currentPosition","scrollToPosition","scorePointsValues","traitLabel","classes","showStandards","onTraitLabelChange","showDescription","showLevelTagInput","maxPoints","updateMaxPointsFieldValue","scaleIndex","showScorePointLabels","secondaryBlockWidth","setSecondaryBlockRef","spellCheck","uploadSoundSupport","state","HeaderHeightLarge","HeaderHeight","labelPlugins","handleClick","map","option","openMenu","ref","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointLabelChange","React","Component","propTypes","PropTypes","object","isRequired","func","arrayOf","number","string","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAaA;;;;;;AAEA,IA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mCkB,kBAAMC,S;;;AAsK5CpD,gBAAgB,CAACqD,SAAjB,GAA6B;AAC3BhC,EAAAA,OAAO,EAAEiC,sBAAUC,MAAV,CAAiBC,UADC;AAE3BjC,EAAAA,kBAAkB,EAAE+B,sBAAUG,IAFH;AAG3BnD,EAAAA,aAAa,EAAEgD,sBAAUG,IAHE;AAI3BtC,EAAAA,iBAAiB,EAAEmC,sBAAUI,OAAV,CAAkBJ,sBAAUK,MAA5B,CAJQ;AAK3BtD,EAAAA,iBAAiB,EAAEiD,sBAAUI,OAAV,CAAkBJ,sBAAUM,MAA5B,CALQ;AAM3BxC,EAAAA,UAAU,EAAEkC,sBAAUM,MANK;AAO3BtC,EAAAA,aAAa,EAAEgC,sBAAUO,IAPE;AAQ3BpC,EAAAA,iBAAiB,EAAE6B,sBAAUO,IARF;AAS3BrC,EAAAA,eAAe,EAAE8B,sBAAUO,IATA;AAU3BnC,EAAAA,SAAS,EAAE4B,sBAAUK,MAVM;AAW3BhC,EAAAA,yBAAyB,EAAE2B,sBAAUG,IAXV;AAY3B7B,EAAAA,UAAU,EAAE0B,sBAAUK,MAZK;AAa3B1C,EAAAA,eAAe,EAAEqC,sBAAUK,MAbA;AAc3B7B,EAAAA,mBAAmB,EAAEwB,sBAAUK,MAdJ;AAe3B7C,EAAAA,oBAAoB,EAAEwC,sBAAUG,IAfL;AAgB3B5B,EAAAA,oBAAoB,EAAEyB,sBAAUO,IAhBL;AAiB3B9B,EAAAA,oBAAoB,EAAEuB,sBAAUG,IAjBL;AAkB3BxB,EAAAA,kBAAkB,EAAEqB,sBAAUC;AAlBH,CAA7B;;eAqBe,wBAAWzE,MAAX,EAAmBkB,gBAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport { color } from '@pie-lib/render-ui';\n\nimport {\n Block,\n BlockWidth,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n ScorePoint,\n MaxPointsPicker,\n SimpleInput,\n ScaleSettings,\n HeaderHeight,\n HeaderHeightLarge\n} from './common';\nimport { labelPlugins } from './utils';\n\nconst styles = {\n label: {\n textAlign: 'center',\n width: '140px',\n border: 'none',\n margin: '8px',\n padding: '10px 0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-around'\n },\n greyHeader: {\n background: color.secondaryBackground(),\n borderRadius: '4px',\n position: 'relative'\n },\n primaryBlockGreyHeader: {\n paddingTop: '12px'\n }\n};\n\nexport class TraitsHeaderTile extends React.Component {\n state = {\n anchorEl: null,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onScorePointLabelChange = ({ scorePointLabel, value }) => {\n const { scorePointsLabels, onScaleChange } = this.props;\n\n if (value < 0 || value >= scorePointsLabels.length) return;\n\n scorePointsLabels[value] = scorePointLabel;\n\n onScaleChange({ scorePointsLabels });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = position => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.showDeleteScaleModal();\n this.handleClose();\n };\n\n render() {\n const {\n scorePointsValues,\n scorePointsLabels,\n traitLabel,\n classes,\n currentPosition,\n showStandards,\n onTraitLabelChange,\n showDescription,\n showLevelTagInput,\n maxPoints,\n updateMaxPointsFieldValue,\n scaleIndex,\n showScorePointLabels,\n secondaryBlockWidth,\n setSecondaryBlockRef,\n spellCheck,\n uploadSoundSupport\n } = this.props;\n const { anchorEl } = this.state;\n\n return (\n <Row className={classes.greyHeader} height={showLevelTagInput ? HeaderHeightLarge : HeaderHeight}>\n <PrimaryBlock className={classes.primaryBlockGreyHeader}>\n {showLevelTagInput && (\n <SimpleInput\n markup={traitLabel || 'Trait'}\n onChange={onTraitLabelChange}\n pluginProps={labelPlugins}\n spellCheck={spellCheck}\n label='Level Label'\n uploadSoundSupport={uploadSoundSupport}\n />\n )}\n\n <ScaleSettings>\n <div>\n Scale {scaleIndex + 1}\n </div>\n\n <MaxPointsPicker\n maxPoints={maxPoints}\n onChange={updateMaxPointsFieldValue}\n />\n\n <div>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={this.handleClick}\n >\n <MoreVertIcon/>\n </IconButton>\n <Menu\n id=\"long-menu\"\n anchorEl={anchorEl}\n keepMounted\n open={!!anchorEl}\n onClose={this.handleClose}\n >\n {['Remove Scale'].map((option) => (\n <MenuItem\n key={option}\n onClick={this.openMenu}\n >\n {option}\n </MenuItem>\n ))}\n </Menu>\n </div>\n </ScaleSettings>\n </PrimaryBlock>\n\n <SecondaryBlock\n setRef={ref => {\n if (ref) {\n this.secondaryBlock = ref;\n setSecondaryBlockRef(ref);\n }\n }}\n width={`${secondaryBlockWidth}px`}\n >\n\n {showStandards && (\n <Block>\n <div className={classes.label}>\n Standard(s)\n </div>\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <div className={classes.label}>\n Description\n </div>\n </Block>\n )}\n\n {scorePointsValues.map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsLabels[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`secondary-block-part-${index}`}>\n <ScorePoint\n scorePointsValue={scorePointsValue}\n scoreDescriptor={scoreDescriptor}\n pluginProps={labelPlugins}\n showScorePointLabels={showScorePointLabels}\n onChange={scorePointLabel => this.onScorePointLabelChange({ scorePointLabel, value })}\n alignToRight={remainingSpace < 296} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n />\n </Block>\n )\n })}\n </SecondaryBlock>\n </Row>\n );\n }\n}\n\nTraitsHeaderTile.propTypes = {\n classes: PropTypes.object.isRequired,\n onTraitLabelChange: PropTypes.func,\n onScaleChange: PropTypes.func,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n updateMaxPointsFieldValue: PropTypes.func,\n scaleIndex: PropTypes.number,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n showDeleteScaleModal: PropTypes.func,\n showScorePointLabels: PropTypes.bool,\n setSecondaryBlockRef: PropTypes.func,\n uploadSoundSupport: PropTypes.object\n};\n\nexport default withStyles(styles)(TraitsHeaderTile);\n"],"file":"traitsHeader.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multi-trait-rubric-configure",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
|
-
"@pie-framework/pie-configure-events": "^1.
|
|
11
|
-
"@pie-lib/config-ui": "^
|
|
12
|
-
"@pie-lib/editable-html": "^
|
|
13
|
-
"@pie-lib/render-ui": "^4.
|
|
14
|
-
"@pie-lib/rubric": "^0.
|
|
15
|
-
"@pie-lib/scoring-config": "^3.5.
|
|
10
|
+
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
+
"@pie-lib/config-ui": "^11.0.19",
|
|
12
|
+
"@pie-lib/editable-html": "^9.2.2",
|
|
13
|
+
"@pie-lib/render-ui": "^4.13.6",
|
|
14
|
+
"@pie-lib/rubric": "^0.5.4",
|
|
15
|
+
"@pie-lib/scoring-config": "^3.5.183",
|
|
16
16
|
"debug": "^3.1.0",
|
|
17
17
|
"lodash": "^4.17.15",
|
|
18
18
|
"prop-types": "^15.6.2",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [1.2.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/multi-trait-rubric-controller@1.2.6...@pie-element/multi-trait-rubric-controller@1.2.8) (2021-11-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/multi-trait-rubric-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.2.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/multi-trait-rubric-controller@1.2.6...@pie-element/multi-trait-rubric-controller@1.2.7) (2021-11-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/multi-trait-rubric-controller
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.2.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/multi-trait-rubric-controller@1.2.4...@pie-element/multi-trait-rubric-controller@1.2.6) (2021-08-05)
|
|
7
23
|
|
|
8
24
|
|
package/controller/lib/index.js
CHANGED
|
@@ -5,10 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.createCorrectResponseSession = void 0;
|
|
8
9
|
exports.createDefaultModel = createDefaultModel;
|
|
10
|
+
exports.getScore = void 0;
|
|
9
11
|
exports.model = model;
|
|
12
|
+
exports.normalize = void 0;
|
|
10
13
|
exports.outcome = outcome;
|
|
11
|
-
exports.createCorrectResponseSession = exports.getScore = exports.normalize = void 0;
|
|
12
14
|
|
|
13
15
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
14
16
|
|
|
@@ -18,9 +20,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
18
20
|
|
|
19
21
|
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
20
22
|
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
24
|
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
26
|
|
|
25
27
|
function createDefaultModel() {
|
|
26
28
|
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["createDefaultModel","model","Promise","resolve","defaults","normalize","question","session","env","normalizedQuestion","role","visible","visibleToStudent","scales","excludeZero","parsedScales","map","scale","getScore","outcome","score","empty","createCorrectResponseSession","mode","id"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["createDefaultModel","model","Promise","resolve","defaults","normalize","question","session","env","normalizedQuestion","role","visible","visibleToStudent","scales","excludeZero","parsedScales","map","scale","getScore","outcome","score","empty","createCorrectResponseSession","mode","id"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEO,SAASA,kBAAT,GAAwC;AAAA,MAAZC,KAAY,uEAAJ,EAAI;AAC7C,SAAO,IAAIC,OAAJ,CAAY,UAAAC,OAAO;AAAA,WAAIA,OAAO,iCAAMC,oBAAN,GAAmBH,KAAnB,EAAX;AAAA,GAAnB,CAAP;AACD;;AAEM,IAAMI,SAAS,GAAG,SAAZA,SAAY,CAAAC,QAAQ;AAAA,yCAAUF,oBAAV,GAAuBE,QAAvB;AAAA,CAA1B;AAEP;AACA;AACA;AACA;AACA;AACA;;;;;SACsBL,K;;;;;yFAAf,iBAAqBK,QAArB,EAA+BC,OAA/B,EAAwCC,GAAxC;AAAA;;AAAA;AAAA;AAAA;AAAA;AACCC,YAAAA,kBADD,GACsBJ,SAAS,CAACC,QAAD,CAD/B;;AAGL,gBAAI,CAACE,GAAG,CAACE,IAAL,IAAaF,GAAG,CAACE,IAAJ,KAAa,SAA9B,EAAyC;AACvCD,cAAAA,kBAAkB,CAACE,OAAnB,GAA6BF,kBAAkB,CAACG,gBAAhD;AACD,aAFD,MAEO;AACLH,cAAAA,kBAAkB,CAACE,OAAnB,GAA6B,IAA7B;AACD,aAPI,CASL;;;AATK,mBAU2BF,kBAAkB,IAAI,EAVjD,EAUGI,MAVH,QAUGA,MAVH,EAUWC,WAVX,QAUWA,WAVX;AAWCC,YAAAA,YAXD,GAWgB,CAACF,MAAM,IAAI,EAAX,EAAeG,GAAf,CAAmB,UAAAC,KAAK;AAAA,qDAAUA,KAAV;AAAiBH,gBAAAA,WAAW,EAAXA;AAAjB;AAAA,aAAxB,CAXhB;AAAA,6EAcAL,kBAdA;AAeHI,cAAAA,MAAM,EAAEE;AAfL;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AAoBA,IAAMG,QAAQ,GAAG,SAAXA,QAAW;AAAA,SAAM,CAAN;AAAA,CAAjB;AAEP;AACA;AACA;AACA;AACA;;;;;AACO,SAASC,OAAT,CAAiBlB,KAAjB,EAAwBM,OAAxB,EAAiCC,GAAjC,EAAsC;AAC3C,SAAO,IAAIN,OAAJ,CAAY,UAAAC,OAAO;AAAA,WAAIA,OAAO,CAAC;AAAEiB,MAAAA,KAAK,EAAE,CAAT;AAAYC,MAAAA,KAAK,EAAE;AAAnB,KAAD,CAAX;AAAA,GAAnB,CAAP;AACD;;AAEM,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CAAChB,QAAD,EAAWE,GAAX,EAAmB;AAC7D,SAAO,IAAIN,OAAJ,CAAY,UAAAC,OAAO,EAAI;AAC5B,QAAIK,GAAG,CAACe,IAAJ,KAAa,UAAb,IAA2Bf,GAAG,CAACE,IAAJ,KAAa,YAA5C,EAA0D;AACxDP,MAAAA,OAAO,CAAC;AAAEqB,QAAAA,EAAE,EAAE;AAAN,OAAD,CAAP;AACD,KAFD,MAEO;AACLrB,MAAAA,OAAO,CAAC,IAAD,CAAP;AACD;AACF,GANM,CAAP;AAOD,CARM","sourcesContent":["import defaults from './defaults';\n\nexport function createDefaultModel(model = {}) {\n return new Promise(resolve => resolve({ ...defaults, ...model }));\n}\n\nexport const normalize = question => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (!env.role || env.role === 'student') {\n normalizedQuestion.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion || {};\n const parsedScales = (scales || []).map(scale => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n scales: parsedScales\n };\n}\n\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome(model, session, env) {\n return new Promise(resolve => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise(resolve => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n"],"file":"index.js"}
|
package/controller/package.json
CHANGED
package/docs/config-schema.json
CHANGED
|
@@ -163,6 +163,22 @@
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
},
|
|
166
|
+
"spellCheck": {
|
|
167
|
+
"title": "ConfigureProp",
|
|
168
|
+
"type": "object",
|
|
169
|
+
"properties": {
|
|
170
|
+
"settings": {
|
|
171
|
+
"description": "Indicates if the item has to be displayed in the Settings Panel",
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"title": "settings"
|
|
174
|
+
},
|
|
175
|
+
"label": {
|
|
176
|
+
"description": "Indicates the label for the item that has to be displayed in the Settings Panel",
|
|
177
|
+
"type": "string",
|
|
178
|
+
"title": "label"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
166
182
|
"width": {
|
|
167
183
|
"description": "How large (in px) should multi-trait-rubric be",
|
|
168
184
|
"type": "string",
|
|
@@ -207,4 +223,4 @@
|
|
|
207
223
|
}
|
|
208
224
|
},
|
|
209
225
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
210
|
-
}
|
|
226
|
+
}
|