@pie-element/passage 3.1.2-next.7 → 3.1.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 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
+ ## [3.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.1.1...@pie-element/passage@3.1.2) (2024-10-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **passage:** add purpose for text PD-4236 ([cf9b38b](https://github.com/pie-framework/pie-elements/commit/cf9b38b56770bc4e9b3613d4adfe5f34e0b28a1f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@3.1.0...@pie-element/passage@3.1.1) (2024-10-03)
7
18
 
8
19
 
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.9.2",
12
12
  "@pie-framework/pie-configure-events": "^1.3.0",
13
- "@pie-lib/pie-toolbox": "2.0.11",
13
+ "@pie-lib/pie-toolbox": "2.0.10",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -234,28 +234,36 @@ var StimulusTabs = /*#__PURE__*/function (_React$Component) {
234
234
  id: "tabpanel-".concat(tab.id),
235
235
  role: "tabpanel",
236
236
  "aria-labelledby": "button-".concat(tab.id)
237
- }, this.renderInstructions(tab.teacherInstructions, disabledTabs), (getContent(tab.title) || getContent(tab.subtitle)) && /*#__PURE__*/_react["default"].createElement("h2", null, getContent(tab.title) && /*#__PURE__*/_react["default"].createElement("div", {
237
+ }, this.renderInstructions(tab.teacherInstructions, disabledTabs), (getContent(tab.title) || getContent(tab.subtitle)) && /*#__PURE__*/_react["default"].createElement("h2", null, getContent(tab.title) && /*#__PURE__*/_react["default"].createElement(_renderUi.Purpose, {
238
+ purpose: "passage-title"
239
+ }, /*#__PURE__*/_react["default"].createElement("div", {
238
240
  className: (0, _classnames["default"])(classes.passageTitle, 'title'),
239
241
  dangerouslySetInnerHTML: {
240
242
  __html: this.parsedText(tab.title)
241
243
  }
242
- }), getContent(tab.subtitle) && /*#__PURE__*/_react["default"].createElement("div", {
244
+ })), getContent(tab.subtitle) && /*#__PURE__*/_react["default"].createElement(_renderUi.Purpose, {
245
+ purpose: "passage-subtitle"
246
+ }, /*#__PURE__*/_react["default"].createElement("div", {
243
247
  className: (0, _classnames["default"])(classes.passageSubtitle, 'subtitle'),
244
248
  dangerouslySetInnerHTML: {
245
249
  __html: this.parsedText(tab.subtitle)
246
250
  }
247
- })), getContent(tab.author) && /*#__PURE__*/_react["default"].createElement("div", {
251
+ }))), getContent(tab.author) && /*#__PURE__*/_react["default"].createElement(_renderUi.Purpose, {
252
+ purpose: "passage-author"
253
+ }, /*#__PURE__*/_react["default"].createElement("div", {
248
254
  className: (0, _classnames["default"])(classes.passageAuthor, 'author'),
249
255
  dangerouslySetInnerHTML: {
250
256
  __html: this.parsedText(tab.author)
251
257
  }
252
- }), getContent(tab.text) && /*#__PURE__*/_react["default"].createElement("div", {
258
+ })), getContent(tab.text) && /*#__PURE__*/_react["default"].createElement(_renderUi.Purpose, {
259
+ purpose: "passage-text"
260
+ }, /*#__PURE__*/_react["default"].createElement("div", {
253
261
  key: tab.id,
254
262
  className: (0, _classnames["default"])(classes.passageText, 'text'),
255
263
  dangerouslySetInnerHTML: {
256
264
  __html: this.parsedText(tab.text)
257
265
  }
258
- }));
266
+ })));
259
267
  }
