@pie-element/explicit-constructed-response 7.2.8-next.0 → 7.2.8-next.9

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.
@@ -8,7 +8,7 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "2.6.0",
11
+ "@pie-lib/pie-toolbox": "2.6.1",
12
12
  "classnames": "^2.2.6",
13
13
  "debug": "^3.1.0",
14
14
  "lodash": "^4.17.15",
@@ -8,7 +8,7 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@pie-lib/pie-toolbox": "2.6.0",
11
+ "@pie-lib/pie-toolbox": "2.6.1",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "type-of": "^2.0.1"
package/lib/index.js CHANGED
@@ -31,7 +31,7 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
31
31
 
32
32
  var _piePlayerEvents = require("@pie-framework/pie-player-events");
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 _main = _interopRequireDefault(require("./main"));
37
37
 
@@ -74,7 +74,7 @@ var InlineDropdown = /*#__PURE__*/function (_HTMLElement) {
74
74
  });
75
75
 
76
76
  _reactDom["default"].render(elem, (0, _assertThisInitialized2["default"])(_this), function () {
77
- (0, _mathRenderingAccessible.renderMath)((0, _assertThisInitialized2["default"])(_this));
77
+ (0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
78
78
  });
79
79
  }
80
80
  });
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["InlineDropdown","_model","_session","elem","React","createElement","Main","choices","disabled","displayType","feedback","language","markup","maxLengthPerChoice","maxLengthPerChoiceEnabled","mode","note","onChange","changeSession","playerSpellCheckEnabled","prompt","rationale","role","showNote","teacherInstructions","value","responseAreaInputConfiguration","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","lang","slice","setAttribute","m","ModelSetEvent","setLangAttribute","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;IAEqBA,c;;;;;AACnB,4BAAc;AAAA;;AAAA;AACZ;AADY,gGA+BJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,OAAO,EAAE,MAAKN,MAAL,CAAYM,OADc;AAEnCC,UAAAA,QAAQ,EAAE,MAAKP,MAAL,CAAYO,QAFa;AAGnCC,UAAAA,WAAW,EAAE,MAAKR,MAAL,CAAYQ,WAHU;AAInCC,UAAAA,QAAQ,EAAE,MAAKT,MAAL,CAAYS,QAJa;AAKnCC,UAAAA,QAAQ,EAAE,MAAKV,MAAL,CAAYU,QALa;AAMnCC,UAAAA,MAAM,EAAE,MAAKX,MAAL,CAAYW,MANe;AAOnCC,UAAAA,kBAAkB,EAAE,MAAKZ,MAAL,CAAYY,kBAPG;AAQnCC,UAAAA,yBAAyB,EAAE,MAAKb,MAAL,CAAYa,yBARJ;AASnCC,UAAAA,IAAI,EAAE,MAAKd,MAAL,CAAYc,IATiB;AAUnCC,UAAAA,IAAI,EAAE,MAAKf,MAAL,CAAYe,IAViB;AAWnCC,UAAAA,QAAQ,EAAE,MAAKC,aAXoB;AAYnCC,UAAAA,uBAAuB,EAAE,MAAKlB,MAAL,CAAYkB,uBAZF;AAanCC,UAAAA,MAAM,EAAE,MAAKnB,MAAL,CAAYmB,MAbe;AAcnCC,UAAAA,SAAS,EAAE,MAAKpB,MAAL,CAAYoB,SAdY;AAenCC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b,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaR,KAA7E,EAAoF,CAAC,CAAC,KAAKxB,MAA3F,CADF;AAGA,WAAKwC,gBAAL;;AAEA,WAAKN,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKjC,QAAZ;AACD,K;SAPD,aAAYwC,CAAZ,EAAe;AACb,WAAKxC,QAAL,GAAgBwC,CAAhB;;AACA,WAAKP,OAAL;AACD;;;WA8CD,6BAAoB;AAClB,WAAKG,YAAL,CAAkB,YAAlB,EAAgC,4BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;;AAEA,WAAKH,OAAL;AACD;;;kDA7EyCQ,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\n\nimport Main from './main';\n\nexport default class InlineDropdown 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(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n this.setLangAttribute();\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 _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n choices: this._model.choices,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n feedback: this._model.feedback,\n language: this._model.language,\n markup: this._model.markup,\n maxLengthPerChoice: this._model.maxLengthPerChoice,\n maxLengthPerChoiceEnabled: this._model.maxLengthPerChoiceEnabled,\n mode: this._model.mode,\n note: this._model.note,\n onChange: this.changeSession,\n playerSpellCheckEnabled: this._model.playerSpellCheckEnabled,\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n role: this._model.role,\n showNote: this._model.showNote,\n teacherInstructions: this._model.teacherInstructions,\n value: this._session.value,\n responseAreaInputConfiguration: this._model.responseAreaInputConfiguration,\n });\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession = (value) => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Fill in the Blank Question');\n this.setAttribute('role', 'region');\n\n this._render();\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["InlineDropdown","_model","_session","elem","React","createElement","Main","choices","disabled","displayType","feedback","language","markup","maxLengthPerChoice","maxLengthPerChoiceEnabled","mode","note","onChange","changeSession","playerSpellCheckEnabled","prompt","rationale","role","showNote","teacherInstructions","value","responseAreaInputConfiguration","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","lang","slice","setAttribute","m","ModelSetEvent","setLangAttribute","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;;;IAEqBA,c;;;;;AACnB,4BAAc;AAAA;;AAAA;AACZ;AADY,gGA+BJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,OAAO,EAAE,MAAKN,MAAL,CAAYM,OADc;AAEnCC,UAAAA,QAAQ,EAAE,MAAKP,MAAL,CAAYO,QAFa;AAGnCC,UAAAA,WAAW,EAAE,MAAKR,MAAL,CAAYQ,WAHU;AAInCC,UAAAA,QAAQ,EAAE,MAAKT,MAAL,CAAYS,QAJa;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S,oBAAL;;AACA,YAAKC,OAAL;AACD,KArEa;AAEZ,UAAKlC,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;WAED,4BAAmB;AACjB,UAAMS,QAAQ,GAAG,KAAKV,MAAL,6BAAsB,KAAKA,MAAL,CAAYU,QAAlC,IAA6C,KAAKV,MAAL,CAAYU,QAAzD,GAAoE,EAArF;AACA,UAAMyB,IAAI,GAAGzB,QAAQ,GAAGA,QAAQ,CAAC0B,KAAT,CAAe,CAAf,EAAkB,CAAlB,CAAH,GAA0B,IAA/C;AACA,WAAKC,YAAL,CAAkB,MAAlB,EAA0BF,IAA1B;AACD;;;SAED,aAAUG,CAAV,EAAa;AACX,WAAKtC,MAAL,GAAcsC,CAAd;AACA,WAAKV,aAAL,CACE,IAAIW,8BAAJ,CAAkB,KAAKT,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaR,KAA7E,EAAoF,CAAC,CAAC,KAAKxB,MAA3F,CADF;AAGA,WAAKwC,gBAAL;;AAEA,WAAKN,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKjC,QAAZ;AACD,K;SAPD,aAAYwC,CAAZ,EAAe;AACb,WAAKxC,QAAL,GAAgBwC,CAAhB;;AACA,WAAKP,OAAL;AACD;;;WA8CD,6BAAoB;AAClB,WAAKG,YAAL,CAAkB,YAAlB,EAAgC,4BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;;AAEA,WAAKH,OAAL;AACD;;;kDA7EyCQ,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\n\nimport Main from './main';\n\nexport default class InlineDropdown 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(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n this.setLangAttribute();\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 _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n choices: this._model.choices,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n feedback: this._model.feedback,\n language: this._model.language,\n markup: this._model.markup,\n maxLengthPerChoice: this._model.maxLengthPerChoice,\n maxLengthPerChoiceEnabled: this._model.maxLengthPerChoiceEnabled,\n mode: this._model.mode,\n note: this._model.note,\n onChange: this.changeSession,\n playerSpellCheckEnabled: this._model.playerSpellCheckEnabled,\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n role: this._model.role,\n showNote: this._model.showNote,\n teacherInstructions: this._model.teacherInstructions,\n value: this._session.value,\n responseAreaInputConfiguration: this._model.responseAreaInputConfiguration,\n });\n\n ReactDOM.render(elem, this, () => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession = (value) => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Fill in the Blank Question');\n this.setAttribute('role', 'region');\n\n this._render();\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
 
@@ -80,7 +80,7 @@ var ExplicitConstructedResponsePrint = /*#__PURE__*/function (_HTMLElement) {
80
80
 
81
81
  _reactDom["default"].render(element, (0, _assertThisInitialized2["default"])(_this), function () {
82
82
  log('render complete - render math');
83
- (0, _mathRenderingAccessible.renderMath)((0, _assertThisInitialized2["default"])(_this));
83
+ (0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
84
84
  });
85
85
  } else {
86
86
  log('skip');
package/lib/print.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","isInstructor","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","alwaysShowCorrect","mode","disabled","animationsDisabled","ExplicitConstructedResponsePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","onChange","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,iDAAN,CAAZ;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,KAAD,EAAQC,IAAR,EAAiB;AACzC,MAAMC,YAAY,GAAGD,IAAI,CAACE,IAAL,KAAc,YAAnC;AAEAH,EAAAA,KAAK,CAACI,MAAN,GAAeJ,KAAK,CAACK,aAAN,KAAwB,KAAxB,GAAgCL,KAAK,CAACI,MAAtC,GAA+CE,SAA9D;AACAN,EAAAA,KAAK,CAACO,mBAAN,GACEL,YAAY,IAAIF,KAAK,CAACQ,0BAAN,KAAqC,KAArD,GAA6DR,KAAK,CAACO,mBAAnE,GAAyFD,SAD3F;AAEAN,EAAAA,KAAK,CAACS,SAAN,GAAkBP,YAAY,IAAIF,KAAK,CAACU,gBAAN,KAA2B,KAA3C,GAAmDV,KAAK,CAACS,SAAzD,GAAqEH,SAAvF;AACAN,EAAAA,KAAK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from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport debug from 'debug';\n\nconst log = debug('pie-element:explicit-constructed-response:print');\n\nconst preparePrintModel = (model, opts) => {\n const isInstructor = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n isInstructor && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.rationale = isInstructor && model.rationaleEnabled !== false ? model.rationale : undefined;\n model.alwaysShowCorrect = isInstructor;\n model.mode = isInstructor ? 'evaluate' : model.mode;\n model.disabled = true;\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class ExplicitConstructedResponsePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n\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 ...printModel,\n onChange: () => {},\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\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","isInstructor","role","prompt","promptEnabled","undefined","teacherInstructions","teacherInstructionsEnabled","rationale","rationaleEnabled","alwaysShowCorrect","mode","disabled","animationsDisabled","ExplicitConstructedResponsePrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","onChange","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,iDAAN,CAAZ;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iB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AA+B,YAAM;AACnCvB,UAAAA,GAAG,CAAC,+BAAD,CAAH;AACA;AACD,SAHD;AAID,OAdD,MAcO;AACLA,QAAAA,GAAG,CAAC,MAAD,CAAH;AACD;AACF,KAnBc,EAoBf,EApBe,EAqBf;AAAE8B,MAAAA,OAAO,EAAE,KAAX;AAAkBC,MAAAA,QAAQ,EAAE;AAA5B,KArBe,CAAjB;AANY;AA6Bb;;;;SAED,aAAYC,CAAZ,EAAe;AACb,WAAKd,QAAL,GAAgBc,CAAhB;AACD;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKd,MAAL,GAAcc,CAAd;;AACA,WAAKZ,SAAL;AACD;;;WAED,6BAAoB,CAAE;;;kDAzCsCa,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';\nimport debug from 'debug';\n\nconst log = debug('pie-element:explicit-constructed-response:print');\n\nconst preparePrintModel = (model, opts) => {\n const isInstructor = opts.role === 'instructor';\n\n model.prompt = model.promptEnabled !== false ? model.prompt : undefined;\n model.teacherInstructions =\n isInstructor && model.teacherInstructionsEnabled !== false ? model.teacherInstructions : undefined;\n model.rationale = isInstructor && model.rationaleEnabled !== false ? model.rationale : undefined;\n model.alwaysShowCorrect = isInstructor;\n model.mode = isInstructor ? 'evaluate' : model.mode;\n model.disabled = true;\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class ExplicitConstructedResponsePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n\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 ...printModel,\n onChange: () => {},\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\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, _dll_lodash, _dll_debug} 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} 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} 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} 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;