@pie-element/graphing-solution-set 1.1.2-next.0 → 1.1.2
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 +12 -0
- package/configure/CHANGELOG.md +11 -0
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +11 -0
- package/controller/package.json +2 -2
- package/lib/index.js +29 -24
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [1.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-solution-set@1.1.1...@pie-element/graphing-solution-set@1.1.2) (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox ([bc3643e](https://github.com/pie-framework/pie-elements/commit/bc3643e45680e4d1eff9a4ca9fd8d3f34289aa61))
|
|
12
|
+
* **graphing-solution-set:** Model loading issue in item preview. ([ff689c0](https://github.com/pie-framework/pie-elements/commit/ff689c056e5563ff1590d19f18a560c94b0f9742))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [1.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-solution-set@1.1.0...@pie-element/graphing-solution-set@1.1.1) (2024-03-18)
|
|
7
19
|
|
|
8
20
|
|
package/configure/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
|
+
## [1.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-solution-set-configure@1.1.0...@pie-element/graphing-solution-set-configure@1.1.1) (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox ([bc3643e](https://github.com/pie-framework/pie-elements/commit/bc3643e45680e4d1eff9a4ca9fd8d3f34289aa61))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 1.1.0 (2024-03-15)
|
|
7
18
|
|
|
8
19
|
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-solution-set-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
-
"@pie-lib/pie-toolbox": "1.
|
|
12
|
+
"@pie-lib/pie-toolbox": "1.10.1",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"prop-types": "^15.6.2",
|
package/controller/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
|
+
## [1.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-solution-set-controller@1.1.1...@pie-element/graphing-solution-set-controller@1.1.2) (2024-03-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update pie-toolbox ([bc3643e](https://github.com/pie-framework/pie-elements/commit/bc3643e45680e4d1eff9a4ca9fd8d3f34289aa61))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-solution-set-controller@1.1.0...@pie-element/graphing-solution-set-controller@1.1.1) (2024-03-18)
|
|
7
18
|
|
|
8
19
|
|
package/controller/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-solution-set-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "./node_modules/.bin/jest"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@pie-lib/pie-toolbox": "1.
|
|
12
|
+
"@pie-lib/pie-toolbox": "1.10.1",
|
|
13
13
|
"debug": "^4.1.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
package/lib/index.js
CHANGED
|
@@ -105,16 +105,40 @@ var Graphing = /*#__PURE__*/function (_HTMLElement) {
|
|
|
105
105
|
(0, _createClass2["default"])(Graphing, [{
|
|
106
106
|
key: "model",
|
|
107
107
|
set: function set(m) {
|
|
108
|
+
this._model = m;
|
|
109
|
+
|
|
110
|
+
this._render();
|
|
111
|
+
}
|
|
112
|
+
/*
|
|
113
|
+
* Function to set session
|
|
114
|
+
* @param {object} s - Session object
|
|
115
|
+
* */
|
|
116
|
+
|
|
117
|
+
}, {
|
|
118
|
+
key: "session",
|
|
119
|
+
get:
|
|
120
|
+
/*
|
|
121
|
+
* Function to get session
|
|
122
|
+
* */
|
|
123
|
+
function get() {
|
|
124
|
+
return this._session;
|
|
125
|
+
},
|
|
126
|
+
set: function set(s) {
|
|
127
|
+
this._session = s;
|
|
128
|
+
|
|
108
129
|
var _ref = this._session || {},
|
|
109
130
|
answer = _ref.answer;
|
|
110
131
|
|
|
132
|
+
var _this$_model = this._model,
|
|
133
|
+
gssLineData = _this$_model.gssLineData,
|
|
134
|
+
domain = _this$_model.domain,
|
|
135
|
+
range = _this$_model.range;
|
|
111
136
|
var section = answer && answer.filter(function (mark) {
|
|
112
137
|
return mark.type === 'polygon';
|
|
113
138
|
}).length > 0;
|
|
114
|
-
this._model = m;
|
|
115
139
|
|
|
116
|
-
if (
|
|
117
|
-
|
|
140
|
+
if (gssLineData.numberOfLines === 1) {
|
|
141
|
+
this._model.gssData = {
|
|
118
142
|
numberOfLines: 1,
|
|
119
143
|
selectedTool: section ? 'solutionSet' : 'lineA',
|
|
120
144
|
sections: [],
|
|
@@ -123,7 +147,7 @@ var Graphing = /*#__PURE__*/function (_HTMLElement) {
|
|
|
123
147
|
}
|
|
124
148
|
};
|
|
125
149
|
} else {
|
|
126
|
-
|
|
150
|
+
this._model.gssData = {
|
|
127
151
|
numberOfLines: 2,
|
|
128
152
|
selectedTool: section ? 'solutionSet' : 'lineA',
|
|
129
153
|
sections: [],
|
|
@@ -137,28 +161,9 @@ var Graphing = /*#__PURE__*/function (_HTMLElement) {
|
|
|
137
161
|
}
|
|
138
162
|
|
|
139
163
|
if (section) {
|
|
140
|
-
|
|
164
|
+
this._model.gssData = (0, _utils.findSectionsInSolutionSet)(this._model.gssData, answer, domain, range);
|
|
141
165
|
}
|
|
142
166
|
|
|
143
|
-
this._render();
|
|
144
|
-
}
|
|
145
|
-
/*
|
|
146
|
-
* Function to set session
|
|
147
|
-
* @param {object} s - Session object
|
|
148
|
-
* */
|
|
149
|
-
|
|
150
|
-
}, {
|
|
151
|
-
key: "session",
|
|
152
|
-
get:
|
|
153
|
-
/*
|
|
154
|
-
* Function to get session
|
|
155
|
-
* */
|
|
156
|
-
function get() {
|
|
157
|
-
return this._session;
|
|
158
|
-
},
|
|
159
|
-
set: function set(s) {
|
|
160
|
-
this._session = s;
|
|
161
|
-
|
|
162
167
|
this._render();
|
|
163
168
|
}
|
|
164
169
|
}, {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","isUndoOperation","gssData","_model","selectedTool","fill","lineType","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","session","m","
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["Graphing","answer","Array","isArray","length","isUndoOperation","gssData","_model","selectedTool","fill","lineType","_session","dispatchEvent","SessionChangedEvent","tagName","toLowerCase","isComplete","_render","session","m","s","gssLineData","domain","range","section","filter","mark","type","numberOfLines","sections","lineA","lineB","el","React","createElement","Main","model","onAnswersChange","changeAnswers","setGssData","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAIqBA,Q;;;;;AACnB,sBAAc;AAAA;;AAAA;AACZ;AADY,mGAiED,UAACC,MAAD;AAAA,aAAYC,KAAK,CAACC,OAAN,CAAcF,MAAd,KAAyBA,MAAM,CAACG,MAAP,GAAgB,CAArD;AAAA,KAjEC;AAAA,sGAwEE,UAACH,MAAD,EAASI,eAAT,EAA6B;AAC3C;AACA;AACA,UAAQC,OAAR,GAAoB,MAAKC,MAAzB,CAAQD,OAAR;;AACA,UAAIA,OAAO,CAACE,YAAR,KAAyB,OAAzB,IAAoCP,MAAM,CAACG,MAAP,GAAgB,CAAxD,EAA2D;AACzDH,QAAAA,MAAM,CAAC,CAAD,CAAN,CAAUQ,IAAV,GAAiBH,OAAO,CAAC,OAAD,CAAP,CAAiBI,QAAlC;AACD;;AACD,UAAIJ,OAAO,CAACE,YAAR,KAAyB,OAAzB,IAAoCP,MAAM,CAACG,MAAP,GAAgB,CAAxD,EAA2D;AACzDH,QAAAA,MAAM,CAAC,CAAD,CAAN,CAAUQ,IAAV,GAAiBH,OAAO,CAAC,OAAD,CAAP,CAAiBI,Q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WAAKA,OAAL;AACD;AAED;AACF;AACA;AACA;;;;;AA0CE;AACF;AACA;AACE,uBAAU;AAAA;;AACR,UAAI,CAAC,KAAKV,MAAN,IAAgB,CAAC,KAAKI,QAA1B,EAAoC;AAClC;AACD;;AACD,UAAMqB,EAAE,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACnCC,QAAAA,KAAK,EAAE,KAAK7B,MADuB;AAEnCW,QAAAA,OAAO,EAAE,KAAKP,QAFqB;AAGnC0B,QAAAA,eAAe,EAAE,KAAKC,aAHa;AAInCC,QAAAA,UAAU,EAAE,KAAKA;AAJkB,OAA1B,CAAX;;AAMAC,2BAASC,MAAT,CAAgBT,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,uCAAW,MAAX;AACD,OAFD;AAGD;;;kDA3HmCU,W","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { SessionChangedEvent } from '@pie-framework/pie-player-events';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\nimport { findSectionsInSolutionSet, removeInvalidAnswers } from './utils';\nimport Main from './main';\nimport { set } from 'lodash';\n\nexport { Main as Component };\n\nexport default class Graphing extends HTMLElement {\n constructor() {\n super();\n }\n\n /*\n * Function to set model\n * @param {object} m - Model object\n * */\n set model(m) {\n this._model = m;\n this._render();\n }\n\n /*\n * Function to set session\n * @param {object} s - Session object\n * */\n set session(s) {\n this._session = s;\n const { answer } = this._session || {};\n const { gssLineData, domain, range } = this._model;\n let section = answer && answer.filter((mark) => mark.type === 'polygon').length > 0;\n if (gssLineData.numberOfLines === 1) {\n this._model.gssData = {\n numberOfLines: 1,\n selectedTool: section ? 'solutionSet' : 'lineA',\n sections: [],\n lineA: {\n lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid',\n },\n };\n } else {\n this._model.gssData = {\n numberOfLines: 2,\n selectedTool: section ? 'solutionSet' : 'lineA',\n sections: [],\n lineA: {\n lineType: answer && answer.length > 0 ? answer[0].fill : 'Solid',\n },\n lineB: {\n lineType: answer && answer.length > 1 ? answer[1].fill : 'Solid',\n },\n };\n }\n if (section) {\n this._model.gssData = findSectionsInSolutionSet(this._model.gssData, answer, domain, range);\n }\n this._render();\n }\n\n /*\n * Function to get session\n * */\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n /*\n * Is complete function\n * @param {object} answer - Answer object\n * */\n isComplete = (answer) => Array.isArray(answer) && answer.length > 0;\n\n /*\n * Callback function to change answers\n * @param {object} answer - Answer object\n * @param {boolean} isUndoOperation - Boolean value to check if undo operation is performed\n * */\n changeAnswers = (answer, isUndoOperation) => {\n // avoid removeInvalidObjects when undo or redo operations are executed\n // in order to preserve the logic of undo and redo\n const { gssData } = this._model;\n if (gssData.selectedTool === 'lineA' && answer.length > 0) {\n answer[0].fill = gssData['lineA'].lineType;\n }\n if (gssData.selectedTool === 'lineB' && answer.length > 1) {\n answer[1].fill = gssData['lineB'].lineType;\n }\n if (answer.length === 0) {\n gssData.selectedTool = 'lineA';\n this._model.gssData = gssData;\n }\n if (!isUndoOperation) {\n this._session.answer = removeInvalidAnswers(answer);\n } else {\n this._session.answer = answer;\n }\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete(this._session.answer)));\n this._render();\n };\n\n /*\n * Function to set gssData object and session object\n * @param {object} gssData - GSS Data object\n * @param {object} session - Session object\n * */\n setGssData = (gssData, session) => {\n this._model.gssData = gssData;\n this._session = session;\n this._render();\n };\n\n /*\n * Render function\n * */\n _render() {\n if (!this._model || !this._session) {\n return;\n }\n const el = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers,\n setGssData: this.setGssData,\n });\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\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": "1.1.2
|
|
7
|
+
"version": "1.1.2",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@material-ui/core": "^3.9.2",
|
|
15
15
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
16
|
-
"@pie-lib/pie-toolbox": "1.
|
|
16
|
+
"@pie-lib/pie-toolbox": "1.10.1",
|
|
17
17
|
"classnames": "^2.2.5",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
19
|
"react": "^16.8.1",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "ISC",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "8f5bbaa2ed9ea71f8d77f785faa1656dbd4f71e4",
|
|
25
25
|
"main": "lib/index.js",
|
|
26
26
|
"module": "src/index.js"
|
|
27
27
|
}
|