@pie-element/extended-text-entry 6.8.10 → 6.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +0 -7
- package/lib/main.js.map +1 -1
- package/module/element.js +16 -19
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/module/print.js +11 -17
- package/package.json +2 -2
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
|
+
## [6.8.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.8.10...@pie-element/extended-text-entry@6.8.11) (2022-05-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* PD-1499 not having desired result with TTS - PD-1793 ([674432b](https://github.com/pie-framework/pie-elements/commit/674432b81b3577118ad5b8619f28a3d1ec0eefed))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.8.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.8.9...@pie-element/extended-text-entry@6.8.10) (2022-05-16)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @pie-element/extended-text-entry
|
package/lib/index.js
CHANGED
|
@@ -29,6 +29,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
29
29
|
|
|
30
30
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
31
31
|
|
|
32
|
+
var _mathRendering = require("@pie-lib/math-rendering");
|
|
33
|
+
|
|
32
34
|
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
33
35
|
|
|
34
36
|
var _debug = _interopRequireDefault(require("debug"));
|
|
@@ -110,6 +112,8 @@ var RootExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
110
112
|
}, {
|
|
111
113
|
key: "render",
|
|
112
114
|
value: function render() {
|
|
115
|
+
var _this2 = this;
|
|
116
|
+
|
|
113
117
|
if (this._model && this._session) {
|
|
114
118
|
var elem = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
115
119
|
model: this._model,
|
|
@@ -117,7 +121,9 @@ var RootExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
|
|
|
117
121
|
onChange: this.handleChange.bind(this)
|
|
118
122
|
});
|
|
119
123
|
|
|
120
|
-
_reactDom["default"].render(elem, this)
|
|
124
|
+
_reactDom["default"].render(elem, this, function () {
|
|
125
|
+
(0, _mathRendering.renderMath)(_this2);
|
|
126
|
+
});
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
129
|
}]);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","_model","_session","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","elem","React","createElement","Main","model","session","onChange","handleChange","bind","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAIA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;AAEA,IAAMC,SAAS,GACb,QAAOC,MAAP,0DAAOA,MAAP,OAAkBC,SAAlB,GAA8B,IAAIC,SAAJ,EAA9B,GAAgD;AAAEC,EAAAA,eAAe,EAAE,yBAAAC,CAAC;AAAA,WAAIA,CAAJ;AAAA;AAApB,CADlD;;AAGO,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACjC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOL,SAAP;A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AAI,KAAKP,MAAL,IAAe,KAAKC,QAAxB,EAAkC;AAChC,YAAIS,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,KAAK,EAAE,KAAKd,MADuB;AAEnCe,UAAAA,OAAO,EAAE,KAAKd,QAFqB;AAGnCe,UAAAA,QAAQ,EAAE,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB;AAHyB,SAA1B,CAAX;;AAMAC,6BAASZ,MAAT,CAAgBG,IAAhB,EAAsB,IAAtB;AACD;AACF;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","_model","_session","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","elem","React","createElement","Main","model","session","onChange","handleChange","bind","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAIA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;AAEA,IAAMC,SAAS,GACb,QAAOC,MAAP,0DAAOA,MAAP,OAAkBC,SAAlB,GAA8B,IAAIC,SAAJ,EAA9B,GAAgD;AAAEC,EAAAA,eAAe,EAAE,yBAAAC,CAAC;AAAA,WAAIA,CAAJ;AAAA;AAApB,CADlD;;AAGO,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACjC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOL,SAAP;AACD;;AACD,MAAI;AACF,QAAMM,QAAQ,GAAGR,SAAS,CAACI,eAAV,CAA0BG,KAA1B,EAAiC,WAAjC,CAAjB;AACA,QAAMD,YAAW,GAAGE,QAAQ,CAACC,IAAT,CAAcH,WAAlC;AACA,WAAOA,YAAP;AACD,GAJD,CAIE,OAAOI,GAAP,EAAY;AACZX,IAAAA,GAAG,CAAC,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YAAL,CAAkBC,IAAlB,CAAuB,IAAvB;AAHyB,SAA1B,CAAX;;AAMAC,6BAASZ,MAAT,CAAgBG,IAAhB,EAAsB,IAAtB,EAA4B,YAAM;AAChC,yCAAW,MAAX;AACD,SAFD;AAGD;AACF;;;kDAjDgDU,W","sourcesContent":["import Main from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nimport {\n ModelSetEvent,\n SessionChangedEvent\n} from '@pie-framework/pie-player-events';\nimport debug from 'debug';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst domParser =\n typeof window !== undefined ? new DOMParser() : { parseFromString: v => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n return out;\n}\n\nexport default class RootExtendedTextEntry extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model)\n );\n\n this.render();\n }\n\n set session(s) {\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n handleChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(\n new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value))\n );\n }\n\n connectedCallback() {\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onChange: this.handleChange.bind(this)\n });\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
|
package/lib/main.js
CHANGED
|
@@ -80,13 +80,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
(0, _createClass2["default"])(Main, [{
|
|
83
|
-
key: "componentDidUpdate",
|
|
84
|
-
value: function componentDidUpdate() {
|
|
85
|
-
if (this.containerRef) {
|
|
86
|
-
(0, _mathRendering.renderMath)(this.containerRef);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
83
|
key: "render",
|
|
91
84
|
value: function render() {
|
|
92
85
|
var _this2 = this;
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["log","style","theme","main","backgroundColor","color","background","text","prompt","width","marginBottom","spacing","unit","fontSize","Main","props","onChange","
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["log","style","theme","main","backgroundColor","color","background","text","prompt","width","marginBottom","spacing","unit","fontSize","Main","props","onChange","model","classes","session","dimensions","disabled","feedback","teacherInstructions","mathInput","animationsDisabled","playersToolbarPosition","spellCheckEnabled","value","height","maxHeight","toolbarOpts","teacherInstructionsDiv","position","ref","containerRef","hidden","visible","collapsible","changeSession","toString","math","customKeys","keypadMode","equationEditor","controlledKeypadMode","video","audio","React","Component","PropTypes","func","isRequired","object","shape","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,6BAAN,CAAZ;;AAEA,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAAAC,KAAK;AAAA,SAAK;AACtBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,eAAe,EAAEC,gBAAMC,UAAN,EADb;AAEJD,MAAAA,KAAK,EAAEA,gBAAME,IAAN;AAFH,KADgB;AAKtBC,IAAAA,MAAM,EAAE;AACNC,MAAAA,KAAK,EAAE,MADD;AAENJ,MAAAA,KAAK,EAAEA,gBAAME,IAAN,EAFD;AAGNG,MAAAA,YAAY,EAAER,KAAK,CAACS,OAAN,CAAcC,IAAd,GAA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AL,CAAWE,KAAX,CAAiByB,UAFzB;AAGJC,YAAAA,UAAU,EAAE,KAAK5B,KAAL,CAAWE,KAAX,CAAiB2B,cAHzB;AAIJC,YAAAA,oBAAoB,EAAE;AAJlB,WADK;AAOXC,UAAAA,KAAK,EAAE;AACLzB,YAAAA,QAAQ,EAAE;AADL,WAPI;AAUV0B,UAAAA,KAAK,EAAE;AACN1B,YAAAA,QAAQ,EAAE;AADJ;AAVG;AAXf,QA7BF,EAuDGC,QAAQ,iBACP,0DACE,2CADF,eAEE,gCAAC,kBAAD;AAAU,QAAA,WAAW,EAAC,SAAtB;AAAgC,QAAA,QAAQ,EAAEA;AAA1C,QAFF,CAxDJ,CADF;AAgED;;;EAjGuB0B,kBAAMC,S;;;iCAAnBnC,I,eACQ;AACjBE,EAAAA,QAAQ,EAAEkC,sBAAUC,IAAV,CAAeC,UADR;AAEjBnC,EAAAA,KAAK,EAAEiC,sBAAUG,MAFA;AAGjBnC,EAAAA,OAAO,EAAEgC,sBAAUG,MAAV,CAAiBD,UAHT;AAIjBjC,EAAAA,OAAO,EAAE+B,sBAAUI,KAAV,CAAgB;AACvB1B,IAAAA,KAAK,EAAEsB,sBAAUK;AADM,GAAhB,EAENH;AANc,C;;eAmGN,wBAAWnD,KAAX,EAAkBa,IAAlB,C","sourcesContent":["import React from 'react';\nimport EditableHTML from '@pie-lib/editable-html';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport debug from 'debug';\nimport debounce from 'lodash/debounce';\nimport {color, Feedback, Collapsible, PreviewPrompt} from '@pie-lib/render-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst style = theme => ({\n main: {\n backgroundColor: color.background(),\n color: color.text()\n },\n prompt: {\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing.unit * 2,\n fontSize: 'inherit'\n }\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n classes: PropTypes.object.isRequired,\n session: PropTypes.shape({\n value: PropTypes.string\n }).isRequired\n };\n\n changeSession = debounce(this.props.onChange, 1500);\n\n render() {\n const { model, classes, session } = this.props;\n const { dimensions, disabled, feedback, teacherInstructions, mathInput, animationsDisabled, playersToolbarPosition, spellCheckEnabled } = model;\n const { value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = {};\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />;\n\n switch (playersToolbarPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n return (\n <div\n className={classes.main}\n ref={ref => {\n this.containerRef = ref;\n }}\n >\n {\n teacherInstructions && (\n <div>\n {!animationsDisabled ? (\n <Collapsible\n labels={{hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions'}}\n className={classes.collapsible}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : teacherInstructionsDiv }\n <br/>\n </div>\n )\n }\n {model.prompt && (\n <Typography\n component={'span'}\n className={classes.prompt}\n >\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </Typography>\n )}\n <EditableHTML\n className=\"response-area-editor\"\n onChange={this.changeSession}\n markup={value || ''}\n width={width && width.toString()}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false\n },\n video: {\n disabled: true\n },\n audio: {\n disabled: true\n }\n }}\n />\n {feedback && (\n <div>\n <br />\n <Feedback correctness=\"correct\" feedback={feedback}/>\n </div>\n )}\n </div>\n );\n }\n}\n\nexport default withStyles(style)(Main);\n"],"file":"main.js"}
|
package/module/element.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_debug, _dll_lodash, _dll_pie_lib__render_ui, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.17/module/index.js";
|
|
2
|
-
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.5.4/module/index.js";
|
|
3
2
|
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.5/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.5.4/module/index.js";
|
|
4
4
|
const React$1 = _dll_react;
|
|
5
5
|
const PropTypes = _dll_prop_types;
|
|
6
6
|
const {Typography: Typography} = _dll_material_ui__core;
|
|
@@ -12,7 +12,6 @@ const {Feedback: Feedback} = _dll_pie_lib__render_ui;
|
|
|
12
12
|
const {Collapsible: Collapsible} = _dll_pie_lib__render_ui;
|
|
13
13
|
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__render_ui;
|
|
14
14
|
const EditableHTML = _dll_pie_lib__editable_html;
|
|
15
|
-
const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
16
15
|
const _jsxFileName = "/home/circleci/repo/packages/extended-text-entry/src/main.jsx";
|
|
17
16
|
const log$1 = debug$1('@pie-ui:extended-text-entry');
|
|
18
17
|
const style = theme => ({
|
|
@@ -42,11 +41,6 @@ class Main extends React$1.Component {
|
|
|
42
41
|
}).isRequired
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
|
-
componentDidUpdate() {
|
|
46
|
-
if (this.containerRef) {
|
|
47
|
-
renderMath(this.containerRef);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
44
|
__init() {
|
|
51
45
|
this.changeSession = debounce(this.props.onChange, 1500);
|
|
52
46
|
}
|
|
@@ -64,7 +58,7 @@ class Main extends React$1.Component {
|
|
|
64
58
|
__self: this,
|
|
65
59
|
__source: {
|
|
66
60
|
fileName: _jsxFileName,
|
|
67
|
-
lineNumber:
|
|
61
|
+
lineNumber: 48
|
|
68
62
|
}
|
|
69
63
|
});
|
|
70
64
|
switch (playersToolbarPosition) {
|
|
@@ -83,13 +77,13 @@ class Main extends React$1.Component {
|
|
|
83
77
|
__self: this,
|
|
84
78
|
__source: {
|
|
85
79
|
fileName: _jsxFileName,
|
|
86
|
-
lineNumber:
|
|
80
|
+
lineNumber: 60
|
|
87
81
|
}
|
|
88
82
|
}, teacherInstructions && React$1.createElement('div', {
|
|
89
83
|
__self: this,
|
|
90
84
|
__source: {
|
|
91
85
|
fileName: _jsxFileName,
|
|
92
|
-
lineNumber:
|
|
86
|
+
lineNumber: 68
|
|
93
87
|
}
|
|
94
88
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
95
89
|
labels: {
|
|
@@ -100,13 +94,13 @@ class Main extends React$1.Component {
|
|
|
100
94
|
__self: this,
|
|
101
95
|
__source: {
|
|
102
96
|
fileName: _jsxFileName,
|
|
103
|
-
lineNumber:
|
|
97
|
+
lineNumber: 70
|
|
104
98
|
}
|
|
105
99
|
}, teacherInstructionsDiv) : teacherInstructionsDiv, React$1.createElement('br', {
|
|
106
100
|
__self: this,
|
|
107
101
|
__source: {
|
|
108
102
|
fileName: _jsxFileName,
|
|
109
|
-
lineNumber:
|
|
103
|
+
lineNumber: 77
|
|
110
104
|
}
|
|
111
105
|
})), model.prompt && React$1.createElement(Typography, {
|
|
112
106
|
component: 'span',
|
|
@@ -114,7 +108,7 @@ class Main extends React$1.Component {
|
|
|
114
108
|
__self: this,
|
|
115
109
|
__source: {
|
|
116
110
|
fileName: _jsxFileName,
|
|
117
|
-
lineNumber:
|
|
111
|
+
lineNumber: 82
|
|
118
112
|
}
|
|
119
113
|
}, React$1.createElement(PreviewPrompt, {
|
|
120
114
|
defaultClassName: "prompt",
|
|
@@ -122,7 +116,7 @@ class Main extends React$1.Component {
|
|
|
122
116
|
__self: this,
|
|
123
117
|
__source: {
|
|
124
118
|
fileName: _jsxFileName,
|
|
125
|
-
lineNumber:
|
|
119
|
+
lineNumber: 86
|
|
126
120
|
}
|
|
127
121
|
})), React$1.createElement(EditableHTML, {
|
|
128
122
|
className: "response-area-editor",
|
|
@@ -152,19 +146,19 @@ class Main extends React$1.Component {
|
|
|
152
146
|
__self: this,
|
|
153
147
|
__source: {
|
|
154
148
|
fileName: _jsxFileName,
|
|
155
|
-
lineNumber:
|
|
149
|
+
lineNumber: 89
|
|
156
150
|
}
|
|
157
151
|
}), feedback && React$1.createElement('div', {
|
|
158
152
|
__self: this,
|
|
159
153
|
__source: {
|
|
160
154
|
fileName: _jsxFileName,
|
|
161
|
-
lineNumber:
|
|
155
|
+
lineNumber: 116
|
|
162
156
|
}
|
|
163
157
|
}, React$1.createElement('br', {
|
|
164
158
|
__self: this,
|
|
165
159
|
__source: {
|
|
166
160
|
fileName: _jsxFileName,
|
|
167
|
-
lineNumber:
|
|
161
|
+
lineNumber: 117
|
|
168
162
|
}
|
|
169
163
|
}), React$1.createElement(Feedback, {
|
|
170
164
|
correctness: "correct",
|
|
@@ -172,7 +166,7 @@ class Main extends React$1.Component {
|
|
|
172
166
|
__self: this,
|
|
173
167
|
__source: {
|
|
174
168
|
fileName: _jsxFileName,
|
|
175
|
-
lineNumber:
|
|
169
|
+
lineNumber: 118
|
|
176
170
|
}
|
|
177
171
|
})));
|
|
178
172
|
}
|
|
@@ -219,6 +213,7 @@ var SessionChangedEvent_1 = lib.SessionChangedEvent = SessionChangedEvent;
|
|
|
219
213
|
const React = _dll_react;
|
|
220
214
|
const ReactDOM = _dll_react_dom;
|
|
221
215
|
const debug = _dll_debug;
|
|
216
|
+
const {renderMath: renderMath} = _dll_pie_lib__math_rendering;
|
|
222
217
|
const log = debug('@pie-ui:extended-text-entry');
|
|
223
218
|
const domParser = typeof window !== undefined ? new DOMParser() : {
|
|
224
219
|
parseFromString: v => v
|
|
@@ -273,7 +268,9 @@ class RootExtendedTextEntry extends HTMLElement {
|
|
|
273
268
|
session: this._session,
|
|
274
269
|
onChange: this.handleChange.bind(this)
|
|
275
270
|
});
|
|
276
|
-
ReactDOM.render(elem, this)
|
|
271
|
+
ReactDOM.render(elem, this, () => {
|
|
272
|
+
renderMath(this);
|
|
273
|
+
});
|
|
277
274
|
}
|
|
278
275
|
}
|
|
279
276
|
}
|
package/module/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<title>@pie-element/extended-text-entry@6.8.
|
|
5
|
+
<title>@pie-element/extended-text-entry@6.8.10</title>
|
|
6
6
|
<script
|
|
7
7
|
type="module"
|
|
8
8
|
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
package/module/manifest.json
CHANGED
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -12,7 +12,6 @@ const {Feedback: Feedback} = _dll_pie_lib__render_ui;
|
|
|
12
12
|
const {Collapsible: Collapsible} = _dll_pie_lib__render_ui;
|
|
13
13
|
const {PreviewPrompt: PreviewPrompt} = _dll_pie_lib__render_ui;
|
|
14
14
|
const EditableHTML = _dll_pie_lib__editable_html;
|
|
15
|
-
const {renderMath: renderMath$1} = _dll_pie_lib__math_rendering;
|
|
16
15
|
const _jsxFileName = "/home/circleci/repo/packages/extended-text-entry/src/main.jsx";
|
|
17
16
|
const log$1 = debug$1('@pie-ui:extended-text-entry');
|
|
18
17
|
const style = theme => ({
|
|
@@ -42,11 +41,6 @@ class Main extends React$1.Component {
|
|
|
42
41
|
}).isRequired
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
|
-
componentDidUpdate() {
|
|
46
|
-
if (this.containerRef) {
|
|
47
|
-
renderMath$1(this.containerRef);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
44
|
__init() {
|
|
51
45
|
this.changeSession = debounce$1(this.props.onChange, 1500);
|
|
52
46
|
}
|
|
@@ -64,7 +58,7 @@ class Main extends React$1.Component {
|
|
|
64
58
|
__self: this,
|
|
65
59
|
__source: {
|
|
66
60
|
fileName: _jsxFileName,
|
|
67
|
-
lineNumber:
|
|
61
|
+
lineNumber: 48
|
|
68
62
|
}
|
|
69
63
|
});
|
|
70
64
|
switch (playersToolbarPosition) {
|
|
@@ -83,13 +77,13 @@ class Main extends React$1.Component {
|
|
|
83
77
|
__self: this,
|
|
84
78
|
__source: {
|
|
85
79
|
fileName: _jsxFileName,
|
|
86
|
-
lineNumber:
|
|
80
|
+
lineNumber: 60
|
|
87
81
|
}
|
|
88
82
|
}, teacherInstructions && React$1.createElement('div', {
|
|
89
83
|
__self: this,
|
|
90
84
|
__source: {
|
|
91
85
|
fileName: _jsxFileName,
|
|
92
|
-
lineNumber:
|
|
86
|
+
lineNumber: 68
|
|
93
87
|
}
|
|
94
88
|
}, !animationsDisabled ? React$1.createElement(Collapsible, {
|
|
95
89
|
labels: {
|
|
@@ -100,13 +94,13 @@ class Main extends React$1.Component {
|
|
|
100
94
|
__self: this,
|
|
101
95
|
__source: {
|
|
102
96
|
fileName: _jsxFileName,
|
|
103
|
-
lineNumber:
|
|
97
|
+
lineNumber: 70
|
|
104
98
|
}
|
|
105
99
|
}, teacherInstructionsDiv) : teacherInstructionsDiv, React$1.createElement('br', {
|
|
106
100
|
__self: this,
|
|
107
101
|
__source: {
|
|
108
102
|
fileName: _jsxFileName,
|
|
109
|
-
lineNumber:
|
|
103
|
+
lineNumber: 77
|
|
110
104
|
}
|
|
111
105
|
})), model.prompt && React$1.createElement(Typography, {
|
|
112
106
|
component: 'span',
|
|
@@ -114,7 +108,7 @@ class Main extends React$1.Component {
|
|
|
114
108
|
__self: this,
|
|
115
109
|
__source: {
|
|
116
110
|
fileName: _jsxFileName,
|
|
117
|
-
lineNumber:
|
|
111
|
+
lineNumber: 82
|
|
118
112
|
}
|
|
119
113
|
}, React$1.createElement(PreviewPrompt, {
|
|
120
114
|
defaultClassName: "prompt",
|
|
@@ -122,7 +116,7 @@ class Main extends React$1.Component {
|
|
|
122
116
|
__self: this,
|
|
123
117
|
__source: {
|
|
124
118
|
fileName: _jsxFileName,
|
|
125
|
-
lineNumber:
|
|
119
|
+
lineNumber: 86
|
|
126
120
|
}
|
|
127
121
|
})), React$1.createElement(EditableHTML, {
|
|
128
122
|
className: "response-area-editor",
|
|
@@ -152,19 +146,19 @@ class Main extends React$1.Component {
|
|
|
152
146
|
__self: this,
|
|
153
147
|
__source: {
|
|
154
148
|
fileName: _jsxFileName,
|
|
155
|
-
lineNumber:
|
|
149
|
+
lineNumber: 89
|
|
156
150
|
}
|
|
157
151
|
}), feedback && React$1.createElement('div', {
|
|
158
152
|
__self: this,
|
|
159
153
|
__source: {
|
|
160
154
|
fileName: _jsxFileName,
|
|
161
|
-
lineNumber:
|
|
155
|
+
lineNumber: 116
|
|
162
156
|
}
|
|
163
157
|
}, React$1.createElement('br', {
|
|
164
158
|
__self: this,
|
|
165
159
|
__source: {
|
|
166
160
|
fileName: _jsxFileName,
|
|
167
|
-
lineNumber:
|
|
161
|
+
lineNumber: 117
|
|
168
162
|
}
|
|
169
163
|
}), React$1.createElement(Feedback, {
|
|
170
164
|
correctness: "correct",
|
|
@@ -172,7 +166,7 @@ class Main extends React$1.Component {
|
|
|
172
166
|
__self: this,
|
|
173
167
|
__source: {
|
|
174
168
|
fileName: _jsxFileName,
|
|
175
|
-
lineNumber:
|
|
169
|
+
lineNumber: 118
|
|
176
170
|
}
|
|
177
171
|
})));
|
|
178
172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react": "^16.8.1",
|
|
23
23
|
"react-dom": "^16.8.1"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "e234b52067cfed79dc4f01bf87b4acd7c6a4aee6",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"postpublish": "../../scripts/postpublish"
|
|
28
28
|
},
|