@pie-element/select-text 6.5.26 → 6.5.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/CHANGELOG.md +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/package.json +4 -4
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/module/configure.js +3 -3
- package/module/element.js +5 -2
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [6.5.27](https://github.com/pie-framework/pie-elements/compare/@pie-element/select-text@6.5.26...@pie-element/select-text@6.5.27) (2022-04-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/select-text
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [6.5.26](https://github.com/pie-framework/pie-elements/compare/@pie-element/select-text@6.5.25...@pie-element/select-text@6.5.26) (2022-03-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/select-text
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.2.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/select-text-configure@5.2.22...@pie-element/select-text-configure@5.2.23) (2022-04-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/select-text-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [5.2.22](https://github.com/pie-framework/pie-elements/compare/@pie-element/select-text-configure@5.2.21...@pie-element/select-text-configure@5.2.22) (2022-03-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/select-text-configure
|
package/configure/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/select-text-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.23",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
11
|
-
"@pie-lib/config-ui": "^10.
|
|
12
|
-
"@pie-lib/editable-html": "^7.
|
|
13
|
-
"@pie-lib/scoring-config": "^3.5.
|
|
11
|
+
"@pie-lib/config-ui": "^10.11.0",
|
|
12
|
+
"@pie-lib/editable-html": "^7.20.0",
|
|
13
|
+
"@pie-lib/scoring-config": "^3.5.154",
|
|
14
14
|
"@pie-lib/text-select": "^1.8.14",
|
|
15
15
|
"debug": "^3.1.0",
|
|
16
16
|
"lodash": "^4.17.15",
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["SelectText","m","_model","render","dispatchEvent","ModelSetEvent","tagName","toLowerCase","isSessionComplete","undefined","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["SelectText","m","_model","render","dispatchEvent","ModelSetEvent","tagName","toLowerCase","isSessionComplete","undefined","_session","s","generatedModel","tokens","areCorrect","selectedTokens","filter","start","end","find","tStart","tEnd","length","Array","isArray","selection","SessionChangedEvent","el","React","createElement","Main","model","session","onSelectionChange","selectionChanged","bind","ReactDOM","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;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KAAK,CAACC,OAAN,CAAc,KAAKd,QAAL,CAAcK,cAA5B,CAAL,EAAkD;AAChD,aAAKL,QAAL,CAAcK,cAAd,GAA+B,EAA/B;AACD;;AACD,WAAKZ,MAAL;AACD;;;WAMD,6BAAoB;AAClB,kBAA2B,KAAKO,QAAL,IAAiB,EAA5C;AAAA,UAAQK,cAAR,SAAQA,cAAR;;AACA,aAAOQ,KAAK,CAACC,OAAN,CAAcT,cAAd,KAAiCA,cAAc,CAACO,MAAf,GAAwB,CAAhE;AACD;;;WAED,0BAAiBG,SAAjB,EAA4B;AAC1B,WAAKf,QAAL,CAAcK,cAAd,GAA+BU,SAA/B;AAEA,WAAKrB,aAAL,CACE,IAAIsB,oCAAJ,CACE,KAAKpB,OAAL,CAAaC,WAAb,EADF,EAEE,KAAKC,iBAAL,EAFF,CADF;AAMD;;;WAED,6BAAoB;AAClB,WAAKL,MAAL;AACD;;;WAED,kBAAS;AAAA;;AACP,UAAI,KAAKD,MAAL,IAAe,KAAKQ,QAAxB,EAAkC;AAChC,YAAMiB,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,UAAAA,KAAK,EAAE,KAAK7B,MADuB;AAEnC8B,UAAAA,OAAO,EAAE,KAAKtB,QAFqB;AAGnCuB,UAAAA,iBAAiB,EAAE,KAAKC,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B;AAHgB,SAA1B,CAAX;;AAMAC,6BAASjC,MAAT,CAAgBwB,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,yCAAW,KAAX;AACD,SAFD;AAGD;AACF;;;kDAnFqCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n SessionChangedEvent,\n ModelSetEvent\n} from '@pie-framework/pie-player-events';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport generateModel from './utils';\n\nexport default class SelectText extends HTMLElement {\n constructor() {\n super();\n }\n\n set model(m) {\n this._model = m;\n\n this.render();\n this.dispatchEvent(\n new ModelSetEvent(\n this.tagName.toLowerCase(),\n this.isSessionComplete(),\n this._model !== undefined\n )\n );\n }\n\n set session(s) {\n this._session = s;\n\n if (this._model) {\n const generatedModel = generateModel(this._model) || {};\n const { tokens } = generatedModel;\n\n // make sure initial session tokens are parsed and have correct start and end (according to the regenerated model) - this case was introduced mostly for createCorrectSession\n\n // check if the selectedTokens have the correct start and end\n const areCorrect = (s.selectedTokens || []).filter(({ start, end }) => tokens.find(({ start: tStart, end: tEnd }) => start === tStart && end === tEnd)).length;\n\n if (!areCorrect) {\n const generatedModel = generateModel({ ...this._model, tokens: s.selectedTokens }) || {};\n const { tokens } = generatedModel;\n\n if (tokens) {\n this._session.selectedTokens = tokens;\n }\n }\n }\n\n\n if (!Array.isArray(this._session.selectedTokens)) {\n this._session.selectedTokens = [];\n }\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n isSessionComplete() {\n const { selectedTokens } = this._session || {};\n return Array.isArray(selectedTokens) && selectedTokens.length > 0;\n }\n\n selectionChanged(selection) {\n this._session.selectedTokens = selection;\n\n this.dispatchEvent(\n new SessionChangedEvent(\n this.tagName.toLowerCase(),\n this.isSessionComplete()\n )\n );\n }\n\n connectedCallback() {\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onSelectionChange: this.selectionChanged.bind(this)\n });\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n }\n}\n"],"file":"index.js"}
|
package/module/configure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.
|
|
2
|
-
import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.
|
|
3
|
-
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.2.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.10/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__config_ui} from "../../../@pie-lib/config-module@^1.0.33/module/index.js";
|
|
3
|
+
import {_dll_pie_lib__editable_html} from "../../../@pie-lib/editable-html-module@^1.2.9/module/index.js";
|
|
4
4
|
const React$7 = _dll_react;
|
|
5
5
|
const PropTypes$6 = _dll_prop_types;
|
|
6
6
|
const {Button: Button} = _dll_material_ui__core;
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.10/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.35/module/index.js";
|
|
3
3
|
var lib$1 = {};
|
|
4
4
|
Object.defineProperty(lib$1, "__esModule", {
|
|
5
5
|
value: true
|
|
@@ -2491,6 +2491,9 @@ class SelectText extends HTMLElement {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
this.render();
|
|
2493
2493
|
}
|
|
2494
|
+
get session() {
|
|
2495
|
+
return this._session;
|
|
2496
|
+
}
|
|
2494
2497
|
isSessionComplete() {
|
|
2495
2498
|
const {selectedTokens} = this._session || ({});
|
|
2496
2499
|
return Array.isArray(selectedTokens) && selectedTokens.length > 0;
|
package/module/index.html
CHANGED
package/module/manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/select-text",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.26",
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "^1.4.
|
|
7
|
+
"version": "^1.4.10"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"name": "@pie-lib/math-rendering-module",
|
|
11
|
-
"version": "^1.0.
|
|
11
|
+
"version": "^1.0.35"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
package/module/print.html
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.
|
|
2
|
-
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_material_ui__core, _dll_material_ui__core_styles, _dll_lodash, _dll_debug, _dll_classnames, _dll_pie_lib__render_ui, _dll_react_dom_server, _dll_pie_lib__correct_answer_toggle, _dll_react_dom} from "../../../@pie-lib/shared-module@^1.4.10/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.35/module/index.js";
|
|
3
3
|
const React$7 = _dll_react;
|
|
4
4
|
const PropTypes$6 = _dll_prop_types;
|
|
5
5
|
const {Button: Button} = _dll_material_ui__core;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "6.5.
|
|
7
|
+
"version": "6.5.27",
|
|
8
8
|
"description": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC",
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "de8f41ecfc06944b7bc890a167f81818d2bf1845",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"postpublish": "../../scripts/postpublish"
|
|
25
25
|
},
|