@pie-lib/math-input 6.6.0 → 6.6.1-next.110

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/keys/log.js"],"names":["set","log","name","label","command","latex","logSubscript","ln"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,GAAG,GAAG,kBAAM,KAAN,CAAZ;AAEO,IAAMC,GAAG,GAAGD,GAAG,CAAC;AACrBE,EAAAA,IAAI,EAAE,KADe;AAErBC,EAAAA,KAAK,EAAE,KAFc;AAGrBC,EAAAA,OAAO,EAAE,OAHY;AAIrBC,EAAAA,KAAK,EAAE;AAJc,CAAD,CAAf;;AAMA,IAAMC,YAAY,GAAGN,GAAG,CAAC;AAC9BE,EAAAA,IAAI,EAAE,oBADwB;AAE9BC,EAAAA,KAAK,EAAE,OAFuB;AAG9BE,EAAAA,KAAK,EAAE,UAHuB;AAI9BD,EAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,GAAV;AAJqB,CAAD,CAAxB;;AAMA,IAAMG,EAAE,GAAGP,GAAG,CAAC;AACpBE,EAAAA,IAAI,EAAE,IADc;AAEpBC,EAAAA,KAAK,EAAE,IAFa;AAGpBC,EAAAA,OAAO,EAAE,MAHW;AAIpBC,EAAAA,KAAK,EAAE;AAJa,CAAD,CAAd","sourcesContent":["import { mkSet } from './utils';\n\nconst set = mkSet('log');\n\nexport const log = set({\n name: 'Log',\n label: 'log',\n command: '\\\\log',\n latex: '\\\\log'\n});\nexport const logSubscript = set({\n name: 'Log with subscript',\n label: 'log s',\n latex: '\\\\log_{}',\n command: ['\\\\log', '_']\n});\nexport const ln = set({\n name: 'Ln',\n label: 'ln',\n command: '\\\\ln',\n latex: '\\\\ln'\n});\n"],"file":"log.js"}
1
+ {"version":3,"sources":["../../src/keys/log.js"],"names":["set","log","name","label","command","latex","logSubscript","ln"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,GAAG,GAAG,kBAAM,KAAN,CAAZ;AAEO,IAAMC,GAAG,GAAGD,GAAG,CAAC;AACrBE,EAAAA,IAAI,EAAE,KADe;AAErBC,EAAAA,KAAK,EAAE,KAFc;AAGrBC,EAAAA,OAAO,EAAE,OAHY;AAIrBC,EAAAA,KAAK,EAAE;AAJc,CAAD,CAAf;;AAMA,IAAMC,YAAY,GAAGN,GAAG,CAAC;AAC9BE,EAAAA,IAAI,EAAE,oBADwB;AAE9BC,EAAAA,KAAK,EAAE,OAFuB;AAG9BE,EAAAA,KAAK,EAAE,UAHuB;AAI9BD,EAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,GAAV,EAAe,GAAf;AAJqB,CAAD,CAAxB;;AAMA,IAAMG,EAAE,GAAGP,GAAG,CAAC;AACpBE,EAAAA,IAAI,EAAE,IADc;AAEpBC,EAAAA,KAAK,EAAE,IAFa;AAGpBC,EAAAA,OAAO,EAAE,MAHW;AAIpBC,EAAAA,KAAK,EAAE;AAJa,CAAD,CAAd","sourcesContent":["import { mkSet } from './utils';\n\nconst set = mkSet('log');\n\nexport const log = set({\n name: 'Log',\n label: 'log',\n command: '\\\\log',\n latex: '\\\\log'\n});\nexport const logSubscript = set({\n name: 'Log with subscript',\n label: 'log s',\n latex: '\\\\log_{}',\n command: ['\\\\log', '_', ' ']\n});\nexport const ln = set({\n name: 'Ln',\n label: 'ln',\n command: '\\\\ln',\n latex: '\\\\ln'\n});\n"],"file":"log.js"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.sigma = exports.mu = exports.yBar = exports.xBar = void 0;
6
+ exports.smallSigma = exports.sigma = exports.mu = exports.yBar = exports.xBar = void 0;
7
7
 
8
8
  var _utils = require("./utils");
9
9
 
@@ -35,4 +35,11 @@ var sigma = set({
35
35
  write: '\\Sigma'
36
36
  });
37
37
  exports.sigma = sigma;
38
+ var smallSigma = set({
39
+ name: 'sigma',
40
+ label: '\\sigma',
41
+ latex: '\\sigma',
42
+ write: '\\sigma'
43
+ });
44
+ exports.smallSigma = smallSigma;
38
45
  //# sourceMappingURL=statistics.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/keys/statistics.js"],"names":["set","xBar","name","label","latex","write","yBar","mu","sigma"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,GAAG,GAAG,kBAAM,YAAN,CAAZ;AACO,IAAMC,IAAI,GAAGD,GAAG,CAAC;AACtBE,EAAAA,IAAI,EAAE,OADgB;AAEtBC,EAAAA,KAAK,EAAE,IAFe;AAGtBC,EAAAA,KAAK,EAAE,eAHe;AAItBC,EAAAA,KAAK,EAAE;AAJe,CAAD,CAAhB;;AAOA,IAAMC,IAAI,GAAGN,GAAG,CAAC;AACtBE,EAAAA,IAAI,EAAE,OADgB;AAEtBE,EAAAA,KAAK,EAAE,eAFe;AAGtBC,EAAAA,KAAK,EAAE;AAHe,CAAD,CAAhB;;AAMA,IAAME,EAAE,GAAGP,GAAG,CAAC;AACpBE,EAAAA,IAAI,EAAE,IADc;AAEpBC,EAAAA,KAAK,EAAE,IAFa;AAGpBC,EAAAA,KAAK,EAAE,MAHa;AAIpBC,EAAAA,KAAK,EAAE;AAJa,CAAD,CAAd;;AAOA,IAAMG,KAAK,GAAGR,GAAG,CAAC;AACvBE,EAAAA,IAAI,EAAE,OADiB;AAEvBC,EAAAA,KAAK,EAAE,SAFgB;AAGvBC,EAAAA,KAAK,EAAE,SAHgB;AAIvBC,EAAAA,KAAK,EAAE;AAJgB,CAAD,CAAjB","sourcesContent":["import { mkSet } from './utils';\n\nconst set = mkSet('statistics');\nexport const xBar = set({\n name: 'X Bar',\n label: 'x̄',\n latex: '\\\\overline{x}',\n write: '\\\\overline{x}'\n});\n\nexport const yBar = set({\n name: 'Y Bar',\n latex: '\\\\overline{y}',\n write: '\\\\overline{y}'\n});\n\nexport const mu = set({\n name: 'mu',\n label: 'mu',\n latex: '\\\\mu',\n write: '\\\\mu'\n});\n\nexport const sigma = set({\n name: 'Sigma',\n label: '\\\\Sigma',\n latex: '\\\\Sigma',\n write: '\\\\Sigma'\n});\n"],"file":"statistics.js"}
1
+ {"version":3,"sources":["../../src/keys/statistics.js"],"names":["set","xBar","name","label","latex","write","yBar","mu","sigma","smallSigma"],"mappings":";;;;;;;AAAA;;AAEA,IAAMA,GAAG,GAAG,kBAAM,YAAN,CAAZ;AACO,IAAMC,IAAI,GAAGD,GAAG,CAAC;AACtBE,EAAAA,IAAI,EAAE,OADgB;AAEtBC,EAAAA,KAAK,EAAE,IAFe;AAGtBC,EAAAA,KAAK,EAAE,eAHe;AAItBC,EAAAA,KAAK,EAAE;AAJe,CAAD,CAAhB;;AAOA,IAAMC,IAAI,GAAGN,GAAG,CAAC;AACtBE,EAAAA,IAAI,EAAE,OADgB;AAEtBE,EAAAA,KAAK,EAAE,eAFe;AAGtBC,EAAAA,KAAK,EAAE;AAHe,CAAD,CAAhB;;AAMA,IAAME,EAAE,GAAGP,GAAG,CAAC;AACpBE,EAAAA,IAAI,EAAE,IADc;AAEpBC,EAAAA,KAAK,EAAE,IAFa;AAGpBC,EAAAA,KAAK,EAAE,MAHa;AAIpBC,EAAAA,KAAK,EAAE;AAJa,CAAD,CAAd;;AAOA,IAAMG,KAAK,GAAGR,GAAG,CAAC;AACvBE,EAAAA,IAAI,EAAE,OADiB;AAEvBC,EAAAA,KAAK,EAAE,SAFgB;AAGvBC,EAAAA,KAAK,EAAE,SAHgB;AAIvBC,EAAAA,KAAK,EAAE;AAJgB,CAAD,CAAjB;;AAOA,IAAMI,UAAU,GAAGT,GAAG,CAAC;AAC5BE,EAAAA,IAAI,EAAE,OADsB;AAE5BC,EAAAA,KAAK,EAAE,SAFqB;AAG5BC,EAAAA,KAAK,EAAE,SAHqB;AAI5BC,EAAAA,KAAK,EAAE;AAJqB,CAAD,CAAtB","sourcesContent":["import { mkSet } from './utils';\n\nconst set = mkSet('statistics');\nexport const xBar = set({\n name: 'X Bar',\n label: 'x̄',\n latex: '\\\\overline{x}',\n write: '\\\\overline{x}'\n});\n\nexport const yBar = set({\n name: 'Y Bar',\n latex: '\\\\overline{y}',\n write: '\\\\overline{y}'\n});\n\nexport const mu = set({\n name: 'mu',\n label: 'mu',\n latex: '\\\\mu',\n write: '\\\\mu'\n});\n\nexport const sigma = set({\n name: 'Sigma',\n label: '\\\\Sigma',\n latex: '\\\\Sigma',\n write: '\\\\Sigma'\n});\n\nexport const smallSigma = set({\n name: 'sigma',\n label: '\\\\sigma',\n latex: '\\\\sigma',\n write: '\\\\sigma'\n});\n"],"file":"statistics.js"}
package/lib/mq/static.js CHANGED
@@ -147,7 +147,13 @@ function (_React$Component) {
147
147
  });
148
148
  }
