@pie-element/inline-dropdown 4.9.1-next.20 → 4.9.1-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/lib/index.js CHANGED
@@ -104,6 +104,9 @@ var RootInlineDropdown = /*#__PURE__*/function (_HTMLElement) {
104
104
  }, {
105
105
  key: "connectedCallback",
106
106
  value: function connectedCallback() {
107
+ this.setAttribute('aria-label', 'Inline Dropdown Question');
108
+ this.setAttribute('role', 'region');
109
+
107
110
  this._render();
108
111
  }
109
112
  }]);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["RootInlineDropdown","_model","_session","elem","React","createElement","InlineDropdown","prompt","rationale","teacherInstructions","disabled","displayType","markup","mode","choices","value","feedback","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,kB;;;;;AACnB,gCAAc;AAAA;;AAAA;AACZ;AADY,gGAwBJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,0BAApB,EAAoC;AAC7CC,UAAAA,MAAM,EAAE,MAAKN,MAAL,CAAYM,MADyB;AAE7CC,UAAAA,SAAS,EAAE,MAAKP,MAAL,CAAYO,SAFsB;AAG7CC,UAAAA,mBAAmB,EAAE,MAAKR,MAAL,CAAYQ,mBAHY;AAI7CC,UAAAA,QAAQ,EAAE,MAAKT,MAAL,CAAYS,QAJuB;AAK7CC,UAAAA,WAAW,EAAE,MAAKV,MAAL,CAAYU,WALoB;AAM7CC,UAAAA,MAAM,EAAE,MAAKX,MAAL,CAAYW,MANyB;AAO7CC,UAAAA,IAAI,EAAE,MAAKZ,MA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'react-dom';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport InlineDropdown from './inline-dropdown';\n\nexport default class RootInlineDropdown 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(), this.session && !!this.session.value, !!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 _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(InlineDropdown, {\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n teacherInstructions: this._model.teacherInstructions,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n markup: this._model.markup,\n mode: this._model.mode,\n choices: this._model.choices,\n value: this._session.value,\n feedback: this._model.feedback,\n onChange: this.changeSession,\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._render();\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.js"],"names":["RootInlineDropdown","_model","_session","elem","React","createElement","InlineDropdown","prompt","rationale","teacherInstructions","disabled","displayType","markup","mode","choices","value","feedback","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","setAttribute","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,kB;;;;;AACnB,gCAAc;AAAA;;AAAA;AACZ;AADY,gGAwBJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;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,WAAKP,aAAL,CACE,IAAIQ,8BAAJ,CAAkB,KAAKN,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaV,KAA7E,EAAoF,CAAC,CAAC,KAAKd,MAA3F,CADF;;AAIA,WAAK0B,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKzB,QAAZ;AACD,K;SAPD,aAAY4B,CAAZ,EAAe;AACb,WAAK5B,QAAL,GAAgB4B,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAsCD,6BAAoB;AAClB,WAAKI,YAAL,CAAkB,YAAlB,EAAgC,0BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;;AAEA,WAAKJ,OAAL;AACD;;;kDA9D6CK,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/math-rendering';\nimport InlineDropdown from './inline-dropdown';\n\nexport default class RootInlineDropdown 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(), this.session && !!this.session.value, !!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 _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(InlineDropdown, {\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n teacherInstructions: this._model.teacherInstructions,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n markup: this._model.markup,\n mode: this._model.mode,\n choices: this._model.choices,\n value: this._session.value,\n feedback: this._model.feedback,\n onChange: this.changeSession,\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', 'Inline Dropdown Question'); \n this.setAttribute('role', 'region');\n\n this._render();\n }\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "4.9.1-next.20+ad9e76520",
7
+ "version": "4.9.1-next.36+9353f7376",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "author": "",
27
27
  "license": "ISC",
28
- "gitHead": "ad9e7652097da344bb9a66d3fd478f98f4990d79",
28
+ "gitHead": "9353f73768c78233621ab11119b1961af018a7e4",
29
29
  "main": "lib/index.js",
30
30
  "module": "src/index.js"
31
31
  }