@pie-lib/render-ui 4.12.1-next.93 → 4.12.1-next.97
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/preview-prompt.js
CHANGED
|
@@ -140,13 +140,11 @@ var styles = function styles(theme) {
|
|
|
140
140
|
borderCollapse: 'collapse'
|
|
141
141
|
},
|
|
142
142
|
'&:not(.MathJax) > table tr': {
|
|
143
|
-
borderTop: '1px solid #dfe2e5',
|
|
144
143
|
'&:nth-child(2n)': {
|
|
145
144
|
backgroundColor: '#f6f8fa'
|
|
146
145
|
}
|
|
147
146
|
},
|
|
148
147
|
'&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
|
|
149
|
-
border: '1px solid #dfe2e5',
|
|
150
148
|
padding: '.6em 1em',
|
|
151
149
|
textAlign: 'center'
|
|
152
150
|
}
|
|
@@ -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","rationale","paddingLeft","spacing","unit","label","display","cursor","borderCollapse","
|
|
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;;;;;;;;;;;;;;;;;;;;;;;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AdU,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.12.1-next.
|
|
3
|
+
"version": "4.12.1-next.97+b14d33a5",
|
|
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": "b14d33a58f38859a692739e4921eb66676a9a919"
|
|
30
30
|
}
|
package/src/preview-prompt.jsx
CHANGED
|
@@ -77,13 +77,11 @@ const styles = theme => ({
|
|
|
77
77
|
borderCollapse: 'collapse'
|
|
78
78
|
},
|
|
79
79
|
'&:not(.MathJax) > table tr': {
|
|
80
|
-
borderTop: '1px solid #dfe2e5',
|
|
81
80
|
'&:nth-child(2n)': {
|
|
82
81
|
backgroundColor: '#f6f8fa'
|
|
83
82
|
}
|
|
84
83
|
},
|
|
85
84
|
'&:not(.MathJax) > table td, &:not(.MathJax) > table th': {
|
|
86
|
-
border: '1px solid #dfe2e5',
|
|
87
85
|
padding: '.6em 1em',
|
|
88
86
|
textAlign: 'center'
|
|
89
87
|
}
|