@pie-element/number-line 5.14.12 → 5.14.13
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
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.14.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line@5.14.12...@pie-element/number-line@5.14.13) (2022-05-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/number-line
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [5.14.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line@5.14.11...@pie-element/number-line@5.14.12) (2022-05-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/number-line
|
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
|
+
## [4.9.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line-configure@4.9.11...@pie-element/number-line-configure@4.9.12) (2022-05-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/number-line-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.9.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/number-line-configure@4.9.10...@pie-element/number-line-configure@4.9.11) (2022-05-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/number-line-configure
|
package/configure/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/number-line-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "4.9.
|
|
4
|
+
"version": "4.9.12",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
10
|
-
"@pie-lib/config-ui": "^10.13.
|
|
11
|
-
"@pie-lib/editable-html": "^7.22.
|
|
10
|
+
"@pie-lib/config-ui": "^10.13.2",
|
|
11
|
+
"@pie-lib/editable-html": "^7.22.5",
|
|
12
12
|
"react": "^16.8.1",
|
|
13
13
|
"react-dom": "^16.8.1"
|
|
14
14
|
}
|
|
@@ -81,12 +81,15 @@ var style = {
|
|
|
81
81
|
correct: rayColor(colors.correct),
|
|
82
82
|
incorrect: rayColor(colors.incorrect),
|
|
83
83
|
arrowCorrect: {
|
|
84
|
+
fill: colors.correct,
|
|
84
85
|
'--arrow-color': colors.correct
|
|
85
86
|
},
|
|
86
87
|
arrowIncorrect: {
|
|
88
|
+
fill: colors.incorrect,
|
|
87
89
|
'--arrow-color': colors.incorrect
|
|
88
90
|
},
|
|
89
91
|
arrowSelected: {
|
|
92
|
+
fill: colors.selected,
|
|
90
93
|
'--arrow-color': colors.selected
|
|
91
94
|
}
|
|
92
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/number-line/graph/elements/ray.jsx"],"names":["rayColor","stroke","fill","strokeWidth","style","ray","cursor","color","primary","transition","selected","colors","correct","incorrect","arrowCorrect","arrowIncorrect","arrowSelected","Ray","props","state","dragPosition","p","domain","min","max","setState","interval","empty","position","direction","y","disabled","width","classes","xScale","context","drag","bind","stopDrag","finalPosition","className","positive","left","right","x1","x2","arrowX","arrowDirection","noop","arrowClassNames","onToggleSelect","onMove","React","Component","PropTypes","number","isRequired","bool","oneOf","func","snapValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,kBAAAA,SAAQ;AAAA,SAAK;AAC5B,cAAU;AACRC,MAAAA,MAAM,EAAED;AADA,KADkB;AAI5B,gBAAY;AACVE,MAAAA,IAAI,EAAEF,SADI;AAEVG,MAAAA,WAAW,EAAE,KAFH;AAGVF,MAAAA,MAAM,EAAED;AAHE;AAJgB,GAAL;AAAA,CAAzB;;AAWA,IAAMI,KAAK,GAAG;AACZC,EAAAA,GAAG,EAAE;AACH,cAAU;AACRC,MAAAA,MAAM,EAAE,SADA;AAERH,MAAAA,WAAW,EAAE,KAFL;AAGRF,MAAAA,MAAM,EAAEM,gBAAMC,OAAN;AAHA,KADP;AAMH,wBAAoB;AAClBC,MAAAA,UAAU,EAAE;AADM;AANjB,GADO;AAWZC,EAAAA,QAAQ,EAAEV,QAAQ,CAACW,MAAM,CAACD,QAAR,CAXN;AAYZE,EAAAA,OAAO,EAAEZ,QAAQ,CAACW,MAAM,CAACC,OAAR,CAZL;AAaZC,EAAAA,SAAS,EAAEb,QAAQ,CAACW,MAAM,CAACE,SAAR,CAbP;AAcZC,EAAAA,YAAY,EAAE;
|
|
1
|
+
{"version":3,"sources":["../../../../src/number-line/graph/elements/ray.jsx"],"names":["rayColor","stroke","fill","strokeWidth","style","ray","cursor","color","primary","transition","selected","colors","correct","incorrect","arrowCorrect","arrowIncorrect","arrowSelected","Ray","props","state","dragPosition","p","domain","min","max","setState","interval","empty","position","direction","y","disabled","width","classes","xScale","context","drag","bind","stopDrag","finalPosition","className","positive","left","right","x1","x2","arrowX","arrowDirection","noop","arrowClassNames","onToggleSelect","onMove","React","Component","PropTypes","number","isRequired","bool","oneOf","func","snapValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,kBAAAA,SAA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 'react';\nimport PropTypes from 'prop-types';\nimport Arrow from '../arrow';\nimport Point from './point';\nimport { basePropTypes } from './base';\nimport classNames from 'classnames';\nimport injectSheet from 'react-jss';\nimport isNumber from 'lodash/isNumber';\n\nconst rayColor = rayColor => ({\n '& line': {\n stroke: rayColor\n },\n '& .arrow': {\n fill: rayColor,\n strokeWidth: '1px',\n stroke: rayColor\n }\n});\n\nconst style = {\n ray: {\n '& line': {\n cursor: 'pointer',\n strokeWidth: '5px',\n stroke: color.primary()\n },\n '& line, & .arrow': {\n transition: 'stroke 150ms linear, fill 150ms linear'\n }\n },\n selected: rayColor(colors.selected),\n correct: rayColor(colors.correct),\n incorrect: rayColor(colors.incorrect),\n arrowCorrect: {\n fill: colors.correct,\n '--arrow-color': colors.correct\n },\n arrowIncorrect: {\n fill: colors.incorrect,\n '--arrow-color': colors.incorrect\n },\n arrowSelected: {\n fill: colors.selected,\n '--arrow-color': colors.selected\n }\n};\n\nexport class Ray extends React.Component {\n static propTypes = {\n ...basePropTypes(),\n width: PropTypes.number.isRequired,\n selected: PropTypes.bool,\n disabled: PropTypes.bool,\n empty: PropTypes.bool,\n direction: PropTypes.oneOf(['positive', 'negative']),\n y: PropTypes.number,\n position: PropTypes.number.isRequired,\n onMove: PropTypes.func.isRequired,\n onToggleSelect: PropTypes.func.isRequired\n };\n\n static defaultProps = {\n selected: false,\n direction: 'positive',\n y: 0,\n disabled: false\n };\n\n static contextTypes = {\n xScale: PropTypes.func.isRequired,\n snapValue: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n dragPosition: null\n };\n }\n\n drag(p) {\n const { domain } = this.props;\n if (p >= domain.min && p <= domain.max) {\n this.setState({ dragPosition: p });\n }\n }\n\n stopDrag() {\n this.setState({ dragPosition: null });\n }\n\n render() {\n /* eslint-disable */\n const {\n interval,\n empty,\n position,\n direction,\n domain,\n y,\n selected,\n disabled,\n width,\n correct,\n classes\n } = this.props;\n /* eslint-enable */\n const { xScale } = this.context;\n\n const drag = this.drag.bind(this);\n const stopDrag = this.stopDrag.bind(this);\n\n const finalPosition = isNumber(this.state.dragPosition)\n ? this.state.dragPosition\n : position;\n\n const className = classNames(classes.ray, {\n [classes.selected]: selected,\n [classes.correct]: correct === true,\n [classes.incorrect]: correct === false\n });\n\n const positive = direction === 'positive';\n const left = positive ? finalPosition : domain.min;\n const right = positive ? domain.max : finalPosition;\n // const triangleX = positive ? xScale(right) : xScale(left);\n\n //const et the line run all the way to 0 or width.\n const x1 = positive ? xScale(left) : 8;\n const x2 = positive ? width - 8 : xScale(right);\n const arrowX = positive ? width : 0;\n const arrowDirection = positive ? 'right' : 'left';\n\n const noop = () => {};\n\n const arrowClassNames = classNames({\n [classes.arrowCorrect]: correct === true,\n [classes.arrowIncorrect]: correct === false,\n [classes.arrowSelected]: selected\n });\n\n return (\n <g className={className} transform={`translate(0, ${y})`}>\n <line\n onClick={disabled ? noop : this.props.onToggleSelect}\n className=\"line-handle\"\n x1={x1}\n x2={x2}\n />\n <Point\n disabled={disabled}\n correct={correct}\n selected={selected}\n empty={empty}\n interval={interval}\n bounds={{ left: domain.min - position, right: domain.max - position }}\n position={position}\n onDrag={drag}\n onDragStop={stopDrag}\n onMove={this.props.onMove}\n />\n <Arrow\n x={arrowX}\n className={arrowClassNames}\n direction={arrowDirection}\n />\n </g>\n );\n }\n}\n\nexport default injectSheet(style)(Ray);\n"],"file":"ray.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/number-line",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.13",
|
|
4
4
|
"repository": "pie-framework/pie-elements",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
|
-
"@pie-lib/correct-answer-toggle": "^2.3.
|
|
11
|
+
"@pie-lib/correct-answer-toggle": "^2.3.38",
|
|
12
12
|
"@pie-lib/feedback": "^0.4.27",
|
|
13
13
|
"@pie-lib/icons": "^2.4.25",
|
|
14
|
-
"@pie-lib/math-rendering": "^2.4.
|
|
15
|
-
"@pie-lib/render-ui": "^4.12.
|
|
14
|
+
"@pie-lib/math-rendering": "^2.4.2",
|
|
15
|
+
"@pie-lib/render-ui": "^4.12.8",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
17
|
"d3-scale": "^3.2.1",
|
|
18
18
|
"d3-selection": "^1.4.1",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"author": "pie framework developers",
|
|
29
29
|
"license": "ISC",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "3f3d6edc68890098821978ebd5a8b90da31ab222",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"postpublish": "../../scripts/postpublish"
|
|
33
33
|
},
|