@pie-element/extended-text-entry 11.4.0 → 11.4.1-next.7

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.
@@ -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.6.0",
13
+ "@pie-lib/pie-toolbox": "2.6.1",
14
14
  "lodash": "^4.17.15",
15
15
  "prop-types": "^15.6.2",
16
16
  "react": "^16.8.1",
@@ -6,7 +6,7 @@
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
- "@pie-lib/pie-toolbox": "2.6.0"
9
+ "@pie-lib/pie-toolbox": "2.6.1"
10
10
  },
11
11
  "scripts": {
12
12
  "test": "echo \"Error: no test specified\" && exit 1"
package/lib/index.js CHANGED
@@ -31,7 +31,7 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
31
31
 
32
32
  var _debug = _interopRequireDefault(require("debug"));
33
33
 
34
- var _mathRenderingAccessible = require("@pie-lib/pie-toolbox/math-rendering-accessible");
34
+ var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
35
35
 
36
36
  var _piePlayerEvents = require("@pie-framework/pie-player-events");
37
37
 
@@ -150,7 +150,7 @@ var RootExtendedTextEntry = /*#__PURE__*/function (_HTMLElement) {
150
150
  this.setLangAttribute();
151
151
 
152
152
  _reactDom["default"].render(elem, this, function () {
153
- (0, _mathRenderingAccessible.renderMath)(_this2);
153
+ (0, _mathRendering.renderMath)(_this2);
154
154
  });
155
155
  }
156
156
  }
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","language","lang","slice","setAttribute","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","annotations","comment","elem","React","createElement","Main","model","session","onValueChange","valueChange","bind","onAnnotationsChange","annotationsChange","onCommentChange","commentChange","setLangAttribute","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,mCAAN,CAAZ;AAEA,IAAMC,SAAS,GAAG,QAAOC,MAAP,0DAAOA,MAAP,OAAkBC,SAAlB,GAA8B,IAAIC,SAAJ,EAA9B,GAAgD;AAAEC,EAAAA,eAAe,EAAE,yBAACC,CAAD;AAAA,WAAOA,CAAP;AAAA;AAAnB,CAAlE;;AAEO,SAASC,WAAT,CAAqBC,KAArB,EAA4B;AACjC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOL,SAAP;AACD;;AAED,MAAI;AACF,QAAMM,QAAQ,GAAGR,SAAS,CAACI,eAAV,CAA0BG,KAA1B,EAAiC,WAAjC,CAAjB;AACA,QAAMD,YAAW,GAAGE,QAAQ,CAACC,IAAT,CAAcH,WAAlC;AAEA,WAAOA,YAAP;AACD,GALD,CAKE,OAAOI,GAAP,EAAY;AACZX,IAAAA,GAAG,CAAC,kCAAD,EAAqCQ,KAArC,CAAH;AACA,WAAOA,KAAP;AACD;AACF;;AAEM,SAASI,UAAT,CAAoBJ,KAApB,EAA2B;AAChC,MAAMK,EAAE,GAAGN,WAAW,CAACC,KAAD,CAAtB;AACA,MAAMM,GAAG,GAAGD,EAAE,KAAKV,SAAP,IAAoBU,EAAE,CAACE,MAAH,GAAY,CAA5C;AAEA,SAAOD,GAAP;AACD;;IAEoBE,qB;;;;;AACnB,mCAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;WAED,4BAAmB;AACjB,UAAMC,QAAQ,GAAG,KAAKF,MAAL,6BAAsB,KAAKA,MAAL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MAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKN,YAAL,CAAkB,YAAlB,EAAgC,2BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;AAEA,WAAKM,MAAL;AACD;;;WAED,kBAAS;AAAA;;AACP,UAAI,KAAKX,MAAL,IAAe,KAAKC,QAAxB,EAAkC;AAChC,YAAIe,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,KAAK,EAAE,KAAKpB,MADuB;AAEnCqB,UAAAA,OAAO,EAAE,KAAKpB,QAFqB;AAGnCqB,UAAAA,aAAa,EAAE,KAAKC,WAAL,CAAiBC,IAAjB,CAAsB,IAAtB,CAHoB;AAInCC,UAAAA,mBAAmB,EAAE,KAAKC,iBAAL,CAAuBF,IAAvB,CAA4B,IAA5B,CAJc;AAKnCG,UAAAA,eAAe,EAAE,KAAKC,aAAL,CAAmBJ,IAAnB,CAAwB,IAAxB;AALkB,SAA1B,CAAX;;AAQA,aAAKK,gBAAL;;AAEAC,6BAASnB,MAAT,CAAgBK,IAAhB,EAAsB,IAAtB,EAA4B,YAAM;AAChC,mDAAW,MAAX;AACD,SAFD;AAGD;AACF;;;kDA5EgDe,W","sourcesContent":["import Main from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\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\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 setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\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 valueChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(comment)));\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\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 onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
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","language","lang","slice","setAttribute","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","s","SessionChangedEvent","annotations","comment","elem","React","createElement","Main","model","session","onValueChange","valueChange","bind","onAnnotationsChange","annotationsChange","onCommentChange","commentChange","setLangAttribute","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;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;AACD;;;WAED,kBAAS;AAAA;;AACP,UAAI,KAAKX,MAAL,IAAe,KAAKC,QAAxB,EAAkC;AAChC,YAAIe,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,KAAK,EAAE,KAAKpB,MADuB;AAEnCqB,UAAAA,OAAO,EAAE,KAAKpB,QAFqB;AAGnCqB,UAAAA,aAAa,EAAE,KAAKC,WAAL,CAAiBC,IAAjB,CAAsB,IAAtB,CAHoB;AAInCC,UAAAA,mBAAmB,EAAE,KAAKC,iBAAL,CAAuBF,IAAvB,CAA4B,IAA5B,CAJc;AAKnCG,UAAAA,eAAe,EAAE,KAAKC,aAAL,CAAmBJ,IAAnB,CAAwB,IAAxB;AALkB,SAA1B,CAAX;;AAQA,aAAKK,gBAAL;;AAEAC,6BAASnB,MAAT,CAAgBK,IAAhB,EAAsB,IAAtB,EAA4B,YAAM;AAChC,yCAAW,MAAX;AACD,SAFD;AAGD;AACF;;;kDA5EgDe,W","sourcesContent":["import Main from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\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\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 setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\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 valueChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(comment)));\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\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 onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
package/lib/print.js CHANGED
@@ -31,7 +31,7 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
31
31
 
