@pie-lib/render-ui 4.42.1-mui-update.0 → 4.44.0-mui-update.0

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 CHANGED
@@ -3,51 +3,46 @@
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.42.1-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.42.0-mui-update.0...@pie-lib/render-ui@4.42.1-mui-update.0) (2025-11-20)
6
+ # [4.44.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.43.0-mui-update.0...@pie-lib/render-ui@4.44.0-mui-update.0) (2025-12-02)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * remove carets from [@pie-lib](https://github.com/pie-lib) dependencies and configure lerna to use exact versions ([c9cd800](https://github.com/pie-framework/pie-lib/commit/c9cd800844abca09e7acf1fd35b2ddf51a6d86df))
11
+ * add back muiButton ([b65ddc0](https://github.com/pie-framework/pie-lib/commit/b65ddc06cbb83dda5cc3c04ee60afffb793f1e10))
12
12
 
13
13
 
14
+ ### Features
14
15
 
15
-
16
-
17
- # [4.42.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.41.0-mui-update.0...@pie-lib/render-ui@4.42.0-mui-update.0) (2025-11-20)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * remove carret, point to specific libs version ([09939a5](https://github.com/pie-framework/pie-lib/commit/09939a5aca19d7dda03d62c93d4d524f98dd69da))
16
+ * sync latest changes from dev ([c936e9c](https://github.com/pie-framework/pie-lib/commit/c936e9c7f9e095e7d9b9805ac2bf72bd271e05f1))
23
17
 
24
18
 
25
19
 
26
20
 
27
21
 
28
- # [4.41.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.40.0-mui-update.0...@pie-lib/render-ui@4.41.0-mui-update.0) (2025-11-20)
22
+ ## [4.35.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.35.1...@pie-lib/render-ui@4.35.2) (2025-11-27)
29
23
 
30
24
 
31
25
  ### Bug Fixes
32
26
 
33
- * fix some popper components, fix some math toolbar color ([ed1df55](https://github.com/pie-framework/pie-lib/commit/ed1df558e272686a712767e347df49434790f334))
27
+ * **render-ui:** change unneeded colors overwriting in theme provider PD-5274 ([dbfaed5](https://github.com/pie-framework/pie-lib/commit/dbfaed50feed9c059b14c9835468159858446af1))
28
+ * **render-ui:** handle vertical striping only for tables with th first col PD-5211 ([d32502e](https://github.com/pie-framework/pie-lib/commit/d32502e496fc9a19a6444e537587017c91e87724))
34
29
 
35
30
 
36
31
 
37
32
 
38
33
 
39
- # [4.40.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.39.0-mui-update.0...@pie-lib/render-ui@4.40.0-mui-update.0) (2025-11-19)
34
+ ## [4.35.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.2...@pie-lib/render-ui@4.35.1) (2025-10-22)
40
35
 
41
36
 
42
37
  ### Bug Fixes
43
38
 
44
- * use fixed lib deps ([de7c64d](https://github.com/pie-framework/pie-lib/commit/de7c64d14f13259fe44d47405e4421baef21e24e))
39
+ * bump config-ui PD-5265 ([77d0c78](https://github.com/pie-framework/pie-lib/commit/77d0c78cacfa57e93ed17e7a7f1257f4a9cf6ab3))
45
40
 
46
41
 
47
42
 
48
43
 
49
44
 
50
- # [4.39.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.38.0-mui-update.0...@pie-lib/render-ui@4.39.0-mui-update.0) (2025-11-18)
45
+ # [4.35.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.34.0...@pie-lib/render-ui@4.35.0) (2025-10-16)
51
46
 
52
47
  **Note:** Version bump only for package @pie-lib/render-ui
53
48
 
@@ -55,7 +50,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
55
50
 
56
51
 
57
52
 
58
- # [4.38.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.37.0-mui-update.0...@pie-lib/render-ui@4.38.0-mui-update.0) (2025-11-18)
53
+ # [4.34.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.0...@pie-lib/render-ui@4.34.0) (2025-10-16)
59
54
 
60
55
  **Note:** Version bump only for package @pie-lib/render-ui
61
56
 
@@ -63,30 +58,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
63
58
 
64
59
 
65
60
 
66
- # [4.37.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.36.0-mui-update.0...@pie-lib/render-ui@4.37.0-mui-update.0) (2025-11-17)
67
-
68
-
69
- ### Features
70
-
71
- * add MuiButton style overrides for consistent theming ([8fc184e](https://github.com/pie-framework/pie-lib/commit/8fc184e0eca3425cc76f1f76d8f1f24eb56c0779))
72
-
73
-
74
-
75
-
76
-
77
- # [4.36.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.35.0-mui-update.0...@pie-lib/render-ui@4.36.0-mui-update.0) (2025-11-05)
78
-
79
-
80
- ### Bug Fixes
81
-
82
- * add default props uiLayout, add props for previewLayout ([933e5f7](https://github.com/pie-framework/pie-lib/commit/933e5f71f1f2fff99c57ee5132f9f23ee85c3f28))
83
- * label positioning in input render-ui ([8012817](https://github.com/pie-framework/pie-lib/commit/80128173dc596181de296633e9413bba8b79db81))
84
-
85
-
86
-
87
-
88
-
89
- # [4.35.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.34.0-mui-update.0...@pie-lib/render-ui@4.35.0-mui-update.0) (2025-11-03)
61
+ # [4.33.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.0...@pie-lib/render-ui@4.33.0) (2025-10-16)
90
62
 
91
63
  **Note:** Version bump only for package @pie-lib/render-ui
92
64
 
@@ -94,7 +66,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
94
66
 
95
67
 
96
68
 
97
- # [4.34.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.32.0-mui-update.0...@pie-lib/render-ui@4.34.0-mui-update.0) (2025-11-03)
69
+ # [4.32.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.0...@pie-lib/render-ui@4.32.0) (2025-10-16)
98
70
 
99
71
  **Note:** Version bump only for package @pie-lib/render-ui
100
72
 
@@ -102,23 +74,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
102
74
 
103
75
 
104
76
 
105
- # [4.32.0-mui-update.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.2...@pie-lib/render-ui@4.32.0-mui-update.0) (2025-10-31)
106
-
107
-
108
- ### Bug Fixes
109
-
110
- * update graphing components - styling and correctness handling PD-5258 ([7f1d3ba](https://github.com/pie-framework/pie-lib/commit/7f1d3bade7271c8f95bb9a67352fc9a52888ffda))
111
-
112
-
113
- ### Features
114
-
115
- * bump react and react-dom ([01dc19e](https://github.com/pie-framework/pie-lib/commit/01dc19e88bbc8d372c561d1511df1a82937d45af))
116
- * PD-5258 wip Material-UI migration ([25e60f3](https://github.com/pie-framework/pie-lib/commit/25e60f32602bfd7bfc8b4f9d2dcc3a3cd664e72b))
117
-
118
-
119
-
120
-
121
-
122
77
  ## [4.31.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/render-ui@4.31.1...@pie-lib/render-ui@4.31.2) (2025-10-14)
123
78
 
124
79
  **Note:** Version bump only for package @pie-lib/render-ui
@@ -30,19 +30,15 @@ var StyledPromptContainer = (0, _styles.styled)('div')(function (_ref) {
30
30
  '&:not(.MathJax) > table': {
31
31
  borderCollapse: 'collapse'
32
32
  },
33
- // Apply vertical striping only when first column is a header column (th)
34
- '&:not(.MathJax) > table:has(tr:first-child th:first-child) td': {
35
- '&:nth-child(2n)': {
36
- backgroundColor: '#f6f8fa',
37
- color: theme.palette.common.black
38
- }
33
+ // Apply vertical striping when first column is a header (th) and NOT mixed with td
34
+ '&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)': {
35
+ backgroundColor: '#f6f8fa',
36
+ color: theme.palette.common.black
39
37
  },
40
- // Apply horizontal striping for tables where first element is NOT a header (th)
41
- '&:not(.MathJax) > table:not(:has(tr:first-child th:first-child)) tr': {
42
- '&:nth-child(2n)': {
43
- backgroundColor: '#f6f8fa',
44
- color: theme.palette.common.black
45
- }
38
+ // Apply horizontal striping for tables where first element is a data cell (td)
39
+ '&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td': {
40
+ backgroundColor: '#f6f8fa',
41
+ color: theme.palette.common.black
46
42
  },
47
43
  // align table content to left as per STAR requirement PD-3687
48
44
  '&:not(.MathJax) table td, &:not(.MathJax) table th': {
@@ -1 +1 @@
1
- {"version":3,"file":"preview-prompt.js","names":["_react","_interopRequireWildcard","require","_styles","_propTypes","_interopRequireDefault","color","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","TypeError","a","u","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","prototype","valueOf","StyledPromptContainer","styled","_ref","theme","tagName","borderCollapse","backgroundColor","palette","common","black","padding","textAlign","verticalAlign","text","width","fontSize","paddingLeft","spacing","paddingBottom","concat","display","flexDirection","cursor","margin","NEWLINE_BLOCK_REGEX","NEWLINE_LATEX","PreviewPrompt","exports","_Component","_this","_classCallCheck2","_len","arguments","args","_key","_defineProperty2","customAudioButton","props","div","document","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","style","playButton","id","assign","height","backgroundImage","pauseImage","backgroundSize","borderRadius","border","parentNode","insertBefore","_inherits2","_createClass2","key","addCustomAudioButtonControls","_this$props","autoplayAudioEnabled","getElementById","play","then","addEventListener","handleAudioEnded","error","console","handlePlayClick","paused","includes","playImage","handleAudioPlay","handleAudioPause","_handlePlayClick","_handleAudioPlay","_handleAudioPause","_handleAudioEnded","removeCustomAudioButtonListeners","removeEventListener","componentDidMount","alignImages","componentDidUpdate","componentWillUnmount","previewPrompts","querySelectorAll","forEach","previewPrompt","images","getElementsByTagName","_iterator","_step","image","attributes","alignment","parentElement","copyImage","cloneNode","replaceChild","err","render","_this$props2","prompt","className","onClick","defaultClassName","legendClass","customClasses","trim","as","dangerouslySetInnerHTML","__html","parsedText","replace","Component","PropTypes","string","func","bool","_default"],"sources":["../src/preview-prompt.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport * as color from './color';\n\nconst StyledPromptContainer = styled('div')(({ theme, tagName }) => ({\n // Base promptTable styles\n '&:not(.MathJax) > table': {\n borderCollapse: 'collapse',\n },\n // Apply vertical striping only when first column is a header column (th)\n '&:not(.MathJax) > table:has(tr:first-child th:first-child) td': {\n '&:nth-child(2n)': {\n backgroundColor: '#f6f8fa',\n color: theme.palette.common.black,\n },\n },\n // Apply horizontal striping for tables where first element is NOT a header (th)\n '&:not(.MathJax) > table:not(:has(tr:first-child th:first-child)) tr': {\n '&:nth-child(2n)': {\n backgroundColor: '#f6f8fa',\n color: theme.palette.common.black,\n },\n },\n // align table content to left as per STAR requirement PD-3687\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n // added this to fix alignment of text in prompt imported from studio (PD-3423)\n '&:not(.MathJax) > table td > p.kds-indent': {\n textAlign: 'initial',\n },\n\n // Conditional styles based on class names\n '&.prompt': {\n verticalAlign: 'middle',\n color: color.text(),\n },\n '&.legend': {\n width: '100%',\n fontSize: 'inherit !important',\n },\n '&.rationale': {\n paddingLeft: theme.spacing(4),\n paddingBottom: theme.spacing(1),\n },\n '&.label': {\n color: `${color.text()} !important`,\n display: 'flex',\n flexDirection: 'column',\n verticalAlign: 'middle',\n cursor: 'pointer',\n '& > p': {\n margin: '0 0 0 0 !important',\n },\n },\n}));\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 prompt: PropTypes.string,\n tagName: PropTypes.string,\n className: PropTypes.string,\n onClick: PropTypes.func,\n defaultClassName: PropTypes.string,\n autoplayAudioEnabled: PropTypes.bool,\n customAudioButton: {\n playImage: PropTypes.string,\n pauseImage: PropTypes.string,\n },\n };\n\n static defaultProps = {\n onClick: () => {},\n };\n\n parsedText = (text) => {\n const { customAudioButton } = this.props;\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.setAttribute('id', 'pie-prompt-audio-player');\n\n audio.appendChild(source);\n\n if (customAudioButton) {\n audio.style.display = 'none';\n\n const playButton = document.createElement('div');\n playButton.id = 'play-audio-button';\n\n Object.assign(playButton.style, {\n cursor: 'pointer',\n display: 'block',\n width: '128px',\n height: '128px',\n backgroundImage: `url(${customAudioButton.pauseImage})`,\n backgroundSize: 'cover',\n borderRadius: '50%',\n border: '1px solid #326295',\n });\n\n audio.parentNode.insertBefore(playButton, audio);\n }\n }\n\n return div.innerHTML;\n };\n\n addCustomAudioButtonControls() {\n const { autoplayAudioEnabled, customAudioButton } = this.props;\n const playButton = document.getElementById('play-audio-button');\n const audio = document.getElementById('pie-prompt-audio-player');\n\n if (autoplayAudioEnabled && audio) {\n audio\n .play()\n .then(() => {\n if (playButton && customAudioButton) {\n audio.addEventListener('ended', handleAudioEnded);\n }\n })\n .catch((error) => {\n console.error('Error playing audio', error);\n });\n }\n\n if (!playButton || !audio || !customAudioButton) return;\n\n const handlePlayClick = () => {\n // if already playing, don't play again\n if (!audio.paused) return;\n if (playButton.style.backgroundImage.includes(customAudioButton.pauseImage)) return;\n\n audio.play();\n };\n\n const handleAudioEnded = () => {\n playButton.style.backgroundImage = `url(${customAudioButton.playImage})`;\n };\n\n const handleAudioPlay = () => {\n Object.assign(playButton.style, {\n backgroundImage: `url(${customAudioButton.pauseImage})`,\n border: '1px solid #ccc',\n });\n };\n\n const handleAudioPause = () => {\n Object.assign(playButton.style, {\n backgroundImage: `url(${customAudioButton.playImage})`,\n border: '1px solid #326295',\n });\n };\n\n playButton.addEventListener('click', handlePlayClick);\n audio.addEventListener('play', handleAudioPlay);\n audio.addEventListener('pause', handleAudioPause);\n audio.addEventListener('ended', handleAudioEnded);\n\n // store event handler references so they can be removed later\n this._handlePlayClick = handlePlayClick;\n this._handleAudioPlay = handleAudioPlay;\n this._handleAudioPause = handleAudioPause;\n this._handleAudioEnded = handleAudioEnded;\n }\n\n removeCustomAudioButtonListeners() {\n const playButton = document.getElementById('play-audio-button');\n const audio = document.querySelector('audio');\n\n if (!playButton || !audio) return;\n\n // remove event listeners using stored references\n playButton.removeEventListener('click', this._handlePlayClick);\n audio.removeEventListener('play', this._handleAudioPlay);\n audio.removeEventListener('pause', this._handleAudioPause);\n audio.removeEventListener('ended', this._handleAudioEnded);\n }\n\n componentDidMount() {\n this.alignImages();\n this.addCustomAudioButtonControls();\n }\n\n componentDidUpdate() {\n this.alignImages();\n }\n\n componentWillUnmount() {\n this.removeCustomAudioButtonListeners();\n }\n\n alignImages() {\n const previewPrompts = document.querySelectorAll('#preview-prompt');\n\n previewPrompts.forEach((previewPrompt) => {\n const images = previewPrompt.getElementsByTagName('img');\n\n if (images && images.length) {\n for (let image of images) {\n // check if alignment property was set\n if (image.attributes && image.attributes.alignment && image.attributes.alignment.value) {\n const parentNode = image.parentElement;\n\n // check if div is not already added to dom and replace current image with wrapped image\n if (\n !(\n parentNode.tagName === 'DIV' &&\n parentNode.style.display === 'flex' &&\n parentNode.style.width === '100%'\n )\n ) {\n const div = document.createElement('div');\n div.style.display = 'flex';\n div.style.width = '100%';\n\n const copyImage = image.cloneNode(true);\n div.appendChild(copyImage);\n parentNode.replaceChild(div, image);\n }\n }\n }\n }\n });\n }\n\n render() {\n const { prompt, tagName, className, onClick, defaultClassName } = this.props;\n // legend tag was added once with accessibility tasks, we need extra style to make it work with images alignment\n const legendClass = tagName === 'legend' ? 'legend' : '';\n const customClasses = `${className || ''} ${defaultClassName || ''} ${legendClass}`.trim();\n\n return (\n <StyledPromptContainer\n as={tagName || 'div'}\n id={'preview-prompt'}\n onClick={onClick}\n className={customClasses}\n tagName={tagName}\n dangerouslySetInnerHTML={{\n __html: this.parsedText(prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX),\n }}\n />\n );\n }\n}\n\nexport default PreviewPrompt;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAiC,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,wBAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,g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I,KAAM;QACrB+C,EAAE,EAAE,gBAAiB;QACrB2D,OAAO,EAAEA,OAAQ;QACjBD,SAAS,EAAEI,aAAc;QACzB7G,OAAO,EAAEA,OAAQ;QACjBgH,uBAAuB,EAAE;UACvBC,MAAM,EAAE,IAAI,CAACC,UAAU,CAACV,MAAM,IAAI,EAAE,CAAC,CAACW,OAAO,CAAC/F,mBAAmB,EAAEC,aAAa;QAClF;MAAE,CACH,CAAC;IAEN;EAAC;AAAA,EAnMgC+F,gBAAS;AAAA,IAAArF,gBAAA,aAA/BT,aAAa,eACL;EACjBkF,MAAM,EAAEa,qBAAS,CAACC,MAAM;EACxBtH,OAAO,EAAEqH,qBAAS,CAACC,MAAM;EACzBb,SAAS,EAAEY,qBAAS,CAACC,MAAM;EAC3BZ,OAAO,EAAEW,qBAAS,CAACE,IAAI;EACvBZ,gBAAgB,EAAEU,qBAAS,CAACC,MAAM;EAClCxD,oBAAoB,EAAEuD,qBAAS,CAACG,IAAI;EACpCxF,iBAAiB,EAAE;IACjByC,SAAS,EAAE4C,qBAAS,CAACC,MAAM;IAC3BnE,UAAU,EAAEkE,qBAAS,CAACC;EACxB;AACF,CAAC;AAAA,IAAAvF,gBAAA,aAZUT,aAAa,kBAcF;EACpBoF,OAAO,EAAE,SAATA,OAAOA,CAAA,EAAQ,CAAC;AAClB,CAAC;AAAA,IAAAe,QAAA,GAAAlG,OAAA,cAsLYD,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"preview-prompt.js","names":["_react","_interopRequireWildcard","require","_styles","_propTypes","_interopRequireDefault","color","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","TypeError","a","u","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","prototype","valueOf","StyledPromptContainer","styled","_ref","theme","tagName","borderCollapse","backgroundColor","palette","common","black","padding","textAlign","verticalAlign","text","width","fontSize","paddingLeft","spacing","paddingBottom","concat","display","flexDirection","cursor","margin","NEWLINE_BLOCK_REGEX","NEWLINE_LATEX","PreviewPrompt","exports","_Component","_this","_classCallCheck2","_len","arguments","args","_key","_defineProperty2","customAudioButton","props","div","document","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","style","playButton","id","assign","height","backgroundImage","pauseImage","backgroundSize","borderRadius","border","parentNode","insertBefore","_inherits2","_createClass2","key","addCustomAudioButtonControls","_this$props","autoplayAudioEnabled","getElementById","play","then","addEventListener","handleAudioEnded","error","console","handlePlayClick","paused","includes","playImage","handleAudioPlay","handleAudioPause","_handlePlayClick","_handleAudioPlay","_handleAudioPause","_handleAudioEnded","removeCustomAudioButtonListeners","removeEventListener","componentDidMount","alignImages","componentDidUpdate","componentWillUnmount","previewPrompts","querySelectorAll","forEach","previewPrompt","images","getElementsByTagName","_iterator","_step","image","attributes","alignment","parentElement","copyImage","cloneNode","replaceChild","err","render","_this$props2","prompt","className","onClick","defaultClassName","legendClass","customClasses","trim","as","dangerouslySetInnerHTML","__html","parsedText","replace","Component","PropTypes","string","func","bool","_default"],"sources":["../src/preview-prompt.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport * as color from './color';\n\nconst StyledPromptContainer = styled('div')(({ theme, tagName }) => ({\n // Base promptTable styles\n '&:not(.MathJax) > table': {\n borderCollapse: 'collapse',\n },\n // Apply vertical striping when first column is a header (th) and NOT mixed with td\n '&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)': {\n backgroundColor: '#f6f8fa',\n color: theme.palette.common.black,\n },\n // Apply horizontal striping for tables where first element is a data cell (td)\n '&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td': {\n backgroundColor: '#f6f8fa',\n color: theme.palette.common.black,\n },\n // align table content to left as per STAR requirement PD-3687\n '&:not(.MathJax) table td, &:not(.MathJax) table th': {\n padding: '.6em 1em',\n textAlign: 'left',\n },\n // added this to fix alignment of text in prompt imported from studio (PD-3423)\n '&:not(.MathJax) > table td > p.kds-indent': {\n textAlign: 'initial',\n },\n\n // Conditional styles based on class names\n '&.prompt': {\n verticalAlign: 'middle',\n color: color.text(),\n },\n '&.legend': {\n width: '100%',\n fontSize: 'inherit !important',\n },\n '&.rationale': {\n paddingLeft: theme.spacing(4),\n paddingBottom: theme.spacing(1),\n },\n '&.label': {\n color: `${color.text()} !important`,\n display: 'flex',\n flexDirection: 'column',\n verticalAlign: 'middle',\n cursor: 'pointer',\n '& > p': {\n margin: '0 0 0 0 !important',\n },\n },\n}));\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 prompt: PropTypes.string,\n tagName: PropTypes.string,\n className: PropTypes.string,\n onClick: PropTypes.func,\n defaultClassName: PropTypes.string,\n autoplayAudioEnabled: PropTypes.bool,\n customAudioButton: {\n playImage: PropTypes.string,\n pauseImage: PropTypes.string,\n },\n };\n\n static defaultProps = {\n onClick: () => {},\n };\n\n parsedText = (text) => {\n const { customAudioButton } = this.props;\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.setAttribute('id', 'pie-prompt-audio-player');\n\n audio.appendChild(source);\n\n if (customAudioButton) {\n audio.style.display = 'none';\n\n const playButton = document.createElement('div');\n playButton.id = 'play-audio-button';\n\n Object.assign(playButton.style, {\n cursor: 'pointer',\n display: 'block',\n width: '128px',\n height: '128px',\n backgroundImage: `url(${customAudioButton.pauseImage})`,\n backgroundSize: 'cover',\n borderRadius: '50%',\n border: '1px solid #326295',\n });\n\n audio.parentNode.insertBefore(playButton, audio);\n }\n }\n\n return div.innerHTML;\n };\n\n addCustomAudioButtonControls() {\n const { autoplayAudioEnabled, customAudioButton } = this.props;\n const playButton = document.getElementById('play-audio-button');\n const audio = document.getElementById('pie-prompt-audio-player');\n\n if (autoplayAudioEnabled && audio) {\n audio\n .play()\n .then(() => {\n if (playButton && customAudioButton) {\n audio.addEventListener('ended', handleAudioEnded);\n }\n })\n .catch((error) => {\n console.error('Error playing audio', error);\n });\n }\n\n if (!playButton || !audio || !customAudioButton) return;\n\n const handlePlayClick = () => {\n // if already playing, don't play again\n if (!audio.paused) return;\n if (playButton.style.backgroundImage.includes(customAudioButton.pauseImage)) return;\n\n audio.play();\n };\n\n const handleAudioEnded = () => {\n playButton.style.backgroundImage = `url(${customAudioButton.playImage})`;\n };\n\n const handleAudioPlay = () => {\n Object.assign(playButton.style, {\n backgroundImage: `url(${customAudioButton.pauseImage})`,\n border: '1px solid #ccc',\n });\n };\n\n const handleAudioPause = () => {\n Object.assign(playButton.style, {\n backgroundImage: `url(${customAudioButton.playImage})`,\n border: '1px solid #326295',\n });\n };\n\n playButton.addEventListener('click', handlePlayClick);\n audio.addEventListener('play', handleAudioPlay);\n audio.addEventListener('pause', handleAudioPause);\n audio.addEventListener('ended', handleAudioEnded);\n\n // store event handler references so they can be removed later\n this._handlePlayClick = handlePlayClick;\n this._handleAudioPlay = handleAudioPlay;\n this._handleAudioPause = handleAudioPause;\n this._handleAudioEnded = handleAudioEnded;\n }\n\n removeCustomAudioButtonListeners() {\n const playButton = document.getElementById('play-audio-button');\n const audio = document.querySelector('audio');\n\n if (!playButton || !audio) return;\n\n // remove event listeners using stored references\n playButton.removeEventListener('click', this._handlePlayClick);\n audio.removeEventListener('play', this._handleAudioPlay);\n audio.removeEventListener('pause', this._handleAudioPause);\n audio.removeEventListener('ended', this._handleAudioEnded);\n }\n\n componentDidMount() {\n this.alignImages();\n this.addCustomAudioButtonControls();\n }\n\n componentDidUpdate() {\n this.alignImages();\n }\n\n componentWillUnmount() {\n this.removeCustomAudioButtonListeners();\n }\n\n alignImages() {\n const previewPrompts = document.querySelectorAll('#preview-prompt');\n\n previewPrompts.forEach((previewPrompt) => {\n const images = previewPrompt.getElementsByTagName('img');\n\n if (images && images.length) {\n for (let image of images) {\n // check if alignment property was set\n if (image.attributes && image.attributes.alignment && image.attributes.alignment.value) {\n const parentNode = image.parentElement;\n\n // check if div is not already added to dom and replace current image with wrapped image\n if (\n !(\n parentNode.tagName === 'DIV' &&\n parentNode.style.display === 'flex' &&\n parentNode.style.width === '100%'\n )\n ) {\n const div = document.createElement('div');\n div.style.display = 'flex';\n div.style.width = '100%';\n\n const copyImage = image.cloneNode(true);\n div.appendChild(copyImage);\n parentNode.replaceChild(div, image);\n }\n }\n }\n }\n });\n }\n\n render() {\n const { prompt, tagName, className, onClick, defaultClassName } = this.props;\n // legend tag was added once with accessibility tasks, we need extra style to make it work with images alignment\n const legendClass = tagName === 'legend' ? 'legend' : '';\n const customClasses = `${className || ''} ${defaultClassName || ''} ${legendClass}`.trim();\n\n return (\n <StyledPromptContainer\n as={tagName || 'div'}\n id={'preview-prompt'}\n onClick={onClick}\n className={customClasses}\n tagName={tagName}\n dangerouslySetInnerHTML={{\n __html: this.parsedText(prompt || '').replace(NEWLINE_BLOCK_REGEX, NEWLINE_LATEX),\n }}\n />\n );\n }\n}\n\nexport default PreviewPrompt;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAiC,SAAAD,wBAAAM,CAAA,EAAAC,CAA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F,MAAA,CAAG0F,SAAS,IAAI,EAAE,OAAA1F,MAAA,CAAI4F,gBAAgB,IAAI,EAAE,OAAA5F,MAAA,CAAI6F,WAAW,EAAGE,IAAI,CAAC,CAAC;MAE1F,oBACE9K,MAAA,YAAAoG,aAAA,CAACxC,qBAAqB;QACpBmH,EAAE,EAAE/G,OAAO,IAAI,KAAM;QACrB+C,EAAE,EAAE,gBAAiB;QACrB2D,OAAO,EAAEA,OAAQ;QACjBD,SAAS,EAAEI,aAAc;QACzB7G,OAAO,EAAEA,OAAQ;QACjBgH,uBAAuB,EAAE;UACvBC,MAAM,EAAE,IAAI,CAACC,UAAU,CAACV,MAAM,IAAI,EAAE,CAAC,CAACW,OAAO,CAAC/F,mBAAmB,EAAEC,aAAa;QAClF;MAAE,CACH,CAAC;IAEN;EAAC;AAAA,EAnMgC+F,gBAAS;AAAA,IAAArF,gBAAA,aAA/BT,aAAa,eACL;EACjBkF,MAAM,EAAEa,qBAAS,CAACC,MAAM;EACxBtH,OAAO,EAAEqH,qBAAS,CAACC,MAAM;EACzBb,SAAS,EAAEY,qBAAS,CAACC,MAAM;EAC3BZ,OAAO,EAAEW,qBAAS,CAACE,IAAI;EACvBZ,gBAAgB,EAAEU,qBAAS,CAACC,MAAM;EAClCxD,oBAAoB,EAAEuD,qBAAS,CAACG,IAAI;EACpCxF,iBAAiB,EAAE;IACjByC,SAAS,EAAE4C,qBAAS,CAACC,MAAM;IAC3BnE,UAAU,EAAEkE,qBAAS,CAACC;EACxB;AACF,CAAC;AAAA,IAAAvF,gBAAA,aAZUT,aAAa,kBAcF;EACpBoF,OAAO,EAAE,SAATA,OAAOA,CAAA,EAAQ,CAAC;AAClB,CAAC;AAAA,IAAAe,QAAA,GAAAlG,OAAA,cAsLYD,aAAa","ignoreList":[]}
package/lib/ui-layout.js CHANGED
@@ -39,44 +39,6 @@ var theme = (0, _styles.createTheme)({
39
39
  }
40
40
  }
41
41
  },
42
- MuiRadio: {
43
- styleOverrides: {
44
- root: {
45
- '&.Mui-checked': {
46
- color: '#3f51b5 !important'
47
- }
48
- }
49
- }
50
- },
51
- MuiCheckbox: {
52
- styleOverrides: {
53
- root: {
54
- '&.Mui-checked': {
55
- color: '#3f51b5 !important'
56
- }
57
- }
58
- }
59
- },
60
- MuiTabs: {
61
- styleOverrides: {
62
- root: {
63
- borderBottom: '1px solid #eee'
64
- }
65
- }
66
- },
67
- MuiSwitch: {
68
- styleOverrides: {
69
- root: {
70
- '&.Mui-checked': {
71
- color: '#3f51b5 !important',
72
- '& + .MuiSwitch-track': {
73
- backgroundColor: '#3f51b5 !important',
74
- opacity: 0.5
75
- }
76
- }
77
- }
78
- }
79
- },
80
42
  MuiButton: {
81
43
  styleOverrides: {
82
44
  contained: {
@@ -1 +1 @@
1
- {"version":3,"file":"ui-layout.js","names":["_react","_interopRequireDefault","require","_styles","_propTypes","_classnames","_appendCssRules","_excluded","_excluded2","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","theme","createTheme","typography","fontFamily","palette","action","disabled","components","MuiTypography","styleOverrides","root","MuiRadio","color","MuiCheckbox","MuiTabs","borderBottom","MuiSwitch","backgroundColor","opacity","MuiButton","contained","StyledContainer","styled","fontSize","UiLayout","_AppendCSSRules","props","_this","_classCallCheck2","classesSheet","document","createElement","_inherits2","_createClass2","key","value","computeStyle","fontSizeFactor","getFontSize","element","parseFloat","getComputedStyle","rootFontSize","documentElement","bodyFontSize","body","effectiveFontSize","Math","max","concat","render","_this$props","children","className","rest","_objectWithoutProperties2","extraCSSRules","restProps","style","StyledEngineProvider","injectFirst","ThemeProvider","_extends2","AppendCSSRules","_defineProperty2","PropTypes","string","array","shape","names","arrayOf","rules","classes","number","_default","exports"],"sources":["../src/ui-layout.jsx"],"sourcesContent":["import React from 'react';\nimport { createTheme, ThemeProvider, StyledEngineProvider } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport AppendCSSRules from './append-css-rules';\n\nconst theme = createTheme({\n typography: {\n fontFamily: 'inherit',\n },\n palette: {\n action: {\n disabled: 'rgba(0, 0, 0, 0.54);',\n },\n },\n components: {\n MuiTypography: {\n styleOverrides: {\n root: { fontFamily: 'inherit' },\n },\n },\n MuiRadio: {\n styleOverrides: {\n root: {\n '&.Mui-checked': {\n color: '#3f51b5 !important',\n },\n },\n },\n },\n MuiCheckbox: {\n styleOverrides: {\n root: {\n '&.Mui-checked': {\n color: '#3f51b5 !important',\n },\n },\n },\n },\n MuiTabs: {\n styleOverrides: {\n root: {\n borderBottom: '1px solid #eee',\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n root: {\n '&.Mui-checked': {\n color: '#3f51b5 !important',\n '& + .MuiSwitch-track': {\n backgroundColor: '#3f51b5 !important',\n opacity: 0.5,\n },\n },\n },\n },\n },\n MuiButton: {\n styleOverrides: {\n contained: {\n backgroundColor: '#e0e0e0',\n color: '#000000',\n '&:hover': {\n backgroundColor: '#bdbdbd',\n },\n },\n },\n },\n },\n});\n\nconst StyledContainer = styled('div')({\n // need this because some browsers set their own style on table\n '& table, th, td': {\n fontSize: 'inherit' /* Ensure table elements inherit font size */,\n },\n});\n\nclass UiLayout extends AppendCSSRules {\n static propTypes = {\n className: PropTypes.string,\n children: PropTypes.array,\n extraCSSRules: PropTypes.shape({\n names: PropTypes.arrayOf(PropTypes.string),\n rules: PropTypes.string,\n }),\n classes: PropTypes.shape({\n extraCSSRules: PropTypes.string,\n }),\n fontSizeFactor: PropTypes.number,\n };\n\n static defaultProps = {\n extraCSSRules: {},\n classes: {},\n fontSizeFactor: 1,\n };\n\n constructor(props) {\n super(props);\n this.classesSheet = document.createElement('style');\n }\n\n computeStyle(fontSizeFactor) {\n const getFontSize = (element) => parseFloat(getComputedStyle(element).fontSize);\n\n const rootFontSize = getFontSize(document.documentElement);\n const bodyFontSize = getFontSize(document.body);\n const effectiveFontSize = Math.max(rootFontSize, bodyFontSize);\n\n return fontSizeFactor !== 1 ? { fontSize: `${effectiveFontSize * fontSizeFactor}px` } : null;\n }\n\n render() {\n const { children, className, fontSizeFactor, ...rest } = this.props;\n\n const { extraCSSRules, ...restProps } = rest;\n const style = this.computeStyle(fontSizeFactor);\n\n return (\n <StyledEngineProvider injectFirst>\n <ThemeProvider theme={theme}>\n <StyledContainer className={className} {...restProps} {...(style && { style })}>\n {children}\n </StyledContainer>\n </ThemeProvider>\n </StyledEngineProvider>\n );\n }\n}\n\nexport default UiLayout;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgD,IAAAK,SAAA;EAAAC,UAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,CAAA;AAEhD,IAAMc,KAAK,GAAG,IAAAC,mBAAW,EAAC;EACxBC,UAAU,EAAE;IACVC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPC,MAAM,EAAE;MACNC,QAAQ,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,CAAAkF,aAAa;QAAC7D,KAAK,EAAEA;MAAM,gBAC1BxB,MAAA,YAAAuD,aAAA,CAACV,eAAe,MAAAyC,SAAA;QAACT,SAAS,EAAEA;MAAU,GAAKI,SAAS,EAAOC,KAAK,IAAI;QAAEA,KAAK,EAALA;MAAM,CAAC,GAC1EN,QACc,CACJ,CACK,CAAC;IAE3B;EAAC;AAAA,EAlDoBW,0BAAc;AAAA,IAAAC,gBAAA,aAA/BxC,QAAQ,eACO;EACjB6B,SAAS,EAAEY,qBAAS,CAACC,MAAM;EAC3Bd,QAAQ,EAAEa,qBAAS,CAACE,KAAK;EACzBX,aAAa,EAAES,qBAAS,CAACG,KAAK,CAAC;IAC7BC,KAAK,EAAEJ,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACC,MAAM,CAAC;IAC1CK,KAAK,EAAEN,qBAAS,CAACC;EACnB,CAAC,CAAC;EACFM,OAAO,EAAEP,qBAAS,CAACG,KAAK,CAAC;IACvBZ,aAAa,EAAES,qBAAS,CAACC;EAC3B,CAAC,CAAC;EACF7B,cAAc,EAAE4B,qBAAS,CAACQ;AAC5B,CAAC;AAAA,IAAAT,gBAAA,aAZGxC,QAAQ,kBAcU;EACpBgC,aAAa,EAAE,CAAC,CAAC;EACjBgB,OAAO,EAAE,CAAC,CAAC;EACXnC,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAqC,QAAA,GAAAC,OAAA,cAmCYnD,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"ui-layout.js","names":["_react","_interopRequireDefault","require","_styles","_propTypes","_classnames","_appendCssRules","_excluded","_excluded2","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","theme","createTheme","typography","fontFamily","palette","action","disabled","components","MuiTypography","styleOverrides","root","MuiButton","contained","backgroundColor","color","StyledContainer","styled","fontSize","UiLayout","_AppendCSSRules","props","_this","_classCallCheck2","classesSheet","document","createElement","_inherits2","_createClass2","key","value","computeStyle","fontSizeFactor","getFontSize","element","parseFloat","getComputedStyle","rootFontSize","documentElement","bodyFontSize","body","effectiveFontSize","Math","max","concat","render","_this$props","children","className","rest","_objectWithoutProperties2","extraCSSRules","restProps","style","StyledEngineProvider","injectFirst","ThemeProvider","_extends2","AppendCSSRules","_defineProperty2","PropTypes","string","array","shape","names","arrayOf","rules","classes","number","_default","exports"],"sources":["../src/ui-layout.jsx"],"sourcesContent":["import React from 'react';\nimport { createTheme, ThemeProvider, StyledEngineProvider } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport AppendCSSRules from './append-css-rules';\n\nconst theme = createTheme({\n typography: {\n fontFamily: 'inherit',\n },\n palette: {\n action: {\n disabled: 'rgba(0, 0, 0, 0.54);',\n },\n },\n components: {\n MuiTypography: {\n styleOverrides: {\n root: { fontFamily: 'inherit' },\n },\n },\n MuiButton: {\n styleOverrides: {\n contained: {\n backgroundColor: '#e0e0e0',\n color: '#000000',\n '&:hover': {\n backgroundColor: '#bdbdbd',\n },\n },\n },\n },\n },\n});\n\nconst StyledContainer = styled('div')({\n // need this because some browsers set their own style on table\n '& table, th, td': {\n fontSize: 'inherit' /* Ensure table elements inherit font size */,\n },\n});\n\nclass UiLayout extends AppendCSSRules {\n static propTypes = {\n className: PropTypes.string,\n children: PropTypes.array,\n extraCSSRules: PropTypes.shape({\n names: PropTypes.arrayOf(PropTypes.string),\n rules: PropTypes.string,\n }),\n classes: PropTypes.shape({\n extraCSSRules: PropTypes.string,\n }),\n fontSizeFactor: PropTypes.number,\n };\n\n static defaultProps = {\n extraCSSRules: {},\n classes: {},\n fontSizeFactor: 1,\n };\n\n constructor(props) {\n super(props);\n this.classesSheet = document.createElement('style');\n }\n\n computeStyle(fontSizeFactor) {\n const getFontSize = (element) => parseFloat(getComputedStyle(element).fontSize);\n\n const rootFontSize = getFontSize(document.documentElement);\n const bodyFontSize = getFontSize(document.body);\n const effectiveFontSize = Math.max(rootFontSize, bodyFontSize);\n\n return fontSizeFactor !== 1 ? { fontSize: `${effectiveFontSize * fontSizeFactor}px` } : null;\n }\n\n render() {\n const { children, className, fontSizeFactor, ...rest } = this.props;\n\n const { extraCSSRules, ...restProps } = rest;\n const style = this.computeStyle(fontSizeFactor);\n\n return (\n <StyledEngineProvider injectFirst>\n <ThemeProvider theme={theme}>\n <StyledContainer className={className} {...restProps} {...(style && { style })}>\n {children}\n </StyledContainer>\n </ThemeProvider>\n </StyledEngineProvider>\n );\n }\n}\n\nexport default UiLayout;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgD,IAAAK,SAAA;EAAAC,UAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,CAAA;AAEhD,IAAMc,KAAK,GAAG,IAAAC,mBAAW,EAAC;EACxBC,UAAU,EAAE;IACVC,UAAU,EAAE;EACd,CAAC;EACDC,OAAO,EAAE;IACPC,MAAM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1CK,KAAK,EAAEN,qBAAS,CAACC;EACnB,CAAC,CAAC;EACFM,OAAO,EAAEP,qBAAS,CAACG,KAAK,CAAC;IACvBZ,aAAa,EAAES,qBAAS,CAACC;EAC3B,CAAC,CAAC;EACF7B,cAAc,EAAE4B,qBAAS,CAACQ;AAC5B,CAAC;AAAA,IAAAT,gBAAA,aAZGxC,QAAQ,kBAcU;EACpBgC,aAAa,EAAE,CAAC,CAAC;EACjBgB,OAAO,EAAE,CAAC,CAAC;EACXnC,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAqC,QAAA,GAAAC,OAAA,cAmCYnD,QAAQ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/render-ui",
3
- "version": "4.42.1-mui-update.0",
3
+ "version": "4.44.0-mui-update.0",
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",
@@ -13,9 +13,9 @@
13
13
  "@emotion/styled": "^11.14.1",
14
14
  "@mui/icons-material": "^7.3.4",
15
15
  "@mui/material": "^7.3.4",
16
- "@pie-lib/icons": "2.31.1-mui-update.0",
17
- "@pie-lib/math-rendering": "3.33.1-mui-update.0",
18
- "@pie-lib/test-utils": "0.29.1-mui-update.0",
16
+ "@pie-lib/icons": "2.33.0-mui-update.0",
17
+ "@pie-lib/math-rendering": "3.35.0-mui-update.0",
18
+ "@pie-lib/test-utils": "0.31.0-mui-update.0",
19
19
  "classnames": "^2.2.6",
20
20
  "debug": "^4.1.1",
21
21
  "lodash": "^4.17.11",
@@ -31,5 +31,5 @@
31
31
  "react": "^18.2.0",
32
32
  "react-dom": "^18.2.0"
33
33
  },
34
- "gitHead": "5483c45ebef918678f098167fecdde7190b291dd"
34
+ "gitHead": "23a7cb8864b947778ac7e6dffdc6fa4a74af5927"
35
35
  }
@@ -8,19 +8,15 @@ const StyledPromptContainer = styled('div')(({ theme, tagName }) => ({
8
8
  '&:not(.MathJax) > table': {
9
9
  borderCollapse: 'collapse',
10
10
  },
11
- // Apply vertical striping only when first column is a header column (th)
12
- '&:not(.MathJax) > table:has(tr:first-child th:first-child) td': {
13
- '&:nth-child(2n)': {
14
- backgroundColor: '#f6f8fa',
15
- color: theme.palette.common.black,
16
- },
11
+ // Apply vertical striping when first column is a header (th) and NOT mixed with td
12
+ '&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)': {
13
+ backgroundColor: '#f6f8fa',
14
+ color: theme.palette.common.black,
17
15
  },
18
- // Apply horizontal striping for tables where first element is NOT a header (th)
19
- '&:not(.MathJax) > table:not(:has(tr:first-child th:first-child)) tr': {
20
- '&:nth-child(2n)': {
21
- backgroundColor: '#f6f8fa',
22
- color: theme.palette.common.black,
23
- },
16
+ // Apply horizontal striping for tables where first element is a data cell (td)
17
+ '&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td': {
18
+ backgroundColor: '#f6f8fa',
19
+ color: theme.palette.common.black,
24
20
  },
25
21
  // align table content to left as per STAR requirement PD-3687
26
22
  '&:not(.MathJax) table td, &:not(.MathJax) table th': {
package/src/ui-layout.jsx CHANGED
@@ -20,44 +20,6 @@ const theme = createTheme({
20
20
  root: { fontFamily: 'inherit' },
21
21
  },
22
22
  },
23
- MuiRadio: {
24
- styleOverrides: {
25
- root: {
26
- '&.Mui-checked': {
27
- color: '#3f51b5 !important',
28
- },
29
- },
30
- },
31
- },
32
- MuiCheckbox: {
33
- styleOverrides: {
34
- root: {
35
- '&.Mui-checked': {
36
- color: '#3f51b5 !important',
37
- },
38
- },
39
- },
40
- },
41
- MuiTabs: {
42
- styleOverrides: {
43
- root: {
44
- borderBottom: '1px solid #eee',
45
- },
46
- },
47
- },
48
- MuiSwitch: {
49
- styleOverrides: {
50
- root: {
51
- '&.Mui-checked': {
52
- color: '#3f51b5 !important',
53
- '& + .MuiSwitch-track': {
54
- backgroundColor: '#3f51b5 !important',
55
- opacity: 0.5,
56
- },
57
- },
58
- },
59
- },
60
- },
61
23
  MuiButton: {
62
24
  styleOverrides: {
63
25
  contained: {