@pie-lib/render-ui 4.13.1 → 4.13.2
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 +11 -0
- package/lib/preview-prompt.js +1 -6
- package/lib/preview-prompt.js.map +1 -1
- package/package.json +2 -2
- package/src/preview-prompt.jsx +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [4.13.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.13.1...@pie-lib/render-ui@4.13.2) (2022-08-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* reverted changes for PD-1802 since it's causing PD-1937 ([b02fecb](https://github.com/pie-framework/pie-lib/commit/b02fecb54d8e243c34b864e4e5d3378899cb56d7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [4.13.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.13.0...@pie-lib/render-ui@4.13.1) (2022-07-18)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @pie-lib/render-ui
|
package/lib/preview-prompt.js
CHANGED
|
@@ -118,12 +118,7 @@ var styles = function styles(theme) {
|
|
|
118
118
|
return {
|
|
119
119
|
prompt: {
|
|
120
120
|
verticalAlign: 'middle',
|
|
121
|
-
color: color.text()
|
|
122
|
-
display: 'flex',
|
|
123
|
-
flexDirection: 'column',
|
|
124
|
-
'& > *': {
|
|
125
|
-
display: 'flex'
|
|
126
|
-
}
|
|
121
|
+
color: color.text()
|
|
127
122
|
},
|
|
128
123
|
rationale: {
|
|
129
124
|
paddingLeft: theme.spacing.unit * 16
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/preview-prompt.jsx"],"names":["NEWLINE_BLOCK_REGEX","NEWLINE_LATEX","PreviewPrompt","text","div","document","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","props","prompt","classes","tagName","className","onClick","defaultClassName","CustomTag","customClasses","promptTable","__html","parsedText","replace","Component","PropTypes","object","string","func","styles","theme","verticalAlign","color","
|
|
1
|
+
{"version":3,"sources":["../src/preview-prompt.jsx"],"names":["NEWLINE_BLOCK_REGEX","NEWLINE_LATEX","PreviewPrompt","text","div","document","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","props","prompt","classes","tagName","className","onClick","defaultClassName","CustomTag","customClasses","promptTable","__html","parsedText","replace","Component","PropTypes","object","string","func","styles","theme","verticalAlign","color","rationale","paddingLeft","spacing","unit","label","display","cursor","borderCollapse","backgroundColor","padding","textAlign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA;AACA,IAAMA,mBAAmB,GAAG,yBAA5B;AACA,IAAMC,aAAa,GAAG,YAAtB;;IAEaC,a;;;;;;;;;;;;;;;mGAcE,UAAAC,IAAI,EAAI;AACnB;AACA,UAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ;AACAF,MAAAA,GAAG,CAACG,SAAJ,GAAgBJ,IAAhB;AAEA,UAAMK,KAAK,GAAGJ,GAAG,CAACK,aAAJ,CAAkB,OAAlB,CAAd;;AACA,UAAID,KAAJ,EAAW;AACT,YAAME,MAAM,GAAGL,QAAQ,CAACC,aAAT,CAAuB,QAAvB,CAAf;AAEAI,QAAAA,MAAM,CAACC,YAAP,CAAoB,MAApB,EAA4B,WAA5B;AACAD,QAAAA,MAAM,CAACC,YAAP,CAAoB,KAApB,EAA2BH,KAAK,CAACI,YAAN,CAAmB,KAAnB,CAA3B;AAEAJ,QAAAA,KAAK,CAACK,eAAN,CAAsB,KAAtB;AAC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,EAAE;AACNmB,MAAAA,aAAa,EAAE,QADT;AAENC,MAAAA,KAAK,EAAEA,KAAK,CAACjC,IAAN;AAFD,KADe;AAKvBkC,IAAAA,SAAS,EAAE;AACTC,MAAAA,WAAW,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB;AADzB,KALY;AAQvBC,IAAAA,KAAK,EAAE;AACLL,MAAAA,KAAK,YAAKA,KAAK,CAACjC,IAAN,EAAL,gBADA;AACgC;AACrCuC,MAAAA,OAAO,EAAE,cAFJ;AAGLP,MAAAA,aAAa,EAAE,QAHV;AAILQ,MAAAA,MAAM,EAAE;AAJH,KARgB;AAcvBnB,IAAAA,WAAW,EAAE;AACX,iCAA2B;AACzBoB,QAAAA,cAAc,EAAE;AADS,OADhB;AAIX,oCAA8B;AAC5B,2BAAmB;AACjBC,UAAAA,eAAe,EAAE;AADA;AADS,OAJnB;AASX,gEAA0D;AACxDC,QAAAA,OAAO,EAAE,UAD+C;AAExDC,QAAAA,SAAS,EAAE;AAF6C;AAT/C;AAdU,GAAL;AAAA,CAApB;;eA6Be,wBAAWd,MAAX,EAAmB/B,aAAnB,C","sourcesContent":["import React, { Component } from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport * as color from './color';\n\n//Used these below to replace \\\\embed{newLine} with \\\\newline from prompt which will get parsed in MathJax\nconst NEWLINE_BLOCK_REGEX = /\\\\embed\\{newLine\\}\\[\\]/g;\nconst NEWLINE_LATEX = '\\\\newline ';\n\nexport class PreviewPrompt extends Component {\n static propTypes = {\n classes: PropTypes.object,\n prompt: PropTypes.string,\n tagName: PropTypes.string,\n className: PropTypes.string,\n onClick: PropTypes.func,\n defaultClassName: PropTypes.string\n };\n\n static defaultProps = {\n onClick: () => {}\n };\n\n parsedText = text => {\n // fix imported audio content for Safari PD-1419\n const div = document.createElement('div');\n div.innerHTML = text;\n\n const audio = div.querySelector('audio');\n if (audio) {\n const source = document.createElement('source');\n\n source.setAttribute('type', 'audio/mp3');\n source.setAttribute('src', audio.getAttribute('src'));\n\n audio.removeAttribute('src');\n audio.appendChild(source);\n }\n\n return div.innerHTML;\n };\n\n render() {\n const { prompt, classes, tagName, className, onClick, defaultClassName } = this.props;\n const CustomTag = tagName || 'div';\n const customClasses = `${classes.promptTable} ${classes[className] || ''} ${defaultClassName ||\n ''}`;\n\n return (\n <CustomTag\n onClick={onClick}\n className={customClasses}\n dangerouslySetInnerHTML={{\n __html: this.parsedText(prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX)\n }}\n />\n );\n }\n}\n\nconst styles = theme => ({\n prompt: {\n verticalAlign: 'middle',\n color: color.text()\n },\n rationale: {\n paddingLeft: theme.spacing.unit * 16\n },\n label: {\n color: `${color.text()} !important`, //'var(--choice-input-color, black)',\n display: 'inline-block',\n verticalAlign: 'middle',\n cursor: 'pointer'\n },\n promptTable: {\n '&:not(.MathJax) > table': {\n borderCollapse: 'collapse'\n },\n '&:not(.MathJax) > table tr': {\n '&:nth-child(2n)': {\n backgroundColor: '#f6f8fa'\n }\n },\n '&:not(.MathJax) > table td, &:not(.MathJax) > table th': {\n padding: '.6em 1em',\n textAlign: 'center'\n }\n }\n});\nexport default withStyles(styles)(PreviewPrompt);\n"],"file":"preview-prompt.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/render-ui",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.2",
|
|
4
4
|
"description": "Some shared ui elements when rendering - but not worthy of their own package yet.",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"react": "^16.8.1",
|
|
27
27
|
"react-dom": "^16.8.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "ed8eb5575887c3ea5fdedf0f3a3d5bc64c7890d7"
|
|
30
30
|
}
|
package/src/preview-prompt.jsx
CHANGED
|
@@ -61,12 +61,7 @@ export class PreviewPrompt extends Component {
|
|
|
61
61
|
const styles = theme => ({
|
|
62
62
|
prompt: {
|
|
63
63
|
verticalAlign: 'middle',
|
|
64
|
-
color: color.text()
|
|
65
|
-
display: 'flex',
|
|
66
|
-
flexDirection: 'column',
|
|
67
|
-
'& > *': {
|
|
68
|
-
display: 'flex'
|
|
69
|
-
}
|
|
64
|
+
color: color.text()
|
|
70
65
|
},
|
|
71
66
|
rationale: {
|
|
72
67
|
paddingLeft: theme.spacing.unit * 16
|