@pie-element/rubric 4.8.1 → 4.8.2-next.10
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/lib/main.js +7 -1
- package/lib/main.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +7 -2
- package/module/index.html +1 -1
- package/module/manifest.json +2 -2
- package/module/print.html +1 -1
- package/module/print.js +7 -2
- package/package.json +2 -2
- package/src/main.jsx +6 -0
package/lib/main.js
CHANGED
|
@@ -199,7 +199,13 @@ var styles = function styles(theme) {
|
|
|
199
199
|
return {
|
|
200
200
|
root: {
|
|
201
201
|
color: _renderUi.color.text(),
|
|
202
|
-
backgroundColor: _renderUi.color.background()
|
|
202
|
+
backgroundColor: _renderUi.color.background(),
|
|
203
|
+
// reset paragraph margins and line-height inside lists to override client styles
|
|
204
|
+
'& ul p, & ol p': {
|
|
205
|
+
marginBottom: 0,
|
|
206
|
+
marginTop: 0,
|
|
207
|
+
lineHeight: 'normal'
|
|
208
|
+
}
|
|
203
209
|
},
|
|
204
210
|
listColumn: {
|
|
205
211
|
display: 'flex',
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["RubricType","PropTypes","shape","excludeZero","bool","points","arrayOf","string","sampleAnswers","animationsDisabled","Rubric","props","index","value","state","rubricOpen","linkPrefix","toggleRubric","bind","setState","model","classes","extraCSSRules","rubricList","slice","reverse","map","desc","length","pointsLabel","listColumn","titleText","text","__html","fontWeight","root","hiddenScreenReader","rubricToggle","e","key","chevronStyle","React","Component","object","isRequired","styles","theme","color","backgroundColor","background","display","flexDirection","alignItems","padding","listColumnItem","fontSize","margin","paddingBottom","cursor","userSelect","typography","tertiary","transition","marginLeft","alignSelf","position","width","height","overflow","clip","border","whiteSpace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA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-ui/core/ListItem';\nimport List from '@material-ui/core/List';\nimport Collapse from '@material-ui/core/Collapse';\nimport { color, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport PropTypes from 'prop-types';\n\nexport const RubricType = PropTypes.shape({\n excludeZero: PropTypes.bool,\n points: PropTypes.arrayOf(PropTypes.string),\n sampleAnswers: PropTypes.arrayOf(PropTypes.string),\n animationsDisabled: PropTypes.bool,\n});\n\nclass Rubric extends React.Component {\n dudUrl = 'javascript:;';\n\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n linkPrefix: 'Show',\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n animationsDisabled: PropTypes.bool,\n value: RubricType,\n };\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n shouldRenderPoint = (index, value) => {\n if (!value.excludeZero) {\n return true;\n } else {\n return index !== 0;\n }\n };\n\n render() {\n const { model, value, classes } = this.props;\n let { animationsDisabled } = this.props;\n animationsDisabled = animationsDisabled || value.animationsDisabled;\n\n if (value && value.points) {\n const { extraCSSRules } = model || {};\n const { points, sampleAnswers } = value;\n\n const rubricList = (\n <List component=\"nav\">\n {points\n .slice(0)\n .reverse()\n .map((desc, index) => {\n index = points.length - index - 1;\n const pointsLabel = value.excludeZero ? index + 1 : index;\n\n return (\n <React.Fragment key={index}>\n <ListItem key={`P${index}`} className={classes.listColumn}>\n <h3 className={classes.titleText}>{pointsLabel === 1 ? `${pointsLabel} PT` : `${pointsLabel} PTS`}</h3>\n <div className={classes.text} dangerouslySetInnerHTML={{ __html: desc }} />\n </ListItem>\n\n {sampleAnswers && sampleAnswers[index] && (\n <ListItem key={`S${index}`} className={classes.listColumn}>\n <h4 className={classes.titleText} style={{ fontWeight: 'normal' }}>Sample Answer</h4>\n <div className={classes.text} dangerouslySetInnerHTML={{ __html: sampleAnswers[index] }} />\n </ListItem>\n )}\n </React.Fragment>\n );\n })}\n </List>\n );\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} className={classes.root}>\n {/* screen reader only heading for navigation as per PD-5057 */}\n <h2 className={classes.hiddenScreenReader}>Rubric</h2>\n {!animationsDisabled ? (\n <React.Fragment>\n <h2\n id={'rubric-toggle'}\n className={classes.rubricToggle}\n tabIndex={0}\n role=\"button\"\n aria-expanded={this.state.rubricOpen}\n onClick={this.toggleRubric}\n onKeyPress={e => {\n if (e.key === 'Enter' || e.key === ' ') this.toggleRubric();\n }}\n >\n {this.state.linkPrefix} Rubric\n <span\n className={classes.chevronStyle}\n aria-hidden=\"true\"\n >\n {this.state.rubricOpen ? (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><polyline points=\"18 15 12 9 6 15\"></polyline></svg>\n ) : (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>\n )}\n </span>\n </h2>\n <Collapse in={this.state.rubricOpen} timeout=\"auto\">\n {rubricList}\n </Collapse>\n </React.Fragment>\n ) : (\n rubricList\n )}\n </UiLayout>\n );\n } else {\n return null;\n }\n }\n}\n\nconst styles = (theme) => ({\n root: {\n color: color.text(),\n backgroundColor: color.background(),\n },\n listColumn: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n padding: '12px 0px',\n },\n listColumnItem: {\n padding: 0,\n },\n text: {\n color: color.text(),\n },\n titleText: {\n color: color.text(),\n fontSize: '16px',\n fontWeight: '700',\n margin: 0,\n paddingBottom: '6px',\n },\n rubricToggle: {\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n userSelect: 'none',\n fontSize: theme.typography.fontSize,\n fontWeight: '500',\n color: color.tertiary(),\n margin: 0\n },\n chevronStyle: {\n display: 'inline-flex',\n transition: 'transform 0.2s',\n marginLeft: 2,\n alignSelf: 'center',\n },\n hiddenScreenReader: {\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0,0,0,0)',\n border: 0,\n whiteSpace: 'nowrap',\n },\n});\n\nexport default withStyles(styles)(Rubric);\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["RubricType","PropTypes","shape","excludeZero","bool","points","arrayOf","string","sampleAnswers","animationsDisabled","Rubric","props","index","value","state","rubricOpen","linkPrefix","toggleRubric","bind","setState","model","classes","extraCSSRules","rubricList","slice","reverse","map","desc","length","pointsLabel","listColumn","titleText","text","__html","fontWeight","root","hiddenScreenReader","rubricToggle","e","key","chevronStyle","React","Component","object","isRequired","styles","theme","color","backgroundColor","background","marginBottom","marginTop","lineHeight","display","flexDirection","alignItems","padding","listColumnItem","fontSize","margin","paddingBottom","cursor","userSelect","typography","tertiary","transition","marginLeft","alignSelf","position","width","height","overflow","clip","border","whiteSpace"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA,UAAU,GAAGC,sBAAUC,KAAV,CAAgB;AACxCC,EAAAA,WAAW,EAAEF,sBAAUG,IADiB;AAExCC,EAAAA,MAAM,EAAEJ,sBAAUK,OAAV,CAAkBL,sBAAUM,MAA5B,CAFgC;AAGxCC,EAAAA,aAAa,EAAEP,sBAAUK,OAAV,CAAkBL,sBAAUM,MAA5B,CAHyB;AAIxCE,EAAAA,kBAAkB,EAAER,sBAAUG;AAJU,CAAhB,CAAnB;;;;IAODM,M;;;;;AAGJ,kBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,+FAFV,cAEU;AAAA,0GAqBC,UAACC,KA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IAAAA,YAAY,EAAE;AACZgB,MAAAA,OAAO,EAAE,MADG;AAEZE,MAAAA,UAAU,EAAE,QAFA;AAGZM,MAAAA,MAAM,EAAE,SAHI;AAIZC,MAAAA,UAAU,EAAE,MAJA;AAKZJ,MAAAA,QAAQ,EAAEZ,KAAK,CAACiB,UAAN,CAAiBL,QALf;AAMZxB,MAAAA,UAAU,EAAE,KANA;AAOZa,MAAAA,KAAK,EAAEA,gBAAMiB,QAAN,EAPK;AAQZL,MAAAA,MAAM,EAAE;AARI,KA9BW;AAwCzBnB,IAAAA,YAAY,EAAE;AACZa,MAAAA,OAAO,EAAE,aADG;AAEZY,MAAAA,UAAU,EAAE,gBAFA;AAGZC,MAAAA,UAAU,EAAE,CAHA;AAIZC,MAAAA,SAAS,EAAE;AAJC,KAxCW;AA8CzB/B,IAAAA,kBAAkB,EAAE;AAClBgC,MAAAA,QAAQ,EAAE,UADQ;AAElBC,MAAAA,KAAK,EAAE,KAFW;AAGlBC,MAAAA,MAAM,EAAE,KAHU;AAIlBd,MAAAA,OAAO,EAAE,CAJS;AAKlBG,MAAAA,MAAM,EAAE,MALU;AAMlBY,MAAAA,QAAQ,EAAE,QANQ;AAOlBC,MAAAA,IAAI,EAAE,eAPY;AAQlBC,MAAAA,MAAM,EAAE,CARU;AASlBC,MAAAA,UAAU,EAAE;AATM;AA9CK,GAAZ;AAAA,CAAf;;eA2De,wBAAW7B,MAAX,EAAmBnC,MAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport List from '@material-ui/core/List';\nimport Collapse from '@material-ui/core/Collapse';\nimport { color, UiLayout } from '@pie-lib/pie-toolbox/render-ui';\nimport PropTypes from 'prop-types';\n\nexport const RubricType = PropTypes.shape({\n excludeZero: PropTypes.bool,\n points: PropTypes.arrayOf(PropTypes.string),\n sampleAnswers: PropTypes.arrayOf(PropTypes.string),\n animationsDisabled: PropTypes.bool,\n});\n\nclass Rubric extends React.Component {\n dudUrl = 'javascript:;';\n\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n linkPrefix: 'Show',\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n animationsDisabled: PropTypes.bool,\n value: RubricType,\n };\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n shouldRenderPoint = (index, value) => {\n if (!value.excludeZero) {\n return true;\n } else {\n return index !== 0;\n }\n };\n\n render() {\n const { model, value, classes } = this.props;\n let { animationsDisabled } = this.props;\n animationsDisabled = animationsDisabled || value.animationsDisabled;\n\n if (value && value.points) {\n const { extraCSSRules } = model || {};\n const { points, sampleAnswers } = value;\n\n const rubricList = (\n <List component=\"nav\">\n {points\n .slice(0)\n .reverse()\n .map((desc, index) => {\n index = points.length - index - 1;\n const pointsLabel = value.excludeZero ? index + 1 : index;\n\n return (\n <React.Fragment key={index}>\n <ListItem key={`P${index}`} className={classes.listColumn}>\n <h3 className={classes.titleText}>{pointsLabel === 1 ? `${pointsLabel} PT` : `${pointsLabel} PTS`}</h3>\n <div className={classes.text} dangerouslySetInnerHTML={{ __html: desc }} />\n </ListItem>\n\n {sampleAnswers && sampleAnswers[index] && (\n <ListItem key={`S${index}`} className={classes.listColumn}>\n <h4 className={classes.titleText} style={{ fontWeight: 'normal' }}>Sample Answer</h4>\n <div className={classes.text} dangerouslySetInnerHTML={{ __html: sampleAnswers[index] }} />\n </ListItem>\n )}\n </React.Fragment>\n );\n })}\n </List>\n );\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} className={classes.root}>\n {/* screen reader only heading for navigation as per PD-5057 */}\n <h2 className={classes.hiddenScreenReader}>Rubric</h2>\n {!animationsDisabled ? (\n <React.Fragment>\n <h2\n id={'rubric-toggle'}\n className={classes.rubricToggle}\n tabIndex={0}\n role=\"button\"\n aria-expanded={this.state.rubricOpen}\n onClick={this.toggleRubric}\n onKeyPress={e => {\n if (e.key === 'Enter' || e.key === ' ') this.toggleRubric();\n }}\n >\n {this.state.linkPrefix} Rubric\n <span\n className={classes.chevronStyle}\n aria-hidden=\"true\"\n >\n {this.state.rubricOpen ? (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><polyline points=\"18 15 12 9 6 15\"></polyline></svg>\n ) : (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>\n )}\n </span>\n </h2>\n <Collapse in={this.state.rubricOpen} timeout=\"auto\">\n {rubricList}\n </Collapse>\n </React.Fragment>\n ) : (\n rubricList\n )}\n </UiLayout>\n );\n } else {\n return null;\n }\n }\n}\n\nconst styles = (theme) => ({\n root: {\n color: color.text(),\n backgroundColor: color.background(),\n // reset paragraph margins and line-height inside lists to override client styles\n '& ul p, & ol p': {\n marginBottom: 0,\n marginTop: 0,\n lineHeight: 'normal',\n },\n },\n listColumn: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n padding: '12px 0px',\n },\n listColumnItem: {\n padding: 0,\n },\n text: {\n color: color.text(),\n },\n titleText: {\n color: color.text(),\n fontSize: '16px',\n fontWeight: '700',\n margin: 0,\n paddingBottom: '6px',\n },\n rubricToggle: {\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n userSelect: 'none',\n fontSize: theme.typography.fontSize,\n fontWeight: '500',\n color: color.tertiary(),\n margin: 0\n },\n chevronStyle: {\n display: 'inline-flex',\n transition: 'transform 0.2s',\n marginLeft: 2,\n alignSelf: 'center',\n },\n hiddenScreenReader: {\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0,0,0,0)',\n border: 0,\n whiteSpace: 'nowrap',\n },\n});\n\nexport default withStyles(styles)(Rubric);\n"],"file":"main.js"}
|
package/module/configure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.0.2/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
package/module/element.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.0.2/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -7877,7 +7877,12 @@ Rubric.__initStatic();
|
|
|
7877
7877
|
const styles = theme => ({
|
|
7878
7878
|
root: {
|
|
7879
7879
|
color: color.text(),
|
|
7880
|
-
backgroundColor: color.background()
|
|
7880
|
+
backgroundColor: color.background(),
|
|
7881
|
+
'& ul p, & ol p': {
|
|
7882
|
+
marginBottom: 0,
|
|
7883
|
+
marginTop: 0,
|
|
7884
|
+
lineHeight: 'normal'
|
|
7885
|
+
}
|
|
7881
7886
|
},
|
|
7882
7887
|
listColumn: {
|
|
7883
7888
|
display: 'flex',
|
package/module/index.html
CHANGED
package/module/manifest.json
CHANGED
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_lodash, _dll_pie_lib__pie_toolbox_math_rendering, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@5.0.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@8.0.2/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -7877,7 +7877,12 @@ Rubric.__initStatic();
|
|
|
7877
7877
|
const styles = theme => ({
|
|
7878
7878
|
root: {
|
|
7879
7879
|
color: color.text(),
|
|
7880
|
-
backgroundColor: color.background()
|
|
7880
|
+
backgroundColor: color.background(),
|
|
7881
|
+
'& ul p, & ol p': {
|
|
7882
|
+
marginBottom: 0,
|
|
7883
|
+
marginTop: 0,
|
|
7884
|
+
lineHeight: 'normal'
|
|
7885
|
+
}
|
|
7881
7886
|
},
|
|
7882
7887
|
listColumn: {
|
|
7883
7888
|
display: 'flex',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/rubric",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.2-next.10+7ab24ec5b",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"description": "Rubric Scoring Interaction",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"author": "pie framework developers",
|
|
17
17
|
"license": "ISC",
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "7ab24ec5bc047e9ebea8c34854247fdd006e807e",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|
package/src/main.jsx
CHANGED
|
@@ -130,6 +130,12 @@ const styles = (theme) => ({
|
|
|
130
130
|
root: {
|
|
131
131
|
color: color.text(),
|
|
132
132
|
backgroundColor: color.background(),
|
|
133
|
+
// reset paragraph margins and line-height inside lists to override client styles
|
|
134
|
+
'& ul p, & ol p': {
|
|
135
|
+
marginBottom: 0,
|
|
136
|
+
marginTop: 0,
|
|
137
|
+
lineHeight: 'normal',
|
|
138
|
+
},
|
|
133
139
|
},
|
|
134
140
|
listColumn: {
|
|
135
141
|
display: 'flex',
|