@pie-element/inline-dropdown 5.18.0 → 5.19.0
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 +11 -0
- package/lib/index.js.map +1 -1
- 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
|
+
# [5.19.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@5.18.0...@pie-element/inline-dropdown@5.19.0) (2024-06-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **extended-text-entry,inline-dropdown:** Add dynamic language attribute to indicate content language PD-2483 ([500f285](https://github.com/pie-framework/pie-elements/commit/500f2850c4c80f7f31a6508aa48cd04ebfdbe8d4))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [5.18.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown@5.17.0...@pie-element/inline-dropdown@5.18.0) (2024-06-24)
|
|
7
18
|
|
|
8
19
|
|
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"));
|
|
@@ -64,6 +66,8 @@ var RootInlineDropdown = /*#__PURE__*/function (_HTMLElement) {
|
|
|
64
66
|
onChange: _this.changeSession
|
|
65
67
|
});
|
|
66
68
|
|
|
69
|
+
_this.setLangAttribute();
|
|
70
|
+
|
|
67
71
|
_reactDom["default"].render(elem, (0, _assertThisInitialized2["default"])(_this), function () {
|
|
68
72
|
(0, _mathRenderingAccessible.renderMath)((0, _assertThisInitialized2["default"])(_this));
|
|
69
73
|
});
|
|
@@ -102,6 +106,13 @@ var RootInlineDropdown = /*#__PURE__*/function (_HTMLElement) {
|
|
|
102
106
|
|
|
103
107
|
this._render();
|
|
104
108
|
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "setLangAttribute",
|
|
111
|
+
value: function setLangAttribute() {
|
|
112
|
+
var language = this._model && (0, _typeof2["default"])(this._model.language) ? this._model.language : '';
|
|
113
|
+
var lang = language ? language.slice(0, 2) : 'en';
|
|
114
|
+
this.setAttribute('lang', lang);
|
|
115
|
+
}
|
|
105
116
|
}, {
|
|
106
117
|
key: "connectedCallback",
|
|
107
118
|
value: function connectedCallback() {
|
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","language","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","setAttribute","HTMLElement"],"mappings":"
|
|
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","language","onChange","changeSession","setLangAttribute","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","session","dispatchChangedEvent","_render","m","ModelSetEvent","s","lang","slice","setAttribute","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,kB;;;;;AACnB,gC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L;;AACA,YAAKC,OAAL;AACD,KA9Da;AAEZ,UAAK5B,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SACD,aAAU4B,CAAV,EAAa;AACX,WAAK7B,MAAL,GAAc6B,CAAd;AACA,WAAKP,aAAL,CACE,IAAIQ,8BAAJ,CAAkB,KAAKN,OAAL,CAAaC,WAAb,EAAlB,EAA8C,KAAKC,OAAL,IAAgB,CAAC,CAAC,KAAKA,OAAL,CAAaZ,KAA7E,EAAoF,CAAC,CAAC,KAAKd,MAA3F,CADF;;AAIA,WAAK4B,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAK3B,QAAZ;AACD,K;SAPD,aAAY8B,CAAZ,EAAe;AACb,WAAK9B,QAAL,GAAgB8B,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WAMD,4BAAmB;AACjB,UAAMZ,QAAQ,GAAG,KAAKhB,MAAL,6BAAsB,KAAKA,MAAL,CAAYgB,QAAlC,IAA6C,KAAKhB,MAAL,CAAYgB,QAAzD,GAAoE,EAArF;AACA,UAAMgB,IAAI,GAAGhB,QAAQ,GAAGA,QAAQ,CAACiB,KAAT,CAAe,CAAf,EAAkB,CAAlB,CAAH,GAA0B,IAA/C;AACA,WAAKC,YAAL,CAAkB,MAAlB,EAA0BF,IAA1B;AACD;;;WAqCD,6BAAoB;AAClB,WAAKE,YAAL,CAAkB,YAAlB,EAAgC,0BAAhC;AACA,WAAKA,YAAL,CAAkB,MAAlB,EAA0B,QAA1B;;AAEA,WAAKN,OAAL;AACD;;;kDAtE6CO,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';\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 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 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 _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 language: this._model.language,\n onChange: this.changeSession,\n });\n\n this.setLangAttribute();\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": "5.
|
|
7
|
+
"version": "5.19.0",
|
|
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": "1ef97b238096c35e6ecf747f015c0faaea69792f",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
26
|
"module": "src/index.js"
|
|
27
27
|
}
|