@pie-element/drag-in-the-blank 6.4.1-next.23 → 6.4.1-next.4
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 +8 -8
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -49,15 +49,15 @@ var isComplete = function isComplete(session, model) {
|
|
|
49
49
|
|
|
50
50
|
exports.isComplete = isComplete;
|
|
51
51
|
|
|
52
|
-
var
|
|
53
|
-
(0, _inherits2["default"])(
|
|
52
|
+
var InlineDropdown = /*#__PURE__*/function (_HTMLElement) {
|
|
53
|
+
(0, _inherits2["default"])(InlineDropdown, _HTMLElement);
|
|
54
54
|
|
|
55
|
-
var _super = _createSuper(
|
|
55
|
+
var _super = _createSuper(InlineDropdown);
|
|
56
56
|
|
|
57
|
-
function
|
|
57
|
+
function InlineDropdown() {
|
|
58
58
|
var _this;
|
|
59
59
|
|
|
60
|
-
(0, _classCallCheck2["default"])(this,
|
|
60
|
+
(0, _classCallCheck2["default"])(this, InlineDropdown);
|
|
61
61
|
_this = _super.call(this);
|
|
62
62
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_render", function () {
|
|
63
63
|
if (_this._model && _this._session) {
|
|
@@ -87,7 +87,7 @@ var DragInTheBlank = /*#__PURE__*/function (_HTMLElement) {
|
|
|
87
87
|
return _this;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
(0, _createClass2["default"])(
|
|
90
|
+
(0, _createClass2["default"])(InlineDropdown, [{
|
|
91
91
|
key: "model",
|
|
92
92
|
set: function set(m) {
|
|
93
93
|
this._model = m;
|
|
@@ -111,8 +111,8 @@ var DragInTheBlank = /*#__PURE__*/function (_HTMLElement) {
|
|
|
111
111
|
this._render();
|
|
112
112
|
}
|
|
113
113
|
}]);
|
|
114
|
-
return
|
|
114
|
+
return InlineDropdown;
|
|
115
115
|
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
116
116
|
|
|
117
|
-
exports["default"] =
|
|
117
|
+
exports["default"] = InlineDropdown;
|
|
118
118
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["isComplete","session","model","value","Object","values","some","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["isComplete","session","model","value","Object","values","some","InlineDropdown","_model","_session","elem","React","createElement","Main","onChange","changeSession","ReactDOM","render","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","dispatchChangedEvent","_render","m","ModelSetEvent","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,OAAD,EAAUC,KAAV,EAAoB;AAC5C,MAAI,CAACD,OAAD,IAAY,CAACA,OAAO,CAACE,KAAzB,EAAgC;AAC9B,WAAO,KAAP;AACD;;AAED,SAAOC,MAAM,CAACC,MAAP,CAAcJ,OAAO,CAACE,KAAR,IAAiB,EAA/B,EAAmCG,IAAnC,CAAwC,UAACH,KAAD;AAAA,WAAW,CAAC,CAACA,KAAb;AAAA,GAAxC,CAAP;AACD,CANM;;;;IAQcI,c;;;;;AACnB,4BAAc;AAAA;;AAAA;AACZ;AADY,gGAsBJ,YAAM;AACd,UAAI,MAAKC,MAAL,IAAe,MAAKC,QAAxB,EAAkC;AAChC,YAAIC,IAAI,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCX,UAAAA,KAAK,EAAE,MAAKM,MADuB;AAEnCL,UAAAA,KAAK,EAAE,MAAKM,QAAL,CAAcN,KAFc;AAGnCW,UAAAA,QAAQ,EAAE,MAAKC;AAHoB,SAA1B,CAAX;;AAMAC,6BAASC,MAAT,CAAgBP,IAAhB,kDAA4B,YAAM;AAChC;AACD,SAFD;AAGD;AACF,KAlCa;AAAA,6GAoCS,YAAM;AAC3B,YAAKQ,aAAL,CAAmB,IAAIC,oCAAJ,CAAwB,MAAKC,OAAL,CAAaC,WAAb,EAAxB,EAAoDrB,UAAU,CAAC,MAAKS,QAAN,CAA9D,CAAnB;AACD,KAtCa;AAAA,sGAwCE,UAACN,KAAD,EAAW;AACzB,YAAKF,OAAL,CAAaE,KAAb,GAAqBA,KAArB;;AACA,YAAKmB,oBAAL;;AACA,YAAKC,OAAL;AACD,KA5Ca;AAEZ,UAAKf,MAAL,GAAc,IAAd;AACA,UAAKC,QAAL,GAAgB,IAAhB;AAHY;AAIb;;;;SAED,aAAUe,CAAV,EAAa;AACX,WAAKhB,MAAL,GAAcgB,CAAd;AACA,WAAKN,aAAL,CAAmB,IAAIO,8BAAJ,CAAkB,KAAKL,OAAL,CAAaC,WAAb,EAAlB,EAA8CrB,UAAU,CAAC,KAAKS,QAAN,CAAxD,EAAyE,CAAC,CAAC,KAAKD,MAAhF,CAAnB;;AAEA,WAAKe,OAAL;AACD;;;SAOD,eAAc;AACZ,aAAO,KAAKd,QAAZ;AACD,K;SAPD,aAAYiB,CAAZ,EAAe;AACb,WAAKjB,QAAL,GAAgBiB,CAAhB;;AACA,WAAKH,OAAL;AACD;;;WA8BD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;kDAjDyCI,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering-accessible';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport Main from './main';\n\nexport const isComplete = (session, model) => {\n if (!session || !session.value) {\n return false;\n }\n\n return Object.values(session.value || {}).some((value) => !!value);\n};\n\nexport default class InlineDropdown 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(new ModelSetEvent(this.tagName.toLowerCase(), isComplete(this._session), !!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 _render = () => {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n value: this._session.value,\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(), isComplete(this._session)));\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"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "6.4.1-next.
|
|
7
|
+
"version": "6.4.1-next.4+dba7b2f5e",
|
|
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": "dba7b2f5e68bd1d212e03ad1e4e574c55f58b150",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
26
|
"module": "src/index.js"
|
|
27
27
|
}
|