32
32
  var _main = _interopRequireDefault(require("./main"));
33
33
 
34
- var _mathRenderingAccessible = require("@pie-lib/pie-toolbox/math-rendering-accessible");
34
+ var _mathRendering = require("@pie-lib/pie-toolbox/math-rendering");
35
35
 
36
36
  var _debug = _interopRequireDefault(require("debug"));
37
37
 
@@ -90,7 +90,7 @@ var ExtendedTextEntryPrint = /*#__PURE__*/function (_HTMLElement) {
90
90
 
91
91
  _reactDom["default"].render(element, (0, _assertThisInitialized2["default"])(_this), function () {
92
92
  log('render complete - render math');
93
- (0, _mathRenderingAccessible.renderMath)((0, _assertThisInitialized2["default"])(_this));
93
+ (0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
94
94
  });
95
95
  } else {
96
96
  log('skip');
package/lib/print.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","mode","defaultDimensions","height","width","dimensions","disabled","feedback","animationsDisabled","ExtendedTextEntryPrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","session","onChange","onValueChange","onAnnotationsChange","onCommentChange","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,uCAAN,CAAZ;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,KAAD,EAAQC,IAAR,EAAiB;AACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAL,KAAc,YAA5B;AAEAH,EAAAA,KAAK,CAACI,MAAN,GAAeJ,KAAK,CAACK,aAAN,KAAwB,KAAxB,GAAgCL,KAAK,CAACI,MAAtC,GAA+CE,SAA9D;AACAN,EAAAA,KAAK,CAACO,mBAAN,GACEL,KAAK,IAAIF,KAAK,CAACQ,0BAAN,KAAqC,KAA9C,GAAsDR,KAAK,CAACO,mBAA5D,GAAkFD,SADpF;AAEAN,EAAAA,KAAK,CAACS,uBAAN,GAAgCP,KAAhC;AACAF,EAAAA,KAAK,CAACU,IAAN,GAAaR,KAAK,GAAG,UAAH,GAAgBF,KAAK,CAACU,IAAxC;AAEA,MAAMC,iBAAiB,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAV;AAAeC,IAAAA,KAAK,EAAE;AAAtB,GAA1B;AAEAb,EAAAA,KAAK,CAACc,UAAN,mCACKH,iBADL,GAEKX,KAAK,CAACc,UAFX;AAKAd,EAAAA,KAAK,CAACe,QAAN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GAAckB,CAAd;;AACA,WAAKhB,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDA3C4BiB,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\n\nimport debug from 'debug';\n\nconst log = debug('pie-element:extended-text-entry:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n const defaultDimensions = { height: 100, width: 500 };\n\n model.dimensions = {\n ...defaultDimensions,\n ...model.dimensions,\n };\n\n model.disabled = true;\n model.feedback = undefined;\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class ExtendedTextEntryPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n onChange: () => {},\n onValueChange: () => {},\n onAnnotationsChange: () => {},\n onCommentChange: () => {},\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
1
+ {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","showTeacherInstructions","mode","defaultDimensions","height","width","dimensions","disabled","feedback","animationsDisabled","ExtendedTextEntryPrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","session","onChange","onValueChange","onAnnotationsChange","onCommentChange","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,uCAAN,CAAZ;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,KAAD,EAAQC,IAAR,EAAiB;AACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAL,KAAc,YAA5B;AAEAH,EAAAA,KAAK,CAACI,MAAN,GAAeJ,KAAK,CAACK,aAAN,KAAwB,KAAxB,GAAgCL,KAAK,CAACI,MAAtC,GAA+CE,SAA9D;AACAN,EAAAA,KAAK,CAACO,mBAAN,GACEL,KAAK,IAAIF,KAAK,CAACQ,0BAAN,KAAqC,KAA9C,GAAsDR,KAAK,CAACO,mBAA5D,GAAkFD,SADpF;AAEAN,EAAAA,KAAK,CAACS,uBAAN,GAAgCP,KAAhC;AACAF,EAAAA,KAAK,CAACU,IAAN,GAAaR,KAAK,GAAG,UAAH,GAAgBF,KAAK,CAACU,IAAxC;AAEA,MAAMC,iBAAiB,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAV;AAAeC,IAAAA,KAAK,EAAE;AAAtB,GAA1B;AAEAb,EAAAA,KAAK,CAACc,UAAN,mCACKH,iBADL,GAEKX,KAAK,CAACc,UAFX;AAKAd,EAAAA,KAAK,CAACe,QAAN,GAAiB,IAAjB;AACAf,EAAAA,KAAK,CAACgB,QAAN,GAAiBV,SAAjB;AACAN,EAAAA,KAAK,CAACiB,kBAAN,GAA2B,IAA3B;AAEA,SAAOjB,KAAP;AACD,CArBD;;IAuBqBkB,sB;;;;;AACnB,oCAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,QAAL,GAAgB,IAAhB;AACA,UAAKC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,EAAhB;AACA,UAAKC,SAAL,GAAiB,0BACf,YAAM;AACJ,UAAI,MAAKF,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAME,UAAU,GAAGxB,iBAAiB,CAAC,MAAKqB,MAAN,EAAc,MAAKD,QAAnB,CAApC;;AAEA,YAAMK,OAAO,GACX,MAAKL,QAAL,iBACAM,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACxB3B,UAAAA,KAAK,EAAEuB,UADiB;AAExBK,UAAAA,OAAO,EAAE,EAFe;AAGxBC,UAAAA,QAAQ,EAAE,oBAAM,CAAE,CAHM;AAIxBC,UAAAA,aAAa,EAAE,yBAAM,CAAE,CAJC;AAKxBC,UAAAA,mBAAmB,EAAE,+BAAM,CAAE,CALL;AAMxBC,UAAAA,eAAe,EAAE,2BAAM,CAAE;AAND,SAA1B,CAFF;;AAWAC,6BAASC,MAAT,CAAgBV,OAAhB,kDAA+B,YAAM;AACnC1B,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAlBD,MAkBO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAvBc,EAwBf,EAxBe,EAyBf;AAAEqC,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KAzBe,CAAjB;AALY;AAgCb;;;;SACD,aAAYC,CAAZ,EAAe;AACb,WAAKlB,QAAL,GAAgBkB,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKlB,MAAL,GAAckB,CAAd;;AACA,WAAKhB,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDA3C4BiB,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\n\nimport debug from 'debug';\n\nconst log = debug('pie-element:extended-text-entry:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n instr && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.showTeacherInstructions = instr;\n model.mode = instr ? 'evaluate' : model.mode;\n\n const defaultDimensions = { height: 100, width: 500 };\n\n model.dimensions = {\n ...defaultDimensions,\n ...model.dimensions,\n };\n\n model.disabled = true;\n model.feedback = undefined;\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class ExtendedTextEntryPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n onChange: () => {},\n onValueChange: () => {},\n onAnnotationsChange: () => {},\n onCommentChange: () => {},\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
@@ -1,5 +1,5 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/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.5.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.0.0/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.7.1/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_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.5.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.0.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.7.1/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;
@@ -12993,7 +12993,7 @@ var SessionChangedEvent_1 = lib.SessionChangedEvent = SessionChangedEvent;
12993
12993
  const React = _dll_react;
12994
12994
  const ReactDOM = _dll_react_dom;
12995
12995
  const debug = _dll_debug;
12996
- const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering_accessible;
12996
+ const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering;
12997
12997
  const log = debug('@pie-elements:extended-text-entry');
12998
12998
  const domParser = typeof window !== undefined ? new DOMParser() : {
12999
12999
  parseFromString: v => v
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@11.3.4</title>
5
+ <title>@pie-element/extended-text-entry@11.4.0</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>
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/extended-text-entry",
3
- "version": "11.3.4",
3
+ "version": "11.4.0",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "2.5.0"
7
+ "version": "3.0.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.5.0"
11
+ "version": "5.7.1"
12
12
  }
13
13
  ]
14
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/extended-text-entry@11.3.4</title>
5
+ <title>@pie-element/extended-text-entry@11.4.0</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
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, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.5.0/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.5.0/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering} from "../../../@pie-lib/pie-toolbox-math-rendering-module@3.0.0/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.7.1/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;
@@ -12956,7 +12956,7 @@ var Main$1 = styles$n.withStyles(style)(Main);
12956
12956
  const React = _dll_react;
12957
12957
  const ReactDOM = _dll_react_dom;
12958
12958
  const {debounce: debounce} = _dll_lodash;
12959
- const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering_accessible;
12959
+ const {renderMath: renderMath} = _dll_pie_lib__pie_toolbox_math_rendering;
12960
12960
  const debug = _dll_debug;
12961
12961
  const log = debug('pie-element:extended-text-entry:print');
12962
12962
  const preparePrintModel = (model, opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/extended-text-entry",
3
- "version": "11.4.0",
3
+ "version": "11.4.1-next.7+2644c33e3",
4
4
  "description": "",
5
5
  "repository": "pie-framework/pie-elements",
6
6
  "publishConfig": {
@@ -12,7 +12,7 @@
12
12
  "@material-ui/core": "^3.9.2",
13
13
  "@material-ui/icons": "^3.0.2",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/pie-toolbox": "2.6.0",
15
+ "@pie-lib/pie-toolbox": "2.6.1",
16
16
  "classnames": "^2.2.5",
17
17
  "debug": "^4.1.1",
18
18
  "lodash.throttle": "^4.1.1",
@@ -20,7 +20,7 @@
20
20
  "react": "^16.8.1",
21
21
  "react-dom": "^16.8.1"
22
22
  },
23
- "gitHead": "67c7ce92d1e5e2e3bba47606b7004e094caba59e",
23
+ "gitHead": "2644c33e37693f99500a8cde192f257aa03f5fa1",
24
24
  "scripts": {
25
25
  "postpublish": "../../scripts/postpublish"
26
26
  },