@pie-element/explicit-constructed-response 6.18.1-next.23 → 6.18.1-next.27
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/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/module/element.js +6 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -91,10 +93,18 @@ var InlineDropdown = /*#__PURE__*/function (_HTMLElement) {
|
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
(0, _createClass2["default"])(InlineDropdown, [{
|
|
96
|
+
key: "setLangAttribute",
|
|
97
|
+
value: function setLangAttribute() {
|
|
98
|
+
var language = this._model && (0, _typeof2["default"])(this._model.language) ? this._model.language : '';
|
|
99
|
+
var lang = language ? language.slice(0, 2) : 'en';
|
|
100
|
+
this.setAttribute('lang', lang);
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
94
103
|
key: "model",
|
|
95
104
|
set: function set(m) {
|
|
96
105
|
this._model = m;
|
|
97
106
|
this.dispatchEvent(new _piePlayerEvents.ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model));
|
|
107
|
+
this.setLangAttribute();
|
|
98
108
|
|
|
99
109
|
this._render();
|
|
100
110
|
}
|
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","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","
|
|
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","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,UA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AAH,GAA0B,IAA/C;AACA,WAAKC,YAAL,CAAkB,MAAlB,EAA0BF,IAA1B;AACD;;;SAED,aAAUG,CAAV,EAAa;AACX,WAAKrC,MAAL,GAAcqC,CAAd;AACA,WAAKV,aAAL,CACE,IAAIW,8BAAJ,CAAkB,KAAKT,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaP,KAA7E,EAAoF,CAAC,CAAC,KAAKxB,MAA3F,CADF;AAGA,WAAKuC,gBAAL;;AAEA,WAAKN,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKhC,QAAZ;AACD,K;SAPD,aAAYuC,CAAZ,EAAe;AACb,WAAKvC,QAAL,GAAgBuC,CAAhB;;AACA,WAAKP,OAAL;AACD;;;WA6CD,6BAAoB;AAClB,WAAKG,YAAL,CAAkB,YAAlB,EAAgC,4BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;;AAEA,WAAKH,OAAL;AACD;;;kDA5EyCQ,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 });\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/module/element.js
CHANGED
|
@@ -128442,9 +128442,15 @@ class InlineDropdown extends HTMLElement {
|
|
|
128442
128442
|
this._model = null;
|
|
128443
128443
|
this._session = null;
|
|
128444
128444
|
}
|
|
128445
|
+
setLangAttribute() {
|
|
128446
|
+
const language = this._model && typeof this._model.language ? this._model.language : '';
|
|
128447
|
+
const lang = language ? language.slice(0, 2) : 'en';
|
|
128448
|
+
this.setAttribute('lang', lang);
|
|
128449
|
+
}
|
|
128445
128450
|
set model(m) {
|
|
128446
128451
|
this._model = m;
|
|
128447
128452
|
this.dispatchEvent(new ModelSetEvent_1(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model));
|
|
128453
|
+
this.setLangAttribute();
|
|
128448
128454
|
this._render();
|
|
128449
128455
|
}
|
|
128450
128456
|
set session(s) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "6.18.1-next.
|
|
7
|
+
"version": "6.18.1-next.27+bb8027601",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "ISC",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "bb8027601bd513977fe2cbee169d31ee529645a4",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
26
|
"module": "src/index.js",
|
|
27
27
|
"exports": {
|