149
149
 
150
- this.mathField.latex(this.props.latex);
150
+ try {
151
+ this.mathField.parseLatex(this.props.latex);
152
+ this.mathField.latex(this.props.latex);
153
+ } catch (e) {
154
+ // default latex if received has errors
155
+ this.mathField.latex('\\MathQuillMathField[r1]{}');
156
+ }
151
157
  }
152
158
  }, {
153
159
  key: "blur",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mq/static.jsx"],"names":["MQ","window","MathQuill","getInterface","log","REGEX","WHITESPACE_REGEX","stripSpaces","string","replace","Static","e","rootBlock","target","parentElement","nextSibling","id","parseInt","getAttribute","innerField","mathField","innerFields","find","f","name","props","getFieldName","setInput","onSubFieldFocus","err","console","error","message","update","field","onSubFieldChange","latex","Error","StaticMath","input","handlers","edit","onInputEdit","bind","blur","focus","nextProps","parsedLatex","parseLatex","stripped","newFieldCount","match","length","out","trim","Object","keys","warn","onBlur","className","onFocus","r","React","Component","PropTypes","isRequired","func"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAIA,EAAJ;;AACA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjCD,EAAAA,EAAE,GAAGE,sBAAUC,YAAV,CAAuB,CAAvB,CAAL;AACD;;AAED,IAAMC,GAAG,GAAG,uBAAM,8BA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e,EAAEoC,sBAAUE,IAPV;AAQjBvC,EAAAA,QAAQ,EAAEqC,sBAAUE;AARH,C","sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport debug from 'debug';\nimport MathQuill from '@pie-framework/mathquill';\nimport { updateSpans } from '../index';\n\nlet MQ;\nif (typeof window !== 'undefined') {\n MQ = MathQuill.getInterface(2);\n}\n\nconst log = debug('pie-lib:math-input:mq:static');\nconst REGEX = /\\\\MathQuillMathField\\[r\\d*\\]\\{(.*?)\\}/g;\nconst WHITESPACE_REGEX = / /g;\n\nfunction stripSpaces(string = '') {\n return string.replace(WHITESPACE_REGEX, '');\n}\n\n/**\n * Wrapper for MathQuill MQ.MathField.\n */\nexport default class Static extends React.Component {\n static propTypes = {\n latex: PropTypes.string.isRequired,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n className: PropTypes.string,\n getFieldName: PropTypes.func,\n onSubFieldChange: PropTypes.func,\n onSubFieldFocus: PropTypes.func,\n setInput: PropTypes.func\n };\n\n componentDidMount() {\n this.update();\n updateSpans();\n }\n\n componentDidUpdate() {\n this.update();\n updateSpans();\n }\n\n onInputEdit(field) {\n if (!this.mathField) {\n return;\n }\n const name = this.props.getFieldName(field, this.mathField.innerFields);\n if (this.props.onSubFieldChange) {\n this.props.onSubFieldChange(name, field.latex());\n }\n }\n\n update() {\n if (!MQ) {\n throw new Error('MQ is not defined - but component has mounted?');\n }\n // this.input.innerHTML = this.props.latex;\n if (!this.mathField) {\n this.mathField = MQ.StaticMath(this.input, {\n handlers: {\n edit: this.onInputEdit.bind(this)\n }\n });\n }\n\n this.mathField.latex(this.props.latex);\n }\n\n blur() {\n log('blur mathfield');\n this.mathField.blur();\n }\n\n focus() {\n log('focus mathfield...');\n this.mathField.focus();\n }\n\n shouldComponentUpdate(nextProps) {\n try {\n const parsedLatex = this.mathField.parseLatex(nextProps.latex);\n const stripped = stripSpaces(parsedLatex);\n const newFieldCount = (nextProps.latex.match(REGEX) || []).length;\n\n const out =\n stripped !== stripSpaces(this.mathField.latex().trim()) ||\n newFieldCount !== Object.keys(this.mathField.innerFields).length / 2;\n\n log('[shouldComponentUpdate] ', out);\n return out;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Error parsing latex:', e.message, 'skip update');\n // eslint-disable-next-line no-console\n console.warn(e);\n return false;\n }\n }\n\n onFocus = e => {\n try {\n let rootBlock = e.target.parentElement.nextSibling;\n let id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);\n\n if (!id) {\n rootBlock = rootBlock.parentElement;\n id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);\n }\n\n const innerField = this.mathField.innerFields.find(f => f.id === id);\n\n if (innerField) {\n const name = this.props.getFieldName(innerField, this.mathField.innerFields);\n if (this.props.setInput) {\n this.props.setInput(innerField);\n }\n this.props.onSubFieldFocus(name, innerField);\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('error finding root block', err.message);\n }\n };\n\n render() {\n const { onBlur, className } = this.props;\n\n return (\n <span\n className={className}\n onFocus={this.onFocus}\n onBlur={onBlur}\n ref={r => (this.input = r)}\n />\n );\n }\n}\n"],"file":"static.js"}
