@pie-element/passage 2.3.2-next.29 → 2.3.2-next.36
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/controller/lib/index.js +19 -11
- package/controller/lib/index.js.map +1 -1
- package/docs/demo/generate.js +1 -0
- package/lib/index.js +7 -2
- package/lib/index.js.map +1 -1
- package/lib/print.js +13 -4
- package/lib/print.js.map +1 -1
- package/lib/stimulus-tabs.js +40 -7
- package/lib/stimulus-tabs.js.map +1 -1
- package/module/controller.js +2797 -5
- package/module/demo.js +1 -0
- package/module/element.js +66 -26
- package/module/manifest.json +1 -1
- package/module/print-demo.js +1 -0
- package/module/print.js +79 -33
- package/package.json +3 -3
package/module/demo.js
CHANGED
|
@@ -8,6 +8,7 @@ generate.model = (id, element) => ({
|
|
|
8
8
|
element,
|
|
9
9
|
passages: [
|
|
10
10
|
{
|
|
11
|
+
teacherInstructions: 'Teacher instructions tab 1',
|
|
11
12
|
title: 'Hope Is the Thing with Feathers',
|
|
12
13
|
text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I’ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p><p><span class="no-number">"Hope is the Thing With Feathers" by Emily Dickinson, from <em>The Complete Poems of Emily Dickinson</em>. In the public domain.</span></p>',
|
|
13
14
|
},
|
package/module/element.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.0
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.1.0/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/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) {
|
|
@@ -8578,7 +8578,9 @@ getDefaultExportFromCjs(styles$1);
|
|
|
8578
8578
|
const React$1 = _dll_react;
|
|
8579
8579
|
const PropTypes = _dll_prop_types;
|
|
8580
8580
|
const classNames = _dll_classnames;
|
|
8581
|
+
const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8581
8582
|
const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8583
|
+
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8582
8584
|
const {Purpose: Purpose} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8583
8585
|
const _jsxFileName = "/home/circleci/repo/packages/passage/src/stimulus-tabs.jsx";
|
|
8584
8586
|
const styles = theme => ({
|
|
@@ -8613,6 +8615,9 @@ const styles = theme => ({
|
|
|
8613
8615
|
},
|
|
8614
8616
|
breakSpaces: {
|
|
8615
8617
|
whiteSpace: 'break-spaces'
|
|
8618
|
+
},
|
|
8619
|
+
teacherInstructions: {
|
|
8620
|
+
marginBottom: theme.spacing.unit * 2
|
|
8616
8621
|
}
|
|
8617
8622
|
});
|
|
8618
8623
|
class StimulusTabs extends React$1.Component {
|
|
@@ -8690,8 +8695,38 @@ class StimulusTabs extends React$1.Component {
|
|
|
8690
8695
|
return div.innerHTML;
|
|
8691
8696
|
};
|
|
8692
8697
|
}
|
|
8698
|
+
renderInstructions(showTeacherInstructions, teacherInstructions, disabledTabs = false) {
|
|
8699
|
+
if (!showTeacherInstructions || !teacherInstructions) {
|
|
8700
|
+
return;
|
|
8701
|
+
}
|
|
8702
|
+
const teacherInstructionsDiv = React$1.createElement(PreviewPrompt, {
|
|
8703
|
+
tagName: "div",
|
|
8704
|
+
className: "prompt",
|
|
8705
|
+
defaultClassName: "teacher-instructions",
|
|
8706
|
+
prompt: teacherInstructions,
|
|
8707
|
+
__self: this,
|
|
8708
|
+
__source: {
|
|
8709
|
+
fileName: _jsxFileName,
|
|
8710
|
+
lineNumber: 126
|
|
8711
|
+
}
|
|
8712
|
+
});
|
|
8713
|
+
if (disabledTabs) {
|
|
8714
|
+
return teacherInstructionsDiv;
|
|
8715
|
+
}
|
|
8716
|
+
return React$1.createElement(Collapsible, {
|
|
8717
|
+
labels: {
|
|
8718
|
+
hidden: 'Show Teacher Instructions',
|
|
8719
|
+
visible: 'Hide Teacher Instructions'
|
|
8720
|
+
},
|
|
8721
|
+
__self: this,
|
|
8722
|
+
__source: {
|
|
8723
|
+
fileName: _jsxFileName,
|
|
8724
|
+
lineNumber: 139
|
|
8725
|
+
}
|
|
8726
|
+
}, teacherInstructionsDiv);
|
|
8727
|
+
}
|
|
8693
8728
|
render() {
|
|
8694
|
-
const {classes, tabs, disabledTabs} = this.props;
|
|
8729
|
+
const {classes, tabs, disabledTabs, showTeacherInstructions} = this.props;
|
|
8695
8730
|
const {activeTab} = this.state;
|
|
8696
8731
|
if (tabs && tabs.length > 1) {
|
|
8697
8732
|
return disabledTabs ? React$1.createElement('div', {
|
|
@@ -8699,7 +8734,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8699
8734
|
__self: this,
|
|
8700
8735
|
__source: {
|
|
8701
8736
|
fileName: _jsxFileName,
|
|
8702
|
-
lineNumber:
|
|
8737
|
+
lineNumber: 156
|
|
8703
8738
|
}
|
|
8704
8739
|
}, tabs.map(tab => React$1.createElement('div', {
|
|
8705
8740
|
key: tab.id,
|
|
@@ -8711,7 +8746,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8711
8746
|
__self: this,
|
|
8712
8747
|
__source: {
|
|
8713
8748
|
fileName: _jsxFileName,
|
|
8714
|
-
lineNumber:
|
|
8749
|
+
lineNumber: 158
|
|
8715
8750
|
}
|
|
8716
8751
|
}, React$1.createElement('div', {
|
|
8717
8752
|
className: classes.tabContainer,
|
|
@@ -8721,7 +8756,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8721
8756
|
__self: this,
|
|
8722
8757
|
__source: {
|
|
8723
8758
|
fileName: _jsxFileName,
|
|
8724
|
-
lineNumber:
|
|
8759
|
+
lineNumber: 166
|
|
8725
8760
|
}
|
|
8726
8761
|
}, React$1.createElement('div', {
|
|
8727
8762
|
className: classNames(classes.title, 'title'),
|
|
@@ -8731,14 +8766,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8731
8766
|
__self: this,
|
|
8732
8767
|
__source: {
|
|
8733
8768
|
fileName: _jsxFileName,
|
|
8734
|
-
lineNumber:
|
|
8769
|
+
lineNumber: 172
|
|
8735
8770
|
}
|
|
8736
|
-
}), React$1.createElement(Purpose, {
|
|
8771
|
+
}), this.renderInstructions(showTeacherInstructions, tab.teacherInstructions, disabledTabs), React$1.createElement(Purpose, {
|
|
8737
8772
|
purpose: "passage-text",
|
|
8738
8773
|
__self: this,
|
|
8739
8774
|
__source: {
|
|
8740
8775
|
fileName: _jsxFileName,
|
|
8741
|
-
lineNumber:
|
|
8776
|
+
lineNumber: 177
|
|
8742
8777
|
}
|
|
8743
8778
|
}, React$1.createElement('div', {
|
|
8744
8779
|
className: "text",
|
|
@@ -8749,14 +8784,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8749
8784
|
__self: this,
|
|
8750
8785
|
__source: {
|
|
8751
8786
|
fileName: _jsxFileName,
|
|
8752
|
-
lineNumber:
|
|
8787
|
+
lineNumber: 178
|
|
8753
8788
|
}
|
|
8754
8789
|
})))))) : React$1.createElement('div', {
|
|
8755
8790
|
className: classNames(classes.root, 'passages'),
|
|
8756
8791
|
__self: this,
|
|
8757
8792
|
__source: {
|
|
8758
8793
|
fileName: _jsxFileName,
|
|
8759
|
-
lineNumber:
|
|
8794
|
+
lineNumber: 185
|
|
8760
8795
|
}
|
|
8761
8796
|
}, React$1.createElement(Tabs, {
|
|
8762
8797
|
classes: {
|
|
@@ -8768,7 +8803,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8768
8803
|
__self: this,
|
|
8769
8804
|
__source: {
|
|
8770
8805
|
fileName: _jsxFileName,
|
|
8771
|
-
lineNumber:
|
|
8806
|
+
lineNumber: 186
|
|
8772
8807
|
}
|
|
8773
8808
|
}, tabs.map(tab => React$1.createElement(Tab, {
|
|
8774
8809
|
className: classes.tab,
|
|
@@ -8779,7 +8814,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8779
8814
|
__self: this,
|
|
8780
8815
|
__source: {
|
|
8781
8816
|
fileName: _jsxFileName,
|
|
8782
|
-
lineNumber:
|
|
8817
|
+
lineNumber: 200
|
|
8783
8818
|
}
|
|
8784
8819
|
}, React$1.createElement('span', {
|
|
8785
8820
|
dangerouslySetInnerHTML: {
|
|
@@ -8788,7 +8823,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8788
8823
|
__self: this,
|
|
8789
8824
|
__source: {
|
|
8790
8825
|
fileName: _jsxFileName,
|
|
8791
|
-
lineNumber:
|
|
8826
|
+
lineNumber: 201
|
|
8792
8827
|
}
|
|
8793
8828
|
})),
|
|
8794
8829
|
value: tab.id,
|
|
@@ -8800,7 +8835,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8800
8835
|
__self: this,
|
|
8801
8836
|
__source: {
|
|
8802
8837
|
fileName: _jsxFileName,
|
|
8803
|
-
lineNumber:
|
|
8838
|
+
lineNumber: 195
|
|
8804
8839
|
}
|
|
8805
8840
|
}))), tabs.map(tab => activeTab === tab.id ? React$1.createElement('div', {
|
|
8806
8841
|
className: classes.tabContainer,
|
|
@@ -8811,14 +8846,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8811
8846
|
__self: this,
|
|
8812
8847
|
__source: {
|
|
8813
8848
|
fileName: _jsxFileName,
|
|
8814
|
-
lineNumber:
|
|
8849
|
+
lineNumber: 216
|
|
8815
8850
|
}
|
|
8816
|
-
}, React$1.createElement(Purpose, {
|
|
8851
|
+
}, this.renderInstructions(showTeacherInstructions, tab.teacherInstructions), React$1.createElement(Purpose, {
|
|
8817
8852
|
purpose: "passage-text",
|
|
8818
8853
|
__self: this,
|
|
8819
8854
|
__source: {
|
|
8820
8855
|
fileName: _jsxFileName,
|
|
8821
|
-
lineNumber:
|
|
8856
|
+
lineNumber: 225
|
|
8822
8857
|
}
|
|
8823
8858
|
}, React$1.createElement('div', {
|
|
8824
8859
|
key: tab.id,
|
|
@@ -8828,16 +8863,16 @@ class StimulusTabs extends React$1.Component {
|
|
|
8828
8863
|
__self: this,
|
|
8829
8864
|
__source: {
|
|
8830
8865
|
fileName: _jsxFileName,
|
|
8831
|
-
lineNumber:
|
|
8866
|
+
lineNumber: 226
|
|
8832
8867
|
}
|
|
8833
8868
|
}))) : null));
|
|
8834
8869
|
} else if (tabs && tabs[0]) {
|
|
8835
|
-
return React$1.createElement('div', {
|
|
8870
|
+
return React$1.createElement(React$1.Fragment, null, this.renderInstructions(showTeacherInstructions, tabs[0].teacherInstructions, disabledTabs), React$1.createElement('div', {
|
|
8836
8871
|
className: classNames(classes.root, classes.tabContainer, classes.breakSpaces, 'passage'),
|
|
8837
8872
|
__self: this,
|
|
8838
8873
|
__source: {
|
|
8839
8874
|
fileName: _jsxFileName,
|
|
8840
|
-
lineNumber:
|
|
8875
|
+
lineNumber: 237
|
|
8841
8876
|
}
|
|
8842
8877
|
}, React$1.createElement('div', {
|
|
8843
8878
|
className: "text",
|
|
@@ -8847,9 +8882,9 @@ class StimulusTabs extends React$1.Component {
|
|
|
8847
8882
|
__self: this,
|
|
8848
8883
|
__source: {
|
|
8849
8884
|
fileName: _jsxFileName,
|
|
8850
|
-
lineNumber:
|
|
8885
|
+
lineNumber: 238
|
|
8851
8886
|
}
|
|
8852
|
-
}));
|
|
8887
|
+
})));
|
|
8853
8888
|
}
|
|
8854
8889
|
}
|
|
8855
8890
|
}
|
|
@@ -8858,9 +8893,11 @@ StimulusTabs.propTypes = {
|
|
|
8858
8893
|
tabs: PropTypes.arrayOf(PropTypes.shape({
|
|
8859
8894
|
id: PropTypes.number.isRequired,
|
|
8860
8895
|
title: PropTypes.string.isRequired,
|
|
8861
|
-
text: PropTypes.string.isRequired
|
|
8896
|
+
text: PropTypes.string.isRequired,
|
|
8897
|
+
teacherInstructions: PropTypes.string
|
|
8862
8898
|
}).isRequired).isRequired,
|
|
8863
|
-
disabledTabs: PropTypes.bool
|
|
8899
|
+
disabledTabs: PropTypes.bool,
|
|
8900
|
+
showTeacherInstructions: PropTypes.bool
|
|
8864
8901
|
};
|
|
8865
8902
|
var StimulusTabs$1 = styles$1.withStyles(styles)(StimulusTabs);
|
|
8866
8903
|
const React = _dll_react;
|
|
@@ -8887,16 +8924,19 @@ class PiePassage extends HTMLElement {
|
|
|
8887
8924
|
this._render();
|
|
8888
8925
|
}
|
|
8889
8926
|
_render() {
|
|
8927
|
+
const {showTeacherInstructions = false} = this._model;
|
|
8890
8928
|
if (this._model.passages.length > 0) {
|
|
8891
8929
|
const passagesTabs = this._model.passages.map((passage, index) => {
|
|
8892
8930
|
return {
|
|
8893
8931
|
id: index,
|
|
8894
8932
|
title: passage.title,
|
|
8895
|
-
text: passage.text
|
|
8933
|
+
text: passage.text,
|
|
8934
|
+
teacherInstructions: passage.teacherInstructions || ''
|
|
8896
8935
|
};
|
|
8897
8936
|
});
|
|
8898
8937
|
let elem = React.createElement(StimulusTabs$1, {
|
|
8899
|
-
tabs: passagesTabs
|
|
8938
|
+
tabs: passagesTabs,
|
|
8939
|
+
showTeacherInstructions
|
|
8900
8940
|
});
|
|
8901
8941
|
ReactDOM.render(elem, this);
|
|
8902
8942
|
}
|
package/module/manifest.json
CHANGED
package/module/print-demo.js
CHANGED
|
@@ -7,6 +7,7 @@ generate.model = (id, element) => ({
|
|
|
7
7
|
element,
|
|
8
8
|
passages: [
|
|
9
9
|
{
|
|
10
|
+
teacherInstructions: 'Teacher instructions tab 1',
|
|
10
11
|
title: 'Hope Is the Thing with Feathers',
|
|
11
12
|
text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I’ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p><p><span class="no-number">"Hope is the Thing With Feathers" by Emily Dickinson, from <em>The Complete Poems of Emily Dickinson</em>. In the public domain.</span></p>',
|
|
12
13
|
},
|
package/module/print.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.0
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.1.0/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/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) {
|
|
@@ -8541,7 +8541,9 @@ getDefaultExportFromCjs(styles$1);
|
|
|
8541
8541
|
const React$1 = _dll_react;
|
|
8542
8542
|
const PropTypes = _dll_prop_types;
|
|
8543
8543
|
const classNames = _dll_classnames;
|
|
8544
|
+
const {Collapsible: Collapsible} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8544
8545
|
const {color: color} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8546
|
+
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8545
8547
|
const {Purpose: Purpose} = _dll_pie_lib__pie_toolbox_render_ui;
|
|
8546
8548
|
const _jsxFileName = "/home/circleci/repo/packages/passage/src/stimulus-tabs.jsx";
|
|
8547
8549
|
const styles = theme => ({
|
|
@@ -8576,6 +8578,9 @@ const styles = theme => ({
|
|
|
8576
8578
|
},
|
|
8577
8579
|
breakSpaces: {
|
|
8578
8580
|
whiteSpace: 'break-spaces'
|
|
8581
|
+
},
|
|
8582
|
+
teacherInstructions: {
|
|
8583
|
+
marginBottom: theme.spacing.unit * 2
|
|
8579
8584
|
}
|
|
8580
8585
|
});
|
|
8581
8586
|
class StimulusTabs extends React$1.Component {
|
|
@@ -8653,8 +8658,38 @@ class StimulusTabs extends React$1.Component {
|
|
|
8653
8658
|
return div.innerHTML;
|
|
8654
8659
|
};
|
|
8655
8660
|
}
|
|
8661
|
+
renderInstructions(showTeacherInstructions, teacherInstructions, disabledTabs = false) {
|
|
8662
|
+
if (!showTeacherInstructions || !teacherInstructions) {
|
|
8663
|
+
return;
|
|
8664
|
+
}
|
|
8665
|
+
const teacherInstructionsDiv = React$1.createElement(PreviewPrompt, {
|
|
8666
|
+
tagName: "div",
|
|
8667
|
+
className: "prompt",
|
|
8668
|
+
defaultClassName: "teacher-instructions",
|
|
8669
|
+
prompt: teacherInstructions,
|
|
8670
|
+
__self: this,
|
|
8671
|
+
__source: {
|
|
8672
|
+
fileName: _jsxFileName,
|
|
8673
|
+
lineNumber: 126
|
|
8674
|
+
}
|
|
8675
|
+
});
|
|
8676
|
+
if (disabledTabs) {
|
|
8677
|
+
return teacherInstructionsDiv;
|
|
8678
|
+
}
|
|
8679
|
+
return React$1.createElement(Collapsible, {
|
|
8680
|
+
labels: {
|
|
8681
|
+
hidden: 'Show Teacher Instructions',
|
|
8682
|
+
visible: 'Hide Teacher Instructions'
|
|
8683
|
+
},
|
|
8684
|
+
__self: this,
|
|
8685
|
+
__source: {
|
|
8686
|
+
fileName: _jsxFileName,
|
|
8687
|
+
lineNumber: 139
|
|
8688
|
+
}
|
|
8689
|
+
}, teacherInstructionsDiv);
|
|
8690
|
+
}
|
|
8656
8691
|
render() {
|
|
8657
|
-
const {classes, tabs, disabledTabs} = this.props;
|
|
8692
|
+
const {classes, tabs, disabledTabs, showTeacherInstructions} = this.props;
|
|
8658
8693
|
const {activeTab} = this.state;
|
|
8659
8694
|
if (tabs && tabs.length > 1) {
|
|
8660
8695
|
return disabledTabs ? React$1.createElement('div', {
|
|
@@ -8662,7 +8697,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8662
8697
|
__self: this,
|
|
8663
8698
|
__source: {
|
|
8664
8699
|
fileName: _jsxFileName,
|
|
8665
|
-
lineNumber:
|
|
8700
|
+
lineNumber: 156
|
|
8666
8701
|
}
|
|
8667
8702
|
}, tabs.map(tab => React$1.createElement('div', {
|
|
8668
8703
|
key: tab.id,
|
|
@@ -8674,7 +8709,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8674
8709
|
__self: this,
|
|
8675
8710
|
__source: {
|
|
8676
8711
|
fileName: _jsxFileName,
|
|
8677
|
-
lineNumber:
|
|
8712
|
+
lineNumber: 158
|
|
8678
8713
|
}
|
|
8679
8714
|
}, React$1.createElement('div', {
|
|
8680
8715
|
className: classes.tabContainer,
|
|
@@ -8684,7 +8719,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8684
8719
|
__self: this,
|
|
8685
8720
|
__source: {
|
|
8686
8721
|
fileName: _jsxFileName,
|
|
8687
|
-
lineNumber:
|
|
8722
|
+
lineNumber: 166
|
|
8688
8723
|
}
|
|
8689
8724
|
}, React$1.createElement('div', {
|
|
8690
8725
|
className: classNames(classes.title, 'title'),
|
|
@@ -8694,14 +8729,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8694
8729
|
__self: this,
|
|
8695
8730
|
__source: {
|
|
8696
8731
|
fileName: _jsxFileName,
|
|
8697
|
-
lineNumber:
|
|
8732
|
+
lineNumber: 172
|
|
8698
8733
|
}
|
|
8699
|
-
}), React$1.createElement(Purpose, {
|
|
8734
|
+
}), this.renderInstructions(showTeacherInstructions, tab.teacherInstructions, disabledTabs), React$1.createElement(Purpose, {
|
|
8700
8735
|
purpose: "passage-text",
|
|
8701
8736
|
__self: this,
|
|
8702
8737
|
__source: {
|
|
8703
8738
|
fileName: _jsxFileName,
|
|
8704
|
-
lineNumber:
|
|
8739
|
+
lineNumber: 177
|
|
8705
8740
|
}
|
|
8706
8741
|
}, React$1.createElement('div', {
|
|
8707
8742
|
className: "text",
|
|
@@ -8712,14 +8747,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8712
8747
|
__self: this,
|
|
8713
8748
|
__source: {
|
|
8714
8749
|
fileName: _jsxFileName,
|
|
8715
|
-
lineNumber:
|
|
8750
|
+
lineNumber: 178
|
|
8716
8751
|
}
|
|
8717
8752
|
})))))) : React$1.createElement('div', {
|
|
8718
8753
|
className: classNames(classes.root, 'passages'),
|
|
8719
8754
|
__self: this,
|
|
8720
8755
|
__source: {
|
|
8721
8756
|
fileName: _jsxFileName,
|
|
8722
|
-
lineNumber:
|
|
8757
|
+
lineNumber: 185
|
|
8723
8758
|
}
|
|
8724
8759
|
}, React$1.createElement(Tabs, {
|
|
8725
8760
|
classes: {
|
|
@@ -8731,7 +8766,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8731
8766
|
__self: this,
|
|
8732
8767
|
__source: {
|
|
8733
8768
|
fileName: _jsxFileName,
|
|
8734
|
-
lineNumber:
|
|
8769
|
+
lineNumber: 186
|
|
8735
8770
|
}
|
|
8736
8771
|
}, tabs.map(tab => React$1.createElement(Tab, {
|
|
8737
8772
|
className: classes.tab,
|
|
@@ -8742,7 +8777,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8742
8777
|
__self: this,
|
|
8743
8778
|
__source: {
|
|
8744
8779
|
fileName: _jsxFileName,
|
|
8745
|
-
lineNumber:
|
|
8780
|
+
lineNumber: 200
|
|
8746
8781
|
}
|
|
8747
8782
|
}, React$1.createElement('span', {
|
|
8748
8783
|
dangerouslySetInnerHTML: {
|
|
@@ -8751,7 +8786,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8751
8786
|
__self: this,
|
|
8752
8787
|
__source: {
|
|
8753
8788
|
fileName: _jsxFileName,
|
|
8754
|
-
lineNumber:
|
|
8789
|
+
lineNumber: 201
|
|
8755
8790
|
}
|
|
8756
8791
|
})),
|
|
8757
8792
|
value: tab.id,
|
|
@@ -8763,7 +8798,7 @@ class StimulusTabs extends React$1.Component {
|
|
|
8763
8798
|
__self: this,
|
|
8764
8799
|
__source: {
|
|
8765
8800
|
fileName: _jsxFileName,
|
|
8766
|
-
lineNumber:
|
|
8801
|
+
lineNumber: 195
|
|
8767
8802
|
}
|
|
8768
8803
|
}))), tabs.map(tab => activeTab === tab.id ? React$1.createElement('div', {
|
|
8769
8804
|
className: classes.tabContainer,
|
|
@@ -8774,14 +8809,14 @@ class StimulusTabs extends React$1.Component {
|
|
|
8774
8809
|
__self: this,
|
|
8775
8810
|
__source: {
|
|
8776
8811
|
fileName: _jsxFileName,
|
|
8777
|
-
lineNumber:
|
|
8812
|
+
lineNumber: 216
|
|
8778
8813
|
}
|
|
8779
|
-
}, React$1.createElement(Purpose, {
|
|
8814
|
+
}, this.renderInstructions(showTeacherInstructions, tab.teacherInstructions), React$1.createElement(Purpose, {
|
|
8780
8815
|
purpose: "passage-text",
|
|
8781
8816
|
__self: this,
|
|
8782
8817
|
__source: {
|
|
8783
8818
|
fileName: _jsxFileName,
|
|
8784
|
-
lineNumber:
|
|
8819
|
+
lineNumber: 225
|
|
8785
8820
|
}
|
|
8786
8821
|
}, React$1.createElement('div', {
|
|
8787
8822
|
key: tab.id,
|
|
@@ -8791,16 +8826,16 @@ class StimulusTabs extends React$1.Component {
|
|
|
8791
8826
|
__self: this,
|
|
8792
8827
|
__source: {
|
|
8793
8828
|
fileName: _jsxFileName,
|
|
8794
|
-
lineNumber:
|
|
8829
|
+
lineNumber: 226
|
|
8795
8830
|
}
|
|
8796
8831
|
}))) : null));
|
|
8797
8832
|
} else if (tabs && tabs[0]) {
|
|
8798
|
-
return React$1.createElement('div', {
|
|
8833
|
+
return React$1.createElement(React$1.Fragment, null, this.renderInstructions(showTeacherInstructions, tabs[0].teacherInstructions, disabledTabs), React$1.createElement('div', {
|
|
8799
8834
|
className: classNames(classes.root, classes.tabContainer, classes.breakSpaces, 'passage'),
|
|
8800
8835
|
__self: this,
|
|
8801
8836
|
__source: {
|
|
8802
8837
|
fileName: _jsxFileName,
|
|
8803
|
-
lineNumber:
|
|
8838
|
+
lineNumber: 237
|
|
8804
8839
|
}
|
|
8805
8840
|
}, React$1.createElement('div', {
|
|
8806
8841
|
className: "text",
|
|
@@ -8810,9 +8845,9 @@ class StimulusTabs extends React$1.Component {
|
|
|
8810
8845
|
__self: this,
|
|
8811
8846
|
__source: {
|
|
8812
8847
|
fileName: _jsxFileName,
|
|
8813
|
-
lineNumber:
|
|
8848
|
+
lineNumber: 238
|
|
8814
8849
|
}
|
|
8815
|
-
}));
|
|
8850
|
+
})));
|
|
8816
8851
|
}
|
|
8817
8852
|
}
|
|
8818
8853
|
}
|
|
@@ -8821,9 +8856,11 @@ StimulusTabs.propTypes = {
|
|
|
8821
8856
|
tabs: PropTypes.arrayOf(PropTypes.shape({
|
|
8822
8857
|
id: PropTypes.number.isRequired,
|
|
8823
8858
|
title: PropTypes.string.isRequired,
|
|
8824
|
-
text: PropTypes.string.isRequired
|
|
8859
|
+
text: PropTypes.string.isRequired,
|
|
8860
|
+
teacherInstructions: PropTypes.string
|
|
8825
8861
|
}).isRequired).isRequired,
|
|
8826
|
-
disabledTabs: PropTypes.bool
|
|
8862
|
+
disabledTabs: PropTypes.bool,
|
|
8863
|
+
showTeacherInstructions: PropTypes.bool
|
|
8827
8864
|
};
|
|
8828
8865
|
var StimulusTabs$1 = styles$1.withStyles(styles)(StimulusTabs);
|
|
8829
8866
|
const React = _dll_react;
|
|
@@ -8831,25 +8868,31 @@ const ReactDOM = _dll_react_dom;
|
|
|
8831
8868
|
const {debounce: debounce} = _dll_lodash;
|
|
8832
8869
|
const debug = _dll_debug;
|
|
8833
8870
|
const log = debug('pie-element:passage:print');
|
|
8834
|
-
const preparePrintPassage = model
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8871
|
+
const preparePrintPassage = (model, opts) => {
|
|
8872
|
+
const instr = opts.role === 'instructor';
|
|
8873
|
+
return model.passages.map((passage, index) => {
|
|
8874
|
+
return {
|
|
8875
|
+
id: index,
|
|
8876
|
+
title: passage.title,
|
|
8877
|
+
text: passage.text,
|
|
8878
|
+
teacherInstructions: instr && passage.teacherInstructions
|
|
8879
|
+
};
|
|
8880
|
+
});
|
|
8881
|
+
};
|
|
8841
8882
|
class PassagePrint extends HTMLElement {
|
|
8842
8883
|
constructor() {
|
|
8843
8884
|
super();
|
|
8844
8885
|
this._model = null;
|
|
8886
|
+
this._options = null;
|
|
8845
8887
|
this._session = [];
|
|
8846
8888
|
this._rerender = debounce(() => {
|
|
8847
8889
|
if (this._model && this._session) {
|
|
8848
8890
|
if (this._model.passages && this._model.passages.length > 0) {
|
|
8849
|
-
const printPassage = preparePrintPassage(this._model);
|
|
8891
|
+
const printPassage = preparePrintPassage(this._model, this._options);
|
|
8850
8892
|
const element = React.createElement(StimulusTabs$1, {
|
|
8851
8893
|
tabs: printPassage,
|
|
8852
|
-
disabledTabs: true
|
|
8894
|
+
disabledTabs: true,
|
|
8895
|
+
showTeacherInstructions: this._options.role === 'instructor'
|
|
8853
8896
|
});
|
|
8854
8897
|
ReactDOM.render(element, this);
|
|
8855
8898
|
}
|
|
@@ -8865,6 +8908,9 @@ class PassagePrint extends HTMLElement {
|
|
|
8865
8908
|
this._model = s;
|
|
8866
8909
|
this._rerender();
|
|
8867
8910
|
}
|
|
8911
|
+
set options(o) {
|
|
8912
|
+
this._options = o;
|
|
8913
|
+
}
|
|
8868
8914
|
connectedCallback() {}
|
|
8869
8915
|
}
|
|
8870
8916
|
export {PassagePrint as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage",
|
|
3
|
-
"version": "2.3.2-next.
|
|
3
|
+
"version": "2.3.2-next.36+9d55cf0c4",
|
|
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": "1.
|
|
14
|
+
"@pie-lib/pie-toolbox": "1.8.1",
|
|
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": "
|
|
20
|
+
"gitHead": "9d55cf0c4d29ec757037b4e1cfe7b62026311f1b",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"postpublish": "../../scripts/postpublish"
|
|
23
23
|
},
|