260
268
  }, {
261
269
  key: "render",
@@ -291,11 +299,13 @@ var StimulusTabs = /*#__PURE__*/function (_React$Component) {
291
299
  className: classes.tab,
292
300
  key: tab.id,
293
301
  id: "button-".concat(tab.id),
294
- label: /*#__PURE__*/_react["default"].createElement("span", {
302
+ label: /*#__PURE__*/_react["default"].createElement(_renderUi.Purpose, {
303
+ purpose: "passage-label"
304
+ }, /*#__PURE__*/_react["default"].createElement("span", {
295
305
  dangerouslySetInnerHTML: {
296
306
  __html: _this2.parsedText(tab.label)
297
307
  }
298
- }),
308
+ })),
299
309
  value: tab.id,
300
310
  tabIndex: activeTab === tab.id ? 0 : -1,
301
311
  "aria-controls": "tabpanel-".concat(tab.id),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/stimulus-tabs.jsx"],"names":["styles","theme","passages","flexGrow","backgroundColor","color","background","text","passage","padding","spacing","unit","passageTitle","fontSize","passageSubtitle","passageAuthor","passageText","stickyTabs","position","top","tab","palette","common","white","black","tabButton","teacherInstructions","marginBottom","getContent","html","replace","StimulusTabs","activeTab","event","setState","setTimeout","tabChangeEvent","CustomEvent","detail","window","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","handleChange","document","getElementById","focus","div","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","disabledTabs","teacherInstructionsDiv","hidden","visible","classes","renderInstructions","title","subtitle","__html","parsedText","author","state","selectedTab","find","map","renderTab","root","flexContainer","label","handleKeyDown","React","Component","propTypes","PropTypes","object","isRequired","arrayOf","shape","number","string","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,QAAQ,EAAE,CADF;AAERC,MAAAA,eAAe,EAAEC,gBAAMC,UAAN,EAFT;AAGRD,MAAAA,KAAK,EAAEA,gBAAME,IAAN;AAHC,KADe;AAMzBC,IAAAA,OAAO,EAAE;AACPJ,MAAAA,eAAe,EAAEC,gBAAMC,UAAN,EADV;AAEPD,MAAAA,KAAK,EAAEA,gBAAME,IAAN,EAFA;AAGPE,MAAAA,OAAO,EAAER,KAAK,CAACS,OAAN,CAAcC,IAAd,GAAq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,sBAAUC,MAAV,CAAiBC,UADH;AAEvB/C,EAAAA,IAAI,EAAE6C,sBAAUG,OAAV,CACJH,sBAAUI,KAAV,CAAgB;AACd5C,IAAAA,EAAE,EAAEwC,sBAAUK,MAAV,CAAiBH,UADP;AAEdP,IAAAA,KAAK,EAAEK,sBAAUM,MAAV,CAAiBJ,UAFV;AAGdnB,IAAAA,KAAK,EAAEiB,sBAAUM,MAAV,CAAiBJ,UAHV;AAIdlB,IAAAA,QAAQ,EAAEgB,sBAAUM,MAJN;AAKdnB,IAAAA,MAAM,EAAEa,sBAAUM,MALJ;AAMdvF,IAAAA,IAAI,EAAEiF,sBAAUM,MAAV,CAAiBJ,UANT;AAOdhE,IAAAA,mBAAmB,EAAE8D,sBAAUM;AAPjB,GAAhB,EAQGJ,UATC,EAUJA,UAZqB;AAavBzB,EAAAA,YAAY,EAAEuB,sBAAUO;AAbD,CAAzB;;eAgBe,wBAAW/F,MAAX,EAAmB+B,YAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapsible, color, PreviewPrompt } from '@pie-lib/pie-toolbox/render-ui';\nimport classNames from 'classnames';\n\nconst styles = (theme) => ({\n passages: {\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n },\n passage: {\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing.unit * 2,\n },\n passageTitle: {\n fontSize: '1.75rem',\n },\n passageSubtitle: {\n fontSize: '1.5rem',\n },\n passageAuthor: {\n fontSize: '1.25rem',\n },\n passageText: {},\n stickyTabs: {\n background: color.background(),\n position: 'sticky',\n top: 0,\n },\n tab: {\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n fontSize: 'inherit',\n color: theme.palette.common.black, // remove when PD-2801 is DONE\n },\n tabButton: {\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n },\n teacherInstructions: {\n marginBottom: theme.spacing.unit * 2,\n },\n});\n\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\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 renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!getContent(teacherInstructions)) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { classes } = this.props;\n\n return (\n <div\n className={classNames(classes.passage, 'passage')}\n key={tab.id}\n id={`tabpanel-${tab.id}`}\n role=\"tabpanel\"\n aria-labelledby={`button-${tab.id}`}\n >\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {(getContent(tab.title) || getContent(tab.subtitle)) && (\n <h2>\n {getContent(tab.title) && (\n <div\n className={classNames(classes.passageTitle, 'title')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }}\n />\n )}\n {getContent(tab.subtitle) && (\n <div\n className={classNames(classes.passageSubtitle, 'subtitle')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }}\n />\n )}\n </h2>\n )}\n\n {getContent(tab.author) && (\n <div\n className={classNames(classes.passageAuthor, 'author')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }}\n />\n )}\n\n {getContent(tab.text) && (\n <div\n key={tab.id}\n className={classNames(classes.passageText, 'text')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.text) }}\n />\n )}\n </div>\n );\n }\n\n render() {\n const { classes, tabs, disabledTabs } = this.props;\n const { activeTab } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n return (\n <div className={classNames(classes.passages, 'passages')}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n classes={{\n root: classes.stickyTabs,\n flexContainer: classes.tabButton,\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab) => (\n <Tab\n className={classes.tab}\n key={tab.id}\n id={`button-${tab.id}`}\n label={<span dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }} />}\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onFocus={() => this.handleChange(null, tab.id)}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </div>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n classes: PropTypes.object.isRequired,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n};\n\nexport default withStyles(styles)(StimulusTabs);\n"],"file":"stimulus-tabs.js"}
1
+ {"version":3,"sources":["../src/stimulus-tabs.jsx"],"names":["styles","theme","passages","flexGrow","backgroundColor","color","background","text","passage","padding","spacing","unit","passageTitle","fontSize","passageSubtitle","passageAuthor","passageText","stickyTabs","position","top","tab","palette","common","white","black","tabButton","teacherInstructions","marginBottom","getContent","html","replace","StimulusTabs","activeTab","event","setState","setTimeout","tabChangeEvent","CustomEvent","detail","window","dispatchEvent","currentTabId","key","tabs","props","newTabIndex","currentIndex","findIndex","id","length","preventDefault","handleChange","document","getElementById","focus","div","createElement","innerHTML","audio","querySelector","source","setAttribute","getAttribute","removeAttribute","appendChild","disabledTabs","teacherInstructionsDiv","hidden","visible","classes","renderInstructions","title","subtitle","__html","parsedText","author","state","selectedTab","find","map","renderTab","root","flexContainer","label","handleKeyDown","React","Component","propTypes","PropTypes","object","isRequired","arrayOf","shape","number","string","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,QAAQ,EAAE,CADF;AAERC,MAAAA,eAAe,EAAEC,gBAAMC,UAAN,EAFT;AAGRD,MAAAA,KAAK,EAAEA,gBAAME,IAAN;AAHC,KADe;AAMzBC,IAAAA,OAAO,EAAE;AACPJ,MAAAA,eAAe,EAAEC,gBAAMC,UAAN,EADV;AAEPD,MAAAA,KAAK,EAAEA,gBAAME,IAAN,EAFA;AAGPE,MAAAA,OAAO,EAAER,KAAK,CAACS,OAAN,CAAcC,IAAd,GAAqB;AAHvB,KANgB;AAWzBC,IAAAA,YAAY,EAAE;AACZC,MAAAA,QAAQ,EAAE;AADE,KAXW;AAczBC,IAAAA,eAAe,EAAE;AACfD,MAAAA,QAAQ,EAAE;AADK,KAdQ;AAiBzBE,IAAAA,aAAa,EAAE;AACbF,MAAAA,QAAQ,EAAE;AADG,KAjBU;AAoBzBG,IAAAA,WAAW,EAAE,EApBY;AAqBzBC,IAAAA,UAAU,EAAE;AACVX,MAAAA,UAAU,EAAED,gBAAMC,UAAN,EADF;AAEVY,MAAAA,QAAQ,EAAE,QAFA;AAGVC,MAAAA,GAAG,EAAE;AAHK,KArBa;AA0BzBC,IAAAA,GAAG,EAAE;AACHd,MAAAA,UAAU,EAAEL,KAAK,CAACoB,OAAN,CAAcC,MAAd,CAAqBC,KAD9B;AACqC;AACxCV,MAAAA,QAAQ,EAAE,SAFP;AAGHR,MAAAA,KAAK,EAAEJ,KAAK,CAACoB,OAAN,CAAcC,MAAd,CAAqBE,KAHzB,CAGgC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AAA,MAAM,EAAEa,sBAAUM,MALJ;AAMdvF,IAAAA,IAAI,EAAEiF,sBAAUM,MAAV,CAAiBJ,UANT;AAOdhE,IAAAA,mBAAmB,EAAE8D,sBAAUM;AAPjB,GAAhB,EAQGJ,UATC,EAUJA,UAZqB;AAavBzB,EAAAA,YAAY,EAAEuB,sBAAUO;AAbD,CAAzB;;eAgBe,wBAAW/F,MAAX,EAAmB+B,YAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapsible, color, PreviewPrompt, Purpose } from '@pie-lib/pie-toolbox/render-ui';\nimport classNames from 'classnames';\n\nconst styles = (theme) => ({\n passages: {\n flexGrow: 1,\n backgroundColor: color.background(),\n color: color.text(),\n },\n passage: {\n backgroundColor: color.background(),\n color: color.text(),\n padding: theme.spacing.unit * 2,\n },\n passageTitle: {\n fontSize: '1.75rem',\n },\n passageSubtitle: {\n fontSize: '1.5rem',\n },\n passageAuthor: {\n fontSize: '1.25rem',\n },\n passageText: {},\n stickyTabs: {\n background: color.background(),\n position: 'sticky',\n top: 0,\n },\n tab: {\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n fontSize: 'inherit',\n color: theme.palette.common.black, // remove when PD-2801 is DONE\n },\n tabButton: {\n background: theme.palette.common.white, // replace with color.background() once PD-2801 is DONE\n },\n teacherInstructions: {\n marginBottom: theme.spacing.unit * 2,\n },\n});\n\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');\n\nclass StimulusTabs extends React.Component {\n state = {\n activeTab: 0,\n };\n\n handleChange = (event, activeTab) => {\n this.setState(() => ({ activeTab }));\n\n setTimeout(() => {\n const tabChangeEvent = new CustomEvent('pie-ui-passage-tabChanged', {\n detail: { tab: activeTab },\n });\n\n window.dispatchEvent(tabChangeEvent);\n });\n };\n\n handleKeyDown = (event, currentTabId) => {\n const { key } = event;\n const { tabs } = this.props;\n\n let newTabIndex = -1;\n const currentIndex = tabs.findIndex((tab) => tab.id === currentTabId);\n\n switch (key) {\n case 'ArrowRight':\n // Move to the next tab\n newTabIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n // Move to the previous tab\n newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n // Commented out ArrowDown and ArrowUp for future vertical tab navigation\n // case 'ArrowDown':\n // // Move to the next tab (for vertical alignment)\n // newTabIndex = (currentIndex + 1) % tabs.length;\n // break;\n // case 'ArrowUp':\n // // Move to the previous tab (for vertical alignment)\n // newTabIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n // break;\n case 'Home':\n // Move to the first tab\n newTabIndex = 0;\n break;\n case 'End':\n // Move to the last tab\n newTabIndex = tabs.length - 1;\n break;\n case 'Enter':\n case ' ':\n // Activate the current tab\n newTabIndex = currentIndex;\n break;\n default:\n break;\n }\n\n if (newTabIndex !== -1) {\n event.preventDefault();\n this.handleChange(event, tabs[newTabIndex].id);\n document.getElementById(`button-${tabs[newTabIndex].id}`).focus();\n }\n };\n\n parsedText = (text = '') => {\n // fix imported audio content for Safari PD-1391\n const div = document.createElement('div');\n div.innerHTML = text.replace(/(<br\\/>\\n)/g, '<br/>');\n\n const audio = div.querySelector('audio');\n\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 renderInstructions(teacherInstructions, disabledTabs = false) {\n if (!getContent(teacherInstructions)) {\n return;\n }\n\n const teacherInstructionsDiv = (\n <PreviewPrompt\n tagName=\"div\"\n className=\"prompt\"\n defaultClassName=\"teacher-instructions\"\n prompt={teacherInstructions}\n />\n );\n\n if (disabledTabs) {\n return teacherInstructionsDiv;\n }\n\n return (\n <Collapsible\n labels={{\n hidden: 'Show Teacher Instructions',\n visible: 'Hide Teacher Instructions',\n }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n );\n }\n\n renderTab(tab, disabledTabs) {\n const { classes } = this.props;\n\n return (\n <div\n className={classNames(classes.passage, 'passage')}\n key={tab.id}\n id={`tabpanel-${tab.id}`}\n role=\"tabpanel\"\n aria-labelledby={`button-${tab.id}`}\n >\n {this.renderInstructions(tab.teacherInstructions, disabledTabs)}\n\n {(getContent(tab.title) || getContent(tab.subtitle)) && (\n <h2>\n {getContent(tab.title) && (\n <Purpose purpose=\"passage-title\">\n <div\n className={classNames(classes.passageTitle, 'title')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.title) }}\n />\n </Purpose>\n )}\n {getContent(tab.subtitle) && (\n <Purpose purpose=\"passage-subtitle\">\n <div\n className={classNames(classes.passageSubtitle, 'subtitle')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.subtitle) }}\n />\n </Purpose>\n )}\n </h2>\n )}\n\n {getContent(tab.author) && (\n <Purpose purpose=\"passage-author\">\n <div\n className={classNames(classes.passageAuthor, 'author')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.author) }}\n />\n </Purpose>\n )}\n\n {getContent(tab.text) && (\n <Purpose purpose=\"passage-text\">\n <div\n key={tab.id}\n className={classNames(classes.passageText, 'text')}\n dangerouslySetInnerHTML={{ __html: this.parsedText(tab.text) }}\n />\n </Purpose>\n )}\n </div>\n );\n }\n\n render() {\n const { classes, tabs, disabledTabs } = this.props;\n const { activeTab } = this.state;\n\n if (!tabs?.length) {\n return;\n }\n\n const selectedTab = (tabs || []).find((tab) => tab.id === activeTab);\n\n return (\n <div className={classNames(classes.passages, 'passages')}>\n {disabledTabs || tabs.length === 1 ? (\n tabs.map((tab) => this.renderTab(tab, disabledTabs))\n ) : (\n <>\n <Tabs\n classes={{\n root: classes.stickyTabs,\n flexContainer: classes.tabButton,\n }}\n value={activeTab}\n onChange={this.handleChange}\n >\n {tabs.map((tab) => (\n <Tab\n className={classes.tab}\n key={tab.id}\n id={`button-${tab.id}`}\n label={\n <Purpose purpose=\"passage-label\">\n <span dangerouslySetInnerHTML={{ __html: this.parsedText(tab.label) }} />\n </Purpose>\n }\n value={tab.id}\n tabIndex={activeTab === tab.id ? 0 : -1}\n aria-controls={`tabpanel-${tab.id}`}\n aria-selected={activeTab === tab.id}\n onFocus={() => this.handleChange(null, tab.id)}\n onKeyDown={(event) => this.handleKeyDown(event, tab.id)}\n />\n ))}\n </Tabs>\n {selectedTab ? this.renderTab(selectedTab, disabledTabs) : null}\n </>\n )}\n </div>\n );\n }\n}\n\nStimulusTabs.propTypes = {\n classes: PropTypes.object.isRequired,\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n author: PropTypes.string,\n text: PropTypes.string.isRequired,\n teacherInstructions: PropTypes.string,\n }).isRequired,\n ).isRequired,\n disabledTabs: PropTypes.bool,\n};\n\nexport default withStyles(styles)(StimulusTabs);\n"],"file":"stimulus-tabs.js"}
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.9/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/module/element.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.9/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -8581,6 +8581,7 @@ const classNames = _dll_classnames;
8581
8581
  const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
8582
8582
  const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
8583
8583
  const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
8584
+ const {Purpose: Purpose} = _dll_pie_lib__pie_toolbox_render_ui;
8584
8585
  const _jsxFileName = "/home/circleci/repo/packages/passage/src/stimulus-tabs.jsx";
8585
8586
  function _optionalChain(ops) {
8586
8587
  let lastAccessLHS = undefined;
@@ -8765,7 +8766,14 @@ class StimulusTabs extends React$1.Component {
8765
8766
  fileName: _jsxFileName,
8766
8767
  lineNumber: 180
8767
8768
  }
8768
- }, getContent(tab.title) && React$1.createElement('div', {
8769
+ }, getContent(tab.title) && React$1.createElement(Purpose, {
8770
+ purpose: "passage-title",
8771
+ __self: this,
8772
+ __source: {
8773
+ fileName: _jsxFileName,
8774
+ lineNumber: 182
8775
+ }
8776
+ }, React$1.createElement('div', {
8769
8777
  className: classNames(classes.passageTitle, 'title'),
8770
8778
  dangerouslySetInnerHTML: {
8771
8779
  __html: this.parsedText(tab.title)
@@ -8773,9 +8781,16 @@ class StimulusTabs extends React$1.Component {
8773
8781
  __self: this,
8774
8782
  __source: {
8775
8783
  fileName: _jsxFileName,
8776
- lineNumber: 182
8784
+ lineNumber: 183
8777
8785
  }
8778
- }), getContent(tab.subtitle) && React$1.createElement('div', {
8786
+ })), getContent(tab.subtitle) && React$1.createElement(Purpose, {
8787
+ purpose: "passage-subtitle",
8788
+ __self: this,
8789
+ __source: {
8790
+ fileName: _jsxFileName,
8791
+ lineNumber: 190
8792
+ }
8793
+ }, React$1.createElement('div', {
8779
8794
  className: classNames(classes.passageSubtitle, 'subtitle'),
8780
8795
  dangerouslySetInnerHTML: {
8781
8796
  __html: this.parsedText(tab.subtitle)
@@ -8783,9 +8798,16 @@ class StimulusTabs extends React$1.Component {
8783
8798
  __self: this,
8784
8799
  __source: {
8785
8800
  fileName: _jsxFileName,
8786
- lineNumber: 188
8801
+ lineNumber: 191
8802
+ }
8803
+ }))), getContent(tab.author) && React$1.createElement(Purpose, {
8804
+ purpose: "passage-author",
8805
+ __self: this,
8806
+ __source: {
8807
+ fileName: _jsxFileName,
8808
+ lineNumber: 201
8787
8809
  }
8788
- })), getContent(tab.author) && React$1.createElement('div', {
8810
+ }, React$1.createElement('div', {
8789
8811
  className: classNames(classes.passageAuthor, 'author'),
8790
8812
  dangerouslySetInnerHTML: {
8791
8813
  __html: this.parsedText(tab.author)
@@ -8793,9 +8815,16 @@ class StimulusTabs extends React$1.Component {
8793
8815
  __self: this,
8794
8816
  __source: {
8795
8817
  fileName: _jsxFileName,
8796
- lineNumber: 197
8818
+ lineNumber: 202
8797
8819
  }
8798
- }), getContent(tab.text) && React$1.createElement('div', {
8820
+ })), getContent(tab.text) && React$1.createElement(Purpose, {
8821
+ purpose: "passage-text",
8822
+ __self: this,
8823
+ __source: {
8824
+ fileName: _jsxFileName,
8825
+ lineNumber: 210
8826
+ }
8827
+ }, React$1.createElement('div', {
8799
8828
  key: tab.id,
8800
8829
  className: classNames(classes.passageText, 'text'),
8801
8830
  dangerouslySetInnerHTML: {
@@ -8804,9 +8833,9 @@ class StimulusTabs extends React$1.Component {
8804
8833
  __self: this,
8805
8834
  __source: {
8806
8835
  fileName: _jsxFileName,
8807
- lineNumber: 204
8836
+ lineNumber: 211
8808
8837
  }
8809
- }));
8838
+ })));
8810
8839
  }
8811
8840
  render() {
8812
8841
  const {classes, tabs, disabledTabs} = this.props;
@@ -8820,7 +8849,7 @@ class StimulusTabs extends React$1.Component {
8820
8849
  __self: this,
8821
8850
  __source: {
8822
8851
  fileName: _jsxFileName,
8823
- lineNumber: 225
8852
+ lineNumber: 233
8824
8853
  }
8825
8854
  }, disabledTabs || tabs.length === 1 ? tabs.map(tab => this.renderTab(tab, disabledTabs)) : React$1.createElement(React$1.Fragment, null, React$1.createElement(Tabs, {
8826
8855
  classes: {
@@ -8832,22 +8861,29 @@ class StimulusTabs extends React$1.Component {
8832
8861
  __self: this,
8833
8862
  __source: {
8834
8863
  fileName: _jsxFileName,
8835
- lineNumber: 230
8864
+ lineNumber: 238
8836
8865
  }
8837
8866
  }, tabs.map(tab => React$1.createElement(Tab, {
8838
8867
  className: classes.tab,
8839
8868
  key: tab.id,
8840
8869
  id: `button-${tab.id}`,
8841
- label: React$1.createElement('span', {
8870
+ label: React$1.createElement(Purpose, {
8871
+ purpose: "passage-label",
8872
+ __self: this,
8873
+ __source: {
8874
+ fileName: _jsxFileName,
8875
+ lineNumber: 252
8876
+ }
8877
+ }, React$1.createElement('span', {
8842
8878
  dangerouslySetInnerHTML: {
8843
8879
  __html: this.parsedText(tab.label)
8844
8880
  },
8845
8881
  __self: this,
8846
8882
  __source: {
8847
8883
  fileName: _jsxFileName,
8848
- lineNumber: 243
8884
+ lineNumber: 253
8849
8885
  }
8850
- }),
8886
+ })),
8851
8887
  value: tab.id,
8852
8888
  tabIndex: activeTab === tab.id ? 0 : -1,
8853
8889
  'aria-controls': `tabpanel-${tab.id}`,
@@ -8857,7 +8893,7 @@ class StimulusTabs extends React$1.Component {
8857
8893
  __self: this,
8858
8894
  __source: {
8859
8895
  fileName: _jsxFileName,
8860
- lineNumber: 239
8896
+ lineNumber: 247
8861
8897
  }
8862
8898
  }))), selectedTab ? this.renderTab(selectedTab, disabledTabs) : null));
8863
8899
  }
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "2.0.9"
7
+ "version": "2.0.11"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.0.6"
11
+ "version": "5.0.7"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.9/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.6/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
5
5
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -8544,6 +8544,7 @@ const classNames = _dll_classnames;
8544
8544
  const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
8545
8545
  const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
8546
8546
  const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
8547
+ const {Purpose: Purpose} = _dll_pie_lib__pie_toolbox_render_ui;
8547
8548
  const _jsxFileName = "/home/circleci/repo/packages/passage/src/stimulus-tabs.jsx";
8548
8549
  function _optionalChain(ops) {
8549
8550
  let lastAccessLHS = undefined;
@@ -8728,7 +8729,14 @@ class StimulusTabs extends React$1.Component {
8728
8729
  fileName: _jsxFileName,
8729
8730
  lineNumber: 180
8730
8731
  }
8731
- }, getContent(tab.title) && React$1.createElement('div', {
8732
+ }, getContent(tab.title) && React$1.createElement(Purpose, {
8733
+ purpose: "passage-title",
8734
+ __self: this,
8735
+ __source: {
8736
+ fileName: _jsxFileName,
8737
+ lineNumber: 182
8738
+ }
8739
+ }, React$1.createElement('div', {
8732
8740
  className: classNames(classes.passageTitle, 'title'),
8733
8741
  dangerouslySetInnerHTML: {
8734
8742
  __html: this.parsedText(tab.title)
@@ -8736,9 +8744,16 @@ class StimulusTabs extends React$1.Component {
8736
8744
  __self: this,
8737
8745
  __source: {
8738
8746
  fileName: _jsxFileName,
8739
- lineNumber: 182
8747
+ lineNumber: 183
8740
8748
  }
8741
- }), getContent(tab.subtitle) && React$1.createElement('div', {
8749
+ })), getContent(tab.subtitle) && React$1.createElement(Purpose, {
8750
+ purpose: "passage-subtitle",
8751
+ __self: this,
8752
+ __source: {
8753
+ fileName: _jsxFileName,
8754
+ lineNumber: 190
8755
+ }
8756
+ }, React$1.createElement('div', {
8742
8757
  className: classNames(classes.passageSubtitle, 'subtitle'),
8743
8758
  dangerouslySetInnerHTML: {
8744
8759
  __html: this.parsedText(tab.subtitle)
@@ -8746,9 +8761,16 @@ class StimulusTabs extends React$1.Component {
8746
8761
  __self: this,
8747
8762
  __source: {
8748
8763
  fileName: _jsxFileName,
8749
- lineNumber: 188
8764
+ lineNumber: 191
8765
+ }
8766
+ }))), getContent(tab.author) && React$1.createElement(Purpose, {
8767
+ purpose: "passage-author",
8768
+ __self: this,
8769
+ __source: {
8770
+ fileName: _jsxFileName,
8771
+ lineNumber: 201
8750
8772
  }
8751
- })), getContent(tab.author) && React$1.createElement('div', {
8773
+ }, React$1.createElement('div', {
8752
8774
  className: classNames(classes.passageAuthor, 'author'),
8753
8775
  dangerouslySetInnerHTML: {
8754
8776
  __html: this.parsedText(tab.author)
@@ -8756,9 +8778,16 @@ class StimulusTabs extends React$1.Component {
8756
8778
  __self: this,
8757
8779
  __source: {
8758
8780
  fileName: _jsxFileName,
8759
- lineNumber: 197
8781
+ lineNumber: 202
8760
8782
  }
8761
- }), getContent(tab.text) && React$1.createElement('div', {
8783
+ })), getContent(tab.text) && React$1.createElement(Purpose, {
8784
+ purpose: "passage-text",
8785
+ __self: this,
8786
+ __source: {
8787
+ fileName: _jsxFileName,
8788
+ lineNumber: 210
8789
+ }
8790
+ }, React$1.createElement('div', {
8762
8791
  key: tab.id,
8763
8792
  className: classNames(classes.passageText, 'text'),
8764
8793
  dangerouslySetInnerHTML: {
@@ -8767,9 +8796,9 @@ class StimulusTabs extends React$1.Component {
8767
8796
  __self: this,
8768
8797
  __source: {
8769
8798
  fileName: _jsxFileName,
8770
- lineNumber: 204
8799
+ lineNumber: 211
8771
8800
  }
8772
- }));
8801
+ })));
8773
8802
  }
8774
8803
  render() {
8775
8804
  const {classes, tabs, disabledTabs} = this.props;
@@ -8783,7 +8812,7 @@ class StimulusTabs extends React$1.Component {
8783
8812
  __self: this,
8784
8813
  __source: {
8785
8814
  fileName: _jsxFileName,
8786
- lineNumber: 225
8815
+ lineNumber: 233
8787
8816
  }
8788
8817
  }, disabledTabs || tabs.length === 1 ? tabs.map(tab => this.renderTab(tab, disabledTabs)) : React$1.createElement(React$1.Fragment, null, React$1.createElement(Tabs, {
8789
8818
  classes: {
@@ -8795,22 +8824,29 @@ class StimulusTabs extends React$1.Component {
8795
8824
  __self: this,
8796
8825
  __source: {
8797
8826
  fileName: _jsxFileName,
8798
- lineNumber: 230
8827
+ lineNumber: 238
8799
8828
  }
8800
8829
  }, tabs.map(tab => React$1.createElement(Tab, {
8801
8830
  className: classes.tab,
8802
8831
  key: tab.id,
8803
8832
  id: `button-${tab.id}`,
8804
- label: React$1.createElement('span', {
8833
+ label: React$1.createElement(Purpose, {
8834
+ purpose: "passage-label",
8835
+ __self: this,
8836
+ __source: {
8837
+ fileName: _jsxFileName,
8838
+ lineNumber: 252
8839
+ }
8840
+ }, React$1.createElement('span', {
8805
8841
  dangerouslySetInnerHTML: {
8806
8842
  __html: this.parsedText(tab.label)
8807
8843
  },
8808
8844
  __self: this,
8809
8845
  __source: {
8810
8846
  fileName: _jsxFileName,
8811
- lineNumber: 243
8847
+ lineNumber: 253
8812
8848
  }
8813
- }),
8849
+ })),
8814
8850
  value: tab.id,
8815
8851
  tabIndex: activeTab === tab.id ? 0 : -1,
8816
8852
  'aria-controls': `tabpanel-${tab.id}`,
@@ -8820,7 +8856,7 @@ class StimulusTabs extends React$1.Component {
8820
8856
  __self: this,
8821
8857
  __source: {
8822
8858
  fileName: _jsxFileName,
8823
- lineNumber: 239
8859
+ lineNumber: 247
8824
8860
  }
8825
8861
  }))), selectedTab ? this.renderTab(selectedTab, disabledTabs) : null));
8826
8862
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
- "version": "3.1.2-next.7+ee3208947",
3
+ "version": "3.1.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,13 +11,13 @@
11
11
  "dependencies": {
12
12
  "@material-ui/core": "^3.9.2",
13
13
  "@pie-framework/pie-player-events": "^0.1.0",
14
- "@pie-lib/pie-toolbox": "2.0.11",
14
+ "@pie-lib/pie-toolbox": "2.0.10",
15
15
  "classnames": "^2.2.5",
16
16
  "prop-types": "^15.6.1",
17
17
  "react": "^16.8.1",
18
18
  "react-dom": "^16.8.1"
19
19
  },
20
- "gitHead": "ee32089478956077a916250c738ef5681176da84",
20
+ "gitHead": "0baeea9e7875de62cba333ddf30c621ac96e3634",
21
21
  "scripts": {
22
22
  "postpublish": "../../scripts/postpublish"
23
23
  },