1
+ {"version":3,"sources":["../../src/mq/static.jsx"],"names":["MQ","window","MathQuill","getInterface","log","REGEX","WHITESPACE_REGEX","stripSpaces","string","replace","Static","e","rootBlock","target","parentElement","nextSibling","id","parseInt","getAttribute","innerField","mathField","innerFields","find","f","name","props","getFieldName","setInput","onSubFieldFocus","err","console","error","message","update","field","onSubFieldChange","latex","Error","StaticMath","input","handlers","edit","onInputEdit","bind","parseLatex","blur","focus","nextProps","parsedLatex","stripped","newFieldCount","match","length","out","trim","Object","keys","warn","onBlur","className","onFocus","r","React","Component","PropTypes","isRequired","func"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAIA,EAAJ;;AACA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjCD,EAAAA,EAAE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ByD,UADP;AAEjBL,EAAAA,OAAO,EAAEI,sBAAUE,IAFF;AAGjBR,EAAAA,MAAM,EAAEM,sBAAUE,IAHD;AAIjBP,EAAAA,SAAS,EAAEK,sBAAUxD,MAJJ;AAKjBkB,EAAAA,YAAY,EAAEsC,sBAAUE,IALP;AAMjB/B,EAAAA,gBAAgB,EAAE6B,sBAAUE,IANX;AAOjBtC,EAAAA,eAAe,EAAEoC,sBAAUE,IAPV;AAQjBvC,EAAAA,QAAQ,EAAEqC,sBAAUE;AARH,C","sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport debug from 'debug';\nimport MathQuill from '@pie-framework/mathquill';\nimport { updateSpans } from '../index';\n\nlet MQ;\nif (typeof window !== 'undefined') {\n MQ = MathQuill.getInterface(2);\n}\n\nconst log = debug('pie-lib:math-input:mq:static');\nconst REGEX = /\\\\MathQuillMathField\\[r\\d*\\]\\{(.*?)\\}/g;\nconst WHITESPACE_REGEX = / /g;\n\nfunction stripSpaces(string = '') {\n return string.replace(WHITESPACE_REGEX, '');\n}\n\n/**\n * Wrapper for MathQuill MQ.MathField.\n */\nexport default class Static extends React.Component {\n static propTypes = {\n latex: PropTypes.string.isRequired,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n className: PropTypes.string,\n getFieldName: PropTypes.func,\n onSubFieldChange: PropTypes.func,\n onSubFieldFocus: PropTypes.func,\n setInput: PropTypes.func\n };\n\n componentDidMount() {\n this.update();\n updateSpans();\n }\n\n componentDidUpdate() {\n this.update();\n updateSpans();\n }\n\n onInputEdit(field) {\n if (!this.mathField) {\n return;\n }\n const name = this.props.getFieldName(field, this.mathField.innerFields);\n if (this.props.onSubFieldChange) {\n this.props.onSubFieldChange(name, field.latex());\n }\n }\n\n update() {\n if (!MQ) {\n throw new Error('MQ is not defined - but component has mounted?');\n }\n // this.input.innerHTML = this.props.latex;\n if (!this.mathField) {\n this.mathField = MQ.StaticMath(this.input, {\n handlers: {\n edit: this.onInputEdit.bind(this)\n }\n });\n }\n\n try {\n this.mathField.parseLatex(this.props.latex);\n this.mathField.latex(this.props.latex);\n } catch (e) {\n // default latex if received has errors\n this.mathField.latex('\\\\MathQuillMathField[r1]{}');\n }\n }\n\n blur() {\n log('blur mathfield');\n this.mathField.blur();\n }\n\n focus() {\n log('focus mathfield...');\n this.mathField.focus();\n }\n\n shouldComponentUpdate(nextProps) {\n try {\n const parsedLatex = this.mathField.parseLatex(nextProps.latex);\n const stripped = stripSpaces(parsedLatex);\n const newFieldCount = (nextProps.latex.match(REGEX) || []).length;\n\n const out =\n stripped !== stripSpaces(this.mathField.latex().trim()) ||\n newFieldCount !== Object.keys(this.mathField.innerFields).length / 2;\n\n log('[shouldComponentUpdate] ', out);\n return out;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Error parsing latex:', e.message, 'skip update');\n // eslint-disable-next-line no-console\n console.warn(e);\n return false;\n }\n }\n\n onFocus = e => {\n try {\n let rootBlock = e.target.parentElement.nextSibling;\n let id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);\n\n if (!id) {\n rootBlock = rootBlock.parentElement;\n id = parseInt(rootBlock.getAttribute('mathquill-block-id'), 10);\n }\n\n const innerField = this.mathField.innerFields.find(f => f.id === id);\n\n if (innerField) {\n const name = this.props.getFieldName(innerField, this.mathField.innerFields);\n if (this.props.setInput) {\n this.props.setInput(innerField);\n }\n this.props.onSubFieldFocus(name, innerField);\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('error finding root block', err.message);\n }\n };\n\n render() {\n const { onBlur, className } = this.props;\n\n return (\n <span\n className={className}\n onFocus={this.onFocus}\n onBlur={onBlur}\n ref={r => (this.input = r)}\n />\n );\n }\n}\n"],"file":"static.js"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.6.0",
6
+ "version": "6.6.1-next.110+3a8d861d",
7
7
  "main": "lib/index.js",
8
8
  "module": "src/index.jsx",
9
9
  "dependencies": {
@@ -22,5 +22,5 @@
22
22
  "react-dom": "^16.9.0"
23
23
  },
24
24
  "scripts": {},
25
- "gitHead": "de37d3ba44d3e7934e2f804381fe50d2da16a29a"
25
+ "gitHead": "3a8d861db52422c3521bbf66ce340e528dd9c362"
26
26
  }
@@ -47,6 +47,7 @@ export default class HorizontalKeypad extends React.Component {
47
47
  noDecimal={noDecimal}
48
48
  additionalKeys={extendKeySet(keysForGrade(mode), normalizedKeys)}
49
49
  onPress={this.keypadPress}
50
+ mode={mode}
50
51
  />
51
52
  );
52
53
  }
@@ -41,6 +41,9 @@ const LatexButton = withStyles(theme => ({
41
41
  marginTop: '0 !important',
42
42
  borderTop: '2px solid black',
43
43
  '&.mq-arrow-both': {
44
+ '& *': {
45
+ lineHeight: '1 !important'
46
+ },
44
47
  '&:before': {
45
48
  fontSize: '80%',
46
49
  left: 'calc(-13%)',
@@ -98,10 +101,31 @@ const LatexButton = withStyles(theme => ({
98
101
  '& .mq-longdiv-inner': {
99
102
  borderTop: '1px solid !important',
100
103
  paddingTop: '1.5px !important'
104
+ },
105
+ '& .mq-parallelogram': {
106
+ lineHeight: 0.85
107
+ },
108
+ '& .mq-overarc': {
109
+ borderTop: '2px solid black !important',
110
+ '& .mq-overline-inner': {
111
+ borderTop: 'none !important',
112
+ paddingTop: '0 !important'
113
+ }
101
114
  }
102
115
  },
103
116
  parallelButton: {
104
117
  fontStyle: 'italic'
118
+ },
119
+ leftRightArrowButton: {
120
+ '& .mq-overarrow.mq-arrow-both': {
121
+ '& .mq-overline-inner': {
122
+ borderTop: 'none !important',
123
+ paddingTop: '0 !important'
124
+ },
125
+ '&:after': {
126
+ top: '-1.64em !important'
127
+ }
128
+ }
105
129
  }
106
130
  }))(props => {
107
131
  let buttonClass;
@@ -112,6 +136,12 @@ const LatexButton = withStyles(theme => ({
112
136
  props.mqClassName,
113
137
  props.classes.parallelButton
114
138
  );
139
+ } else if (props.latex === '\\overleftrightarrow{\\overline{}}') {
140
+ buttonClass = classNames(
141
+ props.classes.latexButton,
142
+ props.mqClassName,
143
+ props.classes.leftRightArrowButton
144
+ );
115
145
  } else {
116
146
  buttonClass = classNames(props.classes.latexButton, props.mqClassName);
117
147
  }
@@ -130,7 +160,8 @@ export class KeyPad extends React.Component {
130
160
  additionalKeys: PropTypes.array,
131
161
  onPress: PropTypes.func.isRequired,
132
162
  onFocus: PropTypes.func,
133
- noDecimal: PropTypes.bool
163
+ noDecimal: PropTypes.bool,
164
+ mode: PropTypes.string
134
165
  };
135
166
  static defaultProps = {
136
167
  baseSet: baseSet,
@@ -162,9 +193,20 @@ export class KeyPad extends React.Component {
162
193
  };
163
194
 
164
195
  render() {
165
- const { classes, className, baseSet, additionalKeys, onFocus } = this.props;
196
+ const { classes, className, baseSet, additionalKeys, onFocus, mode } = this.props;
197
+
198
+ const noBaseSet = [
199
+ 'non-negative-integers',
200
+ 'integers',
201
+ 'decimals',
202
+ 'fractions',
203
+ 'item-authoring'
204
+ ];
166
205
 
167
- const allKeys = this.flowKeys(baseSet, additionalKeys || []); //, ...sortKeys(additionalKeys)];
206
+ const keysWithoutBaseSet = noBaseSet.includes(mode);
207
+ const allKeys = keysWithoutBaseSet
208
+ ? this.flowKeys([], additionalKeys || [])
209
+ : this.flowKeys(baseSet, additionalKeys || []); //, ...sortKeys(additionalKeys)];
168
210
 
169
211
  const shift = allKeys.length % 5 ? 1 : 0;
170
212
  const style = {
@@ -184,7 +226,7 @@ export class KeyPad extends React.Component {
184
226
  onClick,
185
227
  className: classNames(
186
228
  classes.labelButton,
187
- classes[k.category],
229
+ !keysWithoutBaseSet && classes[k.category],
188
230
  k.label === ',' && classes.comma,
189
231
  k.label === '.' && classes.dot
190
232
  ),
@@ -14,5 +14,22 @@ export const eulers = set({
14
14
  name: 'Eulers',
15
15
  label: 'e',
16
16
  latex: 'e',
17
+ command: 'e',
18
+ category: 'constants'
19
+ });
20
+
21
+ export const infinity = set({
22
+ name: 'Infinity',
23
+ label: '\\infty',
24
+ latex: '\\infty',
25
+ command: '\\infty',
26
+ category: 'constants'
27
+ });
28
+
29
+ export const halfInfinity = set({
30
+ name: 'Half Infinity',
31
+ label: '\\propto',
32
+ latex: '\\propto',
33
+ command: '\\propto',
17
34
  category: 'constants'
18
35
  });
@@ -14,7 +14,7 @@ export const overRightArrow = set({
14
14
 
15
15
  export const overLeftRightArrow = set({
16
16
  name: 'Overline',
17
- latex: '\\overleftrightarrow{}',
17
+ latex: '\\overleftrightarrow{\\overline{}}', // used this notation to display the pink box
18
18
  symbol: 'AB',
19
19
  command: '\\overleftrightarrow'
20
20
  });
@@ -51,13 +51,13 @@ export const angle = set({
51
51
  });
52
52
  export const overArc = set({
53
53
  name: 'Over arc',
54
- latex: '\\overarc{}',
54
+ latex: '\\overarc{\\overline{}}', // used this notation to display the pink box
55
55
  command: '\\overarc'
56
56
  });
57
57
  export const measureOfAngle = set({
58
58
  name: 'Measure Of Angle',
59
59
  latex: '\\measuredangle',
60
- command: '\\measuredangle'
60
+ command: ['m', '\\angle']
61
61
  });
62
62
 
63
63
  export const triangle = set({
@@ -66,6 +66,12 @@ export const triangle = set({
66
66
  command: '\\triangle'
67
67
  });
68
68
 
69
+ export const square = set({
70
+ name: 'Square',
71
+ latex: '\\square',
72
+ command: '\\square'
73
+ });
74
+
69
75
  export const parallelogram = set({
70
76
  name: 'Parallelogram',
71
77
  latex: '\\parallelogram',
@@ -114,3 +120,21 @@ export const doublePrimeArcSecond = set({
114
120
  latex: '"',
115
121
  write: '"'
116
122
  });
123
+
124
+ export const leftArrow = set({
125
+ name: 'Left Arrow',
126
+ latex: '\\leftarrow',
127
+ command: '\\leftarrow'
128
+ });
129
+
130
+ export const rightArrow = set({
131
+ name: 'Right Arrow',
132
+ latex: '\\rightarrow',
133
+ command: '\\rightarrow'
134
+ });
135
+
136
+ export const leftrightArrow = set({
137
+ name: 'Left Right Arrow',
138
+ latex: '\\leftrightarrow',
139
+ command: '\\leftrightarrow'
140
+ });
@@ -14,18 +14,27 @@ import * as basicOperators from './basic-operators';
14
14
  import * as matrices from './matrices';
15
15
  import digits from './digits';
16
16
  import * as logic from './logic';
17
+ import * as nav from './navigation';
18
+ import * as edit from './edit';
17
19
 
18
20
  const hs = [
19
- [vars.x, vars.y, exponent.squared, exponent.squareRoot, vars.theta],
20
- [fractions.xOverBlank, subSup.subscript, exponent.xToPowerOfN, exponent.nthRoot],
21
- [comparison.lessThanEqual, comparison.greaterThanEqual, misc.plusMinus, misc.absValue],
22
- [constants.pi, { name: 'i', latex: 'i', write: 'i' }, misc.parenthesis, misc.brackets],
23
- [trigonometry.sin, trigonometry.cos, trigonometry.tan, geometry.degree]
21
+ [fractions.blankOverBlank, misc.percentage, vars.x, exponent.squared, exponent.squareRoot],
22
+ [operators.circleDot, vars.y, subSup.subscript, exponent.xToPowerOfN, exponent.nthRoot],
23
+ [
24
+ misc.plusMinus,
25
+ comparison.lessThan,
26
+ comparison.greaterThan,
27
+ comparison.lessThanEqual,
28
+ comparison.greaterThanEqual
29
+ ],
30
+ [constants.pi, vars.theta, misc.parenthesis, misc.brackets, misc.absValue],
31
+ [misc.notEqual, trigonometry.sin, trigonometry.cos, trigonometry.tan, geometry.degree]
24
32
  ];
25
33
 
26
34
  const advancedAlgebra = (() => {
27
35
  const out = [...hs.map(arr => [...arr])];
28
36
 
37
+ out[0].push({ name: 'i', latex: 'i', write: 'i' });
29
38
  out[1].push(log.log);
30
39
  out[2].push(log.logSubscript);
31
40
  out[3].push(log.ln);
@@ -35,10 +44,11 @@ const advancedAlgebra = (() => {
35
44
 
36
45
  const statisticsSet = (() => {
37
46
  const out = [...hs.map(arr => [...arr])];
38
- out[1].push(statistics.mu);
39
- out[2].push(statistics.xBar);
40
- out[3].push(statistics.yBar);
41
- out[4].push(statistics.sigma);
47
+ out[0].push(statistics.mu);
48
+ out[1].push(statistics.xBar);
49
+ out[2].push(statistics.yBar);
50
+ out[3].push(statistics.sigma);
51
+ out[4].push(statistics.smallSigma);
42
52
  return out;
43
53
  })();
44
54
 
@@ -54,109 +64,148 @@ export const gradeSets = [
54
64
  {
55
65
  predicate: n => n >= 6 && n <= 7,
56
66
  set: [
57
- [vars.x, vars.y, exponent.squared, exponent.squareRoot, operators.circleDot],
58
- [fractions.xOverBlank, fractions.xBlankBlank, exponent.xToPowerOfN, exponent.nthRoot, logic.longDivision],
59
- [comparison.lessThan, comparison.greaterThan, misc.plusMinus, misc.absValue],
60
- [comparison.lessThanEqual, comparison.greaterThanEqual, misc.parenthesis, constants.pi],
61
- [trigonometry.sin, trigonometry.cos, trigonometry.tan, geometry.degree]
67
+ [geometry.degree, comparison.lessThan, comparison.greaterThan],
68
+ [operators.circleDot, comparison.lessThanEqual, comparison.greaterThanEqual],
69
+ [vars.x, vars.y, exponent.squared, exponent.xToPowerOfN],
70
+ [misc.plusMinus, fractions.xOverBlank, fractions.xBlankBlank, exponent.squareRoot],
71
+ [constants.pi, misc.parenthesis, misc.absValue, exponent.nthRoot]
62
72
  ]
63
73
  },
64
74
  {
65
75
  predicate: n => n >= 8 || n === 'HS',
76
+ set: hs
77
+ },
78
+ {
79
+ predicate: 'non-negative-integers',
66
80
  set: [
67
- [vars.x, vars.y, exponent.squared, exponent.squareRoot, operators.circleDot],
68
- [fractions.xOverBlank, subSup.subscript, exponent.xToPowerOfN, exponent.nthRoot],
69
- [
70
- comparison.lessThanEqual,
71
- comparison.greaterThanEqual,
72
- misc.plusMinus,
73
- misc.absValue
74
- // matrices.singleCellMatrix
75
- ],
76
- [
77
- constants.pi,
78
- { name: 'i', latex: 'i', write: 'i' },
79
- misc.parenthesis,
80
- misc.brackets
81
- // matrices.doubleCellMatrix
82
- ],
83
- [trigonometry.sin, trigonometry.cos, trigonometry.tan, geometry.degree]
81
+ [digits.seven, digits.eight, digits.nine],
82
+ [digits.four, digits.five, digits.six],
83
+ [digits.one, digits.two, digits.three],
84
+ [digits.zero, { name: '', latex: '', write: '' }, { name: '', latex: '', write: '' }],
85
+ [nav.left, nav.right, edit.del]
86
+ ]
87
+ },
88
+ {
89
+ predicate: 'integers',
90
+ set: [
91
+ [digits.seven, digits.eight, digits.nine],
92
+ [digits.four, digits.five, digits.six],
93
+ [digits.one, digits.two, digits.three],
94
+ [digits.zero, { name: '', latex: '', write: '' }, basicOperators.minus],
95
+ [nav.left, nav.right, edit.del]
96
+ ]
97
+ },
98
+ {
99
+ predicate: 'decimals',
100
+ set: [
101
+ [digits.seven, digits.eight, digits.nine],
102
+ [digits.four, digits.five, digits.six],
103
+ [digits.one, digits.two, digits.three],
104
+ [digits.zero, digits.decimalPoint, basicOperators.minus],
105
+ [nav.left, nav.right, edit.del]
106
+ ]
107
+ },
108
+ {
109
+ predicate: 'fractions',
110
+ set: [
111
+ [digits.seven, digits.eight, digits.nine],
112
+ [digits.four, digits.five, digits.six],
113
+ [digits.one, digits.two, digits.three],
114
+ [digits.zero, fractions.blankOverBlank, basicOperators.minus],
115
+ [nav.left, nav.right, edit.del]
84
116
  ]
85
117
  },
86
118
  {
87
119
  predicate: 'geometry',
88
120
  set: [
89
121
  [
122
+ fractions.blankOverBlank,
90
123
  geometry.degree,
91
124
  geometry.primeArcminute,
92
125
  geometry.doublePrimeArcSecond,
93
- geometry.triangle,
94
- fractions.xOverBlank
126
+ geometry.congruentTo,
127
+ geometry.similarTo
95
128
  ],
96
129
  [
130
+ operators.circleDot,
97
131
  geometry.angle,
98
132
  geometry.measureOfAngle,
99
- geometry.similarTo,
100
- geometry.congruentTo,
101
- exponent.squareRoot
102
- ],
103
- [trigonometry.sin, trigonometry.cos, trigonometry.tan, trigonometry.sec, exponent.nthRoot],
104
- [trigonometry.csc, trigonometry.cot, exponent.xToPowerOfN, constants.pi, subSup.subscript],
105
- [
106
- geometry.overline,
107
- geometry.overRightArrow,
108
- geometry.overLeftRightArrow,
109
- geometry.overArc,
110
- vars.theta
111
- ]
112
- ]
113
- },
114
- {
115
- predicate: 'miscellaneous',
116
- set: [
117
- [
118
- subSup.superscript,
119
- subSup.subscript,
120
- fractions.blankOverBlank,
121
- misc.percentage,
122
- geometry.segment,
123
- geometry.parallel
133
+ geometry.triangle,
134
+ geometry.notCongruentTo,
135
+ misc.notSimilar
124
136
  ],
125
137
  [
138
+ trigonometry.sin,
139
+ trigonometry.cos,
140
+ trigonometry.tan,
141
+ constants.pi,
126
142
  exponent.squareRoot,
127
- exponent.nthRoot,
128
- misc.absValue,
129
- misc.parenthesis,
130
- geometry.perpindicular,
131
- geometry.angle
132
- ],
133
- [
134
- comparison.lessThan,
135
- comparison.greaterThan,
136
- geometry.degree,
137
- misc.approx,
138
- geometry.measureOfAngle,
139
- geometry.triangle
143
+ exponent.nthRoot
140
144
  ],
141
145
  [
142
- misc.nApprox,
143
- misc.notEqual,
144
- geometry.congruentTo,
145
- geometry.notCongruentTo,
146
- geometry.parallelogram,
147
- geometry.circledDot
146
+ trigonometry.csc,
147
+ trigonometry.sec,
148
+ trigonometry.cot,
149
+ vars.theta,
150
+ subSup.subscript,
151
+ exponent.xToPowerOfN
148
152
  ],
149
153
  [
150
- misc.similar,
151
- misc.notSimilar,
152
- comparison.lessThanEqual,
153
- comparison.greaterThanEqual,
154
- vars.x,
155
- vars.y
154
+ geometry.overline,
155
+ geometry.overRightArrow,
156
+ geometry.overLeftRightArrow,
157
+ geometry.overArc,
158
+ geometry.perpindicular,
159
+ geometry.parallel
156
160
  ]
157
161
  ]
158
162
  },
159
163
  // {
164
+ // predicate: 'miscellaneous',
165
+ // set: [
166
+ // [
167
+ // subSup.superscript,
168
+ // subSup.subscript,
169
+ // fractions.blankOverBlank,
170
+ // misc.percentage,
171
+ // geometry.segment,
172
+ // geometry.parallel
173
+ // ],
174
+ // [
175
+ // exponent.squareRoot,
176
+ // exponent.nthRoot,
177
+ // misc.absValue,
178
+ // misc.parenthesis,
179
+ // geometry.perpindicular,
180
+ // geometry.angle
181
+ // ],
182
+ // [
183
+ // comparison.lessThan,
184
+ // comparison.greaterThan,
185
+ // geometry.degree,
186
+ // misc.approx,
187
+ // geometry.measureOfAngle,
188
+ // geometry.triangle
189
+ // ],
190
+ // [
191
+ // misc.nApprox,
192
+ // misc.notEqual,
193
+ // geometry.congruentTo,
194
+ // geometry.notCongruentTo,
195
+ // geometry.parallelogram,
196
+ // geometry.circledDot
197
+ // ],
198
+ // [
199
+ // misc.similar,
200
+ // misc.notSimilar,
201
+ // comparison.lessThanEqual,
202
+ // comparison.greaterThanEqual,
203
+ // vars.x,
204
+ // vars.y
205
+ // ]
206
+ // ]
207
+ // },
208
+ // {
160
209
  // predicate: 'everything',
161
210
  // set: [
162
211
  // [
@@ -208,6 +257,71 @@ export const gradeSets = [
208
257
  {
209
258
  predicate: 'statistics',
210
259
  set: statisticsSet
260
+ },
261
+ {
262
+ predicate: 'item-authoring',
263
+ set: [
264
+ [
265
+ basicOperators.divide,
266
+ fractions.blankOverBlank,
267
+ logic.longDivision,
268
+ constants.halfInfinity,
269
+ exponent.squared,
270
+ exponent.squareRoot,
271
+ geometry.overline,
272
+ geometry.overRightArrow,
273
+ geometry.overLeftRightArrow,
274
+ log.log
275
+ ],
276
+ [
277
+ basicOperators.multiply,
278
+ digits.decimalPoint,
279
+ { name: '', latex: '', write: '' },
280
+ subSup.subscript,
281
+ exponent.xToPowerOfN,
282
+ exponent.nthRoot,
283
+ geometry.perpindicular,
284
+ geometry.parallel,
285
+ geometry.overArc,
286
+ log.logSubscript
287
+ ],
288
+ [
289
+ misc.plusMinus,
290
+ constants.pi,
291
+ vars.theta,
292
+ operators.circleDot,
293
+ geometry.angle,
294
+ geometry.leftArrow,
295
+ geometry.rightArrow,
296
+ geometry.triangle,
297
+ geometry.square,
298
+ log.ln
299
+ ],
300
+ [
301
+ misc.notEqual,
302
+ misc.absValue,
303
+ statistics.smallSigma,
304
+ statistics.mu,
305
+ logic.therefore,
306
+ statistics.sigma,
307
+ geometry.leftrightArrow,
308
+ trigonometry.sin,
309
+ trigonometry.cos,
310
+ trigonometry.tan
311
+ ],
312
+ [
313
+ comparison.lessThanEqual,
314
+ comparison.greaterThanEqual,
315
+ { name: '', latex: '', write: '' },
316
+ { name: '', latex: '', write: '' },
317
+ constants.infinity,
318
+ { name: '', latex: '', write: '' },
319
+ { name: '', latex: '', write: '' },
320
+ trigonometry.csc,
321
+ trigonometry.sec,
322
+ trigonometry.cot
323
+ ]
324
+ ]
211
325
  }
212
326
  ];
213
327
 
package/src/keys/log.js CHANGED
@@ -12,7 +12,7 @@ export const logSubscript = set({
12
12
  name: 'Log with subscript',
13
13
  label: 'log s',
14
14
  latex: '\\log_{}',
15
- command: ['\\log', '_']
15
+ command: ['\\log', '_', ' ']
16
16
  });
17
17
  export const ln = set({
18
18
  name: 'Ln',
@@ -27,3 +27,10 @@ export const sigma = set({
27
27
  latex: '\\Sigma',
28
28
  write: '\\Sigma'
29
29
  });
30
+
31
+ export const smallSigma = set({
32
+ name: 'sigma',
33
+ label: '\\sigma',
34
+ latex: '\\sigma',
35
+ write: '\\sigma'
36
+ });