@pie-element/number-line 7.6.1-next.4 → 8.0.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 +19 -0
- package/configure/CHANGELOG.md +19 -0
- package/configure/package.json +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/LICENSE.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
# [8.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line@7.6.0...@pie-element/number-line@8.0.0) (2024-02-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **number-line:** Refactored reload ticks data method | SC-28865 ([9cd45fe](https://github.com/pie-framework/pie-elements/commit/9cd45fe9abab69f56b56708cccf319faca804b1c))
|
|
12
|
+
* **number-line:** Update Tick Interval logic for number line labels | SC-28865 ([a177718](https://github.com/pie-framework/pie-elements/commit/a1777185305cd828d9d6930024e236c09d3845a9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* **number-line:** Replace labelStep and tickStep from graph.tick with integerTick, decimalTick and fractionTick.
|
|
18
|
+
|
|
19
|
+
Change List document can be found at https://docs.google.com/document/d/1u0WaPQWwZa_R7pvGvHoq4qGGg7iY7lHmr4S7nMe5nJY/edit
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [7.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line@7.5.2...@pie-element/number-line@7.6.0) (2024-02-09)
|
|
7
26
|
|
|
8
27
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
# [7.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line-configure@6.6.0...@pie-element/number-line-configure@7.0.0) (2024-02-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **number-line:** Refactored reload ticks data method | SC-28865 ([9cd45fe](https://github.com/pie-framework/pie-elements/commit/9cd45fe9abab69f56b56708cccf319faca804b1c))
|
|
12
|
+
* **number-line:** Update Tick Interval logic for number line labels | SC-28865 ([a177718](https://github.com/pie-framework/pie-elements/commit/a1777185305cd828d9d6930024e236c09d3845a9))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* **number-line:** Replace labelStep and tickStep from graph.tick with integerTick, decimalTick and fractionTick.
|
|
18
|
+
|
|
19
|
+
Change List document can be found at https://docs.google.com/document/d/1u0WaPQWwZa_R7pvGvHoq4qGGg7iY7lHmr4S7nMe5nJY/edit
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [6.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line-configure@6.5.2...@pie-element/number-line-configure@6.6.0) (2024-02-09)
|
|
7
26
|
|
|
8
27
|
|
package/configure/package.json
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["NumberLine","m","_model","_applyInitialElements","_render","dispatch","_session","s","answer","length","type","dispatchEvent","CustomEvent","bubbles","detail","complete","isComplete","data","push","dispatchSessionChanged","index","el","position","Error","left","right","update","splice","indices","filter","v","some","d","pop","graph","initialElements","map","toGraphFormat","model","correctResponse","props","onAddElement","addElement","bind","onMoveElement","moveElement","onDeleteElements","deleteElements","onUndoElement","undoElement","onClearElements","clearElements","React","createElement","RootComponent","ReactDOM","render","e","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["NumberLine","m","_model","_applyInitialElements","_render","dispatch","_session","s","answer","length","type","dispatchEvent","CustomEvent","bubbles","detail","complete","isComplete","data","push","dispatchSessionChanged","index","el","position","Error","left","right","update","splice","indices","filter","v","some","d","pop","graph","initialElements","map","toGraphFormat","model","correctResponse","props","onAddElement","addElement","bind","onMoveElement","moveElement","onDeleteElements","deleteElements","onUndoElement","undoElement","onClearElements","clearElements","React","createElement","RootComponent","ReactDOM","render","e","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AAIA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;IAIqBA,U;;;;;AACnB,wBAAc;AAAA;AAAA;AAEb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKE,qBAAL;;AACA,WAAKC,OAAL;;AACA,WAAKC,QAAL,CAAc,WAAd;AACD;;;SAQD,eAAc;AACZ,aAAO,KAAKC,QAAZ;AACD,K;SARD,aAAYC,CAAZ,EAAe;AACb,WAAKD,QAAL,GAAgBC,CAAhB;;AACA,WAAKJ,qBAAL;;AACA,WAAKC,OAAL;AACD;;;WAMD,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAED,sBAAa;AACX,aAAO,KAAKE,QAAL,GAAgB,CAAC,KAAKA,QAAL,CAAcE,MAAd,IAAwB,EAAzB,EAA6BC,MAA7B,GAAsC,CAAtD,GAA0D,KAAjE;AACD;;;WAED,kBAASC,IAAT,EAAe;AACb,WAAKC,aAAL,CACE,IAAIC,WAAJ,CAAgBF,IAAhB,EAAsB;AACpBG,QAAAA,OAAO,EAA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N,CAAsBH,GAAtB,CAA0BC,2BAA1B,CAAjD;AAEA,cAAIG,KAAK,GAAG;AACVF,YAAAA,KAAK,EAALA,KADU;AAEV9B,YAAAA,MAAM,EAANA,MAFU;AAGViC,YAAAA,YAAY,EAAE,KAAKC,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CAHJ;AAIVC,YAAAA,aAAa,EAAE,KAAKC,WAAL,CAAiBF,IAAjB,CAAsB,IAAtB,CAJL;AAKVG,YAAAA,gBAAgB,EAAE,KAAKC,cAAL,CAAoBJ,IAApB,CAAyB,IAAzB,CALR;AAMVK,YAAAA,aAAa,EAAE,KAAKC,WAAL,CAAiBN,IAAjB,CAAsB,IAAtB,CANL;AAOVO,YAAAA,eAAe,EAAE,KAAKC,aAAL,CAAmBR,IAAnB,CAAwB,IAAxB;AAPP,WAAZ;;AAUA,cAAItB,EAAE,gBAAG+B,kBAAMC,aAAN,CAAoBC,sBAApB,EAAmCd,KAAnC,CAAT;;AAEAe,+BAASC,MAAT,CAAgBnC,EAAhB,EAAoB,IAApB,EAA0B,YAAM;AAC9B,2CAAW,KAAX;AACD,WAFD;AAGD;AACF,OA1BD,CA0BE,OAAOoC,CAAP,EAAU;AACV,cAAMA,CAAN;AACD;AACF;;;kDA7IqCC,W","sourcesContent":["import * as dataConverter from './data-converter';\nimport * as pointChooser from './number-line/point-chooser';\nimport * as tickUtils from './number-line/graph/tick-utils';\n\nimport { lineIsSwitched, switchGraphLine, toGraphFormat, toSessionFormat } from './data-converter';\n\nimport Graph from './number-line/graph';\nimport NumberLineComponent from './number-line';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport RootComponent from './number-line';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { renderMath } from '@pie-lib/pie-toolbox/math-rendering';\n\n//Expose some additional modules for configuration\nexport { Graph, NumberLineComponent, tickUtils, dataConverter, pointChooser };\nexport default class NumberLine extends HTMLElement {\n constructor() {\n super();\n }\n\n set model(m) {\n this._model = m;\n this._applyInitialElements();\n this._render();\n this.dispatch('model-set');\n }\n\n set session(s) {\n this._session = s;\n this._applyInitialElements();\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n isComplete() {\n return this._session ? (this._session.answer || []).length > 0 : false;\n }\n\n dispatch(type) {\n this.dispatchEvent(\n new CustomEvent(type, {\n bubbles: true,\n detail: {\n complete: this.isComplete(),\n },\n }),\n );\n }\n\n dispatchSessionChanged() {\n this.dispatch('session-changed');\n }\n\n addElement(data) {\n if (!this._session) {\n return;\n }\n\n this._session.answer = this._session.answer || [];\n this._session.answer.push(toSessionFormat(data));\n this.dispatchSessionChanged();\n this._render();\n }\n\n moveElement(index, el, position) {\n let answer = this._session.answer[index];\n\n if (!answer) {\n throw new Error('cant find element at index: ', index);\n }\n\n if (el.type === 'line' && position.left === position.right) {\n this._render();\n return;\n }\n\n //set the new position\n el.position = position;\n\n let update = el.type === 'line' && lineIsSwitched(el) ? switchGraphLine(el) : el;\n\n this._session.answer.splice(index, 1, toSessionFormat(update));\n\n this.dispatchSessionChanged();\n this._render();\n }\n\n deleteElements(indices) {\n this._session.answer = this._session.answer.filter((v, index) => {\n return !indices.some((d) => d === index);\n });\n this.dispatchSessionChanged();\n this._render();\n }\n\n undoElement() {\n this._session.answer.pop();\n this.dispatchSessionChanged();\n this._render();\n }\n\n clearElements() {\n this._session.answer = [];\n this.dispatchSessionChanged();\n this._render();\n }\n\n _applyInitialElements() {\n if (\n this._model &&\n this._model.graph &&\n this._model.graph.initialElements &&\n this._session &&\n (!this._session.answer || !this._session.answer.length)\n ) {\n this._session.answer = cloneDeep(this._model.graph.initialElements);\n }\n }\n\n _render() {\n try {\n if (this._model && this._session) {\n if (!this._session.answer) {\n this._applyInitialElements();\n }\n\n let answer = (this._session.answer || []).map(toGraphFormat);\n let model = cloneDeep(this._model);\n model.correctResponse = model.correctResponse && model.correctResponse.map(toGraphFormat);\n\n let props = {\n model,\n answer,\n onAddElement: this.addElement.bind(this),\n onMoveElement: this.moveElement.bind(this),\n onDeleteElements: this.deleteElements.bind(this),\n onUndoElement: this.undoElement.bind(this),\n onClearElements: this.clearElements.bind(this),\n };\n\n let el = React.createElement(RootComponent, props);\n\n ReactDOM.render(el, this, () => {\n renderMath(this);\n });\n }\n } catch (e) {\n throw e;\n }\n }\n}\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/number-line",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"repository": "pie-framework/pie-elements",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"author": "pie framework developers",
|
|
25
25
|
"license": "ISC",
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "0e14ff981bcdc8a89a0e58484026496701bfdbc3",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postpublish": "../../scripts/postpublish"
|
|
29
29
|
},
|
package/LICENSE.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2019 CoreSpring Inc
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|