@pie-lib/math-input 8.1.1-next.1 → 8.1.1-next.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.
Files changed (185) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/horizontal-keypad.d.ts +31 -0
  3. package/dist/horizontal-keypad.js +57 -0
  4. package/dist/index.d.ts +18 -0
  5. package/dist/index.js +19 -0
  6. package/dist/keypad/accessible-keypad.d.ts +37 -0
  7. package/dist/keypad/accessible-keypad.js +614 -0
  8. package/dist/keypad/index.d.ts +2 -0
  9. package/dist/keypad/keys-layout.d.ts +15 -0
  10. package/dist/keypad/keys-layout.js +5 -0
  11. package/dist/keypad/model.d.ts +28 -0
  12. package/dist/keypad/model.js +4 -0
  13. package/dist/keys/basic-operators.d.ts +13 -0
  14. package/dist/keys/basic-operators.js +30 -0
  15. package/dist/keys/chars.d.ts +13 -0
  16. package/dist/keys/comparison.d.ts +12 -0
  17. package/dist/keys/comparison.js +32 -0
  18. package/dist/keys/constants.d.ts +12 -0
  19. package/dist/keys/constants.js +35 -0
  20. package/dist/keys/digits.d.ts +23 -0
  21. package/dist/keys/digits.js +34 -0
  22. package/dist/keys/edit.d.ts +14 -0
  23. package/dist/keys/edit.js +9 -0
  24. package/dist/keys/exponent.d.ts +12 -0
  25. package/dist/keys/exponent.js +28 -0
  26. package/dist/keys/fractions.d.ts +11 -0
  27. package/dist/keys/fractions.js +27 -0
  28. package/dist/keys/geometry.d.ts +31 -0
  29. package/dist/keys/geometry.js +127 -0
  30. package/dist/keys/grades.d.ts +17 -0
  31. package/dist/keys/grades.js +414 -0
  32. package/dist/keys/index.d.ts +14 -0
  33. package/dist/keys/index.js +50 -0
  34. package/dist/keys/log.d.ts +11 -0
  35. package/dist/keys/log.js +25 -0
  36. package/dist/keys/logic.d.ts +10 -0
  37. package/dist/keys/logic.js +13 -0
  38. package/dist/keys/matrices.d.ts +10 -0
  39. package/dist/keys/matrices.js +17 -0
  40. package/dist/keys/misc.d.ts +18 -0
  41. package/dist/keys/misc.js +60 -0
  42. package/dist/keys/navigation.d.ts +10 -0
  43. package/dist/keys/navigation.js +13 -0
  44. package/dist/keys/operators.d.ts +9 -0
  45. package/dist/keys/operators.js +11 -0
  46. package/dist/keys/statistics.d.ts +13 -0
  47. package/dist/keys/statistics.js +38 -0
  48. package/dist/keys/sub-sup.d.ts +10 -0
  49. package/dist/keys/sub-sup.js +17 -0
  50. package/dist/keys/trigonometry.d.ts +14 -0
  51. package/dist/keys/trigonometry.js +43 -0
  52. package/dist/keys/utils.d.ts +13 -0
  53. package/dist/keys/utils.js +24 -0
  54. package/dist/keys/vars.d.ts +11 -0
  55. package/dist/keys/vars.js +22 -0
  56. package/dist/math-input.d.ts +30 -0
  57. package/dist/mq/common-mq-styles.d.ts +225 -0
  58. package/dist/mq/common-mq-styles.js +54 -0
  59. package/dist/mq/custom-elements.d.ts +10 -0
  60. package/dist/mq/custom-elements.js +10 -0
  61. package/dist/mq/index.d.ts +12 -0
  62. package/dist/mq/index.js +12 -0
  63. package/dist/mq/input.d.ts +35 -0
  64. package/dist/mq/input.js +83 -0
  65. package/dist/mq/static.d.ts +43 -0
  66. package/dist/mq/static.js +142 -0
  67. package/dist/updateSpans.d.ts +10 -0
  68. package/dist/updateSpans.js +9 -0
  69. package/package.json +32 -17
  70. package/CHANGELOG.json +0 -17
  71. package/CHANGELOG.md +0 -1172
  72. package/LICENSE.md +0 -5
  73. package/lib/horizontal-keypad.js +0 -96
  74. package/lib/horizontal-keypad.js.map +0 -1
  75. package/lib/index.js +0 -69
  76. package/lib/index.js.map +0 -1
  77. package/lib/keypad/index.js +0 -413
  78. package/lib/keypad/index.js.map +0 -1
  79. package/lib/keypad/keys-layout.js +0 -22
  80. package/lib/keypad/keys-layout.js.map +0 -1
  81. package/lib/keys/basic-operators.js +0 -33
  82. package/lib/keys/basic-operators.js.map +0 -1
  83. package/lib/keys/chars.js +0 -12
  84. package/lib/keys/chars.js.map +0 -1
  85. package/lib/keys/comparison.js +0 -39
  86. package/lib/keys/comparison.js.map +0 -1
  87. package/lib/keys/constants.js +0 -37
  88. package/lib/keys/constants.js.map +0 -1
  89. package/lib/keys/digits.js +0 -46
  90. package/lib/keys/digits.js.map +0 -1
  91. package/lib/keys/edit.js +0 -14
  92. package/lib/keys/edit.js.map +0 -1
  93. package/lib/keys/exponent.js +0 -30
  94. package/lib/keys/exponent.js.map +0 -1
  95. package/lib/keys/fractions.js +0 -29
  96. package/lib/keys/fractions.js.map +0 -1
  97. package/lib/keys/geometry.js +0 -140
  98. package/lib/keys/geometry.js.map +0 -1
  99. package/lib/keys/grades.js +0 -259
  100. package/lib/keys/grades.js.map +0 -1
  101. package/lib/keys/index.js +0 -35
  102. package/lib/keys/index.js.map +0 -1
  103. package/lib/keys/log.js +0 -27
  104. package/lib/keys/log.js.map +0 -1
  105. package/lib/keys/logic.js +0 -19
  106. package/lib/keys/logic.js.map +0 -1
  107. package/lib/keys/matrices.js +0 -19
  108. package/lib/keys/matrices.js.map +0 -1
  109. package/lib/keys/misc.js +0 -62
  110. package/lib/keys/misc.js.map +0 -1
  111. package/lib/keys/navigation.js +0 -20
  112. package/lib/keys/navigation.js.map +0 -1
  113. package/lib/keys/operators.js +0 -15
  114. package/lib/keys/operators.js.map +0 -1
  115. package/lib/keys/statistics.js +0 -40
  116. package/lib/keys/statistics.js.map +0 -1
  117. package/lib/keys/sub-sup.js +0 -19
  118. package/lib/keys/sub-sup.js.map +0 -1
  119. package/lib/keys/trigonometry.js +0 -45
  120. package/lib/keys/trigonometry.js.map +0 -1
  121. package/lib/keys/utils.js +0 -87
  122. package/lib/keys/utils.js.map +0 -1
  123. package/lib/keys/vars.js +0 -24
  124. package/lib/keys/vars.js.map +0 -1
  125. package/lib/math-input.js +0 -141
  126. package/lib/math-input.js.map +0 -1
  127. package/lib/mq/common-mq-styles.js +0 -102
  128. package/lib/mq/common-mq-styles.js.map +0 -1
  129. package/lib/mq/custom-elements.js +0 -20
  130. package/lib/mq/custom-elements.js.map +0 -1
  131. package/lib/mq/index.js +0 -28
  132. package/lib/mq/index.js.map +0 -1
  133. package/lib/mq/input.js +0 -186
  134. package/lib/mq/input.js.map +0 -1
  135. package/lib/mq/mathquill-instance.js +0 -52
  136. package/lib/mq/mathquill-instance.js.map +0 -1
  137. package/lib/mq/static.js +0 -301
  138. package/lib/mq/static.js.map +0 -1
  139. package/lib/updateSpans.js +0 -19
  140. package/lib/updateSpans.js.map +0 -1
  141. package/src/__tests__/horizontal-keypad.test.jsx +0 -463
  142. package/src/__tests__/index.test.js +0 -247
  143. package/src/__tests__/math-input-test.jsx +0 -45
  144. package/src/__tests__/updateSpans.test.js +0 -297
  145. package/src/horizontal-keypad.jsx +0 -69
  146. package/src/index.jsx +0 -28
  147. package/src/keypad/__tests__/index.test.jsx +0 -25
  148. package/src/keypad/__tests__/keys-layout.test.js +0 -14
  149. package/src/keypad/index.jsx +0 -439
  150. package/src/keypad/keys-layout.js +0 -16
  151. package/src/keys/__tests__/utils.test.js +0 -57
  152. package/src/keys/basic-operators.js +0 -32
  153. package/src/keys/chars.js +0 -5
  154. package/src/keys/comparison.js +0 -28
  155. package/src/keys/constants.js +0 -35
  156. package/src/keys/digits.js +0 -40
  157. package/src/keys/edit.js +0 -3
  158. package/src/keys/exponent.js +0 -28
  159. package/src/keys/fractions.js +0 -26
  160. package/src/keys/geometry.js +0 -144
  161. package/src/keys/grades.js +0 -367
  162. package/src/keys/index.js +0 -20
  163. package/src/keys/log.js +0 -22
  164. package/src/keys/logic.js +0 -15
  165. package/src/keys/matrices.js +0 -15
  166. package/src/keys/misc.js +0 -65
  167. package/src/keys/navigation.js +0 -8
  168. package/src/keys/operators.js +0 -10
  169. package/src/keys/statistics.js +0 -38
  170. package/src/keys/sub-sup.js +0 -15
  171. package/src/keys/trigonometry.js +0 -15
  172. package/src/keys/utils.js +0 -66
  173. package/src/keys/vars.js +0 -19
  174. package/src/math-input.jsx +0 -119
  175. package/src/mq/__tests__/custom-elements.test.js +0 -342
  176. package/src/mq/__tests__/input.test.jsx +0 -40
  177. package/src/mq/__tests__/mathquill-instance.test.js +0 -67
  178. package/src/mq/__tests__/static.test.jsx +0 -33
  179. package/src/mq/common-mq-styles.js +0 -109
  180. package/src/mq/custom-elements.js +0 -11
  181. package/src/mq/index.js +0 -5
  182. package/src/mq/input.jsx +0 -166
  183. package/src/mq/mathquill-instance.js +0 -45
  184. package/src/mq/static.jsx +0 -290
  185. package/src/updateSpans.js +0 -15
@@ -1,28 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('exponent');
4
-
5
- export const squared = set({
6
- name: 'Squared',
7
- latex: 'x^2',
8
- write: '^2',
9
- });
10
-
11
- export const xToPowerOfN = set({
12
- name: 'X to the power of n',
13
- latex: 'x^{}',
14
- command: '^',
15
- ariaLabel: 'exponent',
16
- });
17
-
18
- export const squareRoot = set({
19
- name: 'Square root',
20
- latex: '\\sqrt{}',
21
- command: '\\sqrt',
22
- });
23
-
24
- export const nthRoot = set({
25
- name: 'Nth root',
26
- latex: '\\sqrt[{}]{}',
27
- command: '\\nthroot',
28
- });
@@ -1,26 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('fractions');
4
-
5
- export const blankOverBlank = set({
6
- name: 'blank/blank',
7
- latex: '\\frac{}{}',
8
- command: '\\frac',
9
- ariaLabel: 'fraction',
10
- });
11
-
12
- export const xOverBlank = set({
13
- latex: '\\frac{x}{ }',
14
- name: 'X/blank',
15
- label: 'x/[]',
16
- command: '/',
17
- ariaLabel: 'x over blank fraction',
18
- });
19
-
20
- export const xBlankBlank = set({
21
- name: 'X (blank/blank)',
22
- latex: 'x\\frac{}{}',
23
- label: 'x([]/[])',
24
- command: '\\frac',
25
- ariaLabel: 'mixed number',
26
- });
@@ -1,144 +0,0 @@
1
- const set = (o) => ({ ...o, category: 'geometry' });
2
-
3
- export const overline = set({
4
- name: 'Line',
5
- latex: '\\overline{}',
6
- command: '\\overline',
7
- });
8
-
9
- export const overRightArrow = set({
10
- name: 'Ray',
11
- latex: '\\overrightarrow{}',
12
- command: '\\overrightarrow',
13
- });
14
-
15
- export const overLeftRightArrow = set({
16
- name: 'Segment',
17
- latex: '\\overleftrightarrow{\\overline{}}', // used this notation to display the pink box
18
- symbol: 'AB',
19
- command: '\\overleftrightarrow',
20
- });
21
-
22
- export const segment = set({
23
- name: 'Segment',
24
- latex: '\\overleftrightarrow{AB}',
25
- write: '\\overleftrightarrow{AB}',
26
- label: 'AB',
27
- });
28
-
29
- export const parallel = set({
30
- name: 'Parallel',
31
- latex: '\\parallel',
32
- command: '\\parallel',
33
- });
34
-
35
- export const notParallel = set({
36
- name: 'Not Parallel',
37
- latex: '\\nparallel',
38
- command: '\\nparallel',
39
- });
40
-
41
- export const perpindicular = set({
42
- name: 'Perpendicular',
43
- latex: '\\perp',
44
- command: '\\perpendicular',
45
- });
46
-
47
- export const angle = set({
48
- name: 'Angle',
49
- latex: '\\angle',
50
- command: '\\angle',
51
- });
52
- export const overArc = set({
53
- name: 'Over arc',
54
- latex: '\\overarc{\\overline{}}', // used this notation to display the pink box
55
- command: '\\overarc',
56
- });
57
- export const measureOfAngle = set({
58
- name: 'Measured Angle',
59
- latex: '\\measuredangle',
60
- command: ['m', '\\angle'],
61
- });
62
-
63
- export const triangle = set({
64
- name: 'Triangle',
65
- latex: '\\triangle',
66
- command: '\\triangle',
67
- });
68
-
69
- export const square = set({
70
- name: 'Square',
71
- latex: '\\square',
72
- command: '\\square',
73
- });
74
-
75
- export const parallelogram = set({
76
- name: 'Parallelogram',
77
- latex: '\\parallelogram',
78
- command: '\\parallelogram',
79
- });
80
-
81
- export const circledDot = set({
82
- name: 'Circled Dot',
83
- latex: '\\odot',
84
- command: '\\odot',
85
- });
86
-
87
- export const degree = set({
88
- name: 'Degree',
89
- latex: '\\degree',
90
- command: '\\degree',
91
- });
92
-
93
- export const similarTo = set({
94
- name: 'Similar',
95
- command: '\\sim',
96
- latex: '\\sim',
97
- });
98
-
99
- export const congruentTo = set({
100
- name: 'Congruent To',
101
- command: '\\cong',
102
- latex: '\\cong',
103
- });
104
-
105
- export const notCongruentTo = set({
106
- name: 'Not Congruent To',
107
- command: '\\ncong',
108
- latex: '\\ncong',
109
- });
110
-
111
- export const primeArcminute = set({
112
- name: 'Prime',
113
- label: 'pam',
114
- // eslint-disable-next-line
115
- latex: "'",
116
- // eslint-disable-next-line
117
- write: "'",
118
- });
119
-
120
- export const doublePrimeArcSecond = set({
121
- name: 'Double Prime',
122
- // eslint-disable-next-line
123
- latex: "''",
124
- // eslint-disable-next-line
125
- write: "''",
126
- });
127
-
128
- export const leftArrow = set({
129
- name: 'Left Arrow',
130
- latex: '\\leftarrow',
131
- command: '\\leftarrow',
132
- });
133
-
134
- export const rightArrow = set({
135
- name: 'Right Arrow',
136
- latex: '\\rightarrow',
137
- command: '\\rightarrow',
138
- });
139
-
140
- export const leftrightArrow = set({
141
- name: 'Left and Right Arrow',
142
- latex: '\\leftrightarrow',
143
- command: '\\leftrightarrow',
144
- });
@@ -1,367 +0,0 @@
1
- import * as comparison from './comparison';
2
- import * as vars from './vars';
3
- import * as fractions from './fractions';
4
- import * as exponent from './exponent';
5
- import * as misc from './misc';
6
- import * as constants from './constants';
7
- import * as trigonometry from './trigonometry';
8
- import * as geometry from './geometry';
9
- import * as operators from './operators';
10
- import * as log from './log';
11
- import * as subSup from './sub-sup';
12
- import * as statistics from './statistics';
13
- import * as basicOperators from './basic-operators';
14
- import * as matrices from './matrices';
15
- import digits from './digits';
16
- import * as logic from './logic';
17
- import * as nav from './navigation';
18
- import * as edit from './edit';
19
-
20
- const hs = [
21
- [fractions.blankOverBlank, misc.percentage, vars.x, exponent.squared, exponent.squareRoot],
22
- [operators.circleDot, vars.y, subSup.subscript, exponent.xToPowerOfN, exponent.nthRoot],
23
- [misc.plusMinus, comparison.lessThan, comparison.greaterThan, comparison.lessThanEqual, comparison.greaterThanEqual],
24
- [constants.pi, vars.theta, misc.parenthesis, misc.brackets, misc.absValue],
25
- [misc.notEqual, trigonometry.sin, trigonometry.cos, trigonometry.tan, geometry.degree],
26
- ];
27
-
28
- const advancedAlgebra = (() => {
29
- const out = [...hs.map((arr) => [...arr])];
30
-
31
- out[0].push({ name: 'i', latex: 'i', write: 'i' });
32
- out[1].push(log.log);
33
- out[2].push(log.logSubscript);
34
- out[3].push(log.ln);
35
- out[4].push(constants.eulers);
36
- return out;
37
- })();
38
-
39
- const statisticsSet = (() => {
40
- const out = [...hs.map((arr) => [...arr])];
41
- out[0].push(statistics.mu);
42
- out[1].push(statistics.xBar);
43
- out[2].push(statistics.yBar);
44
- out[3].push(statistics.sigma);
45
- out[4].push(statistics.smallSigma);
46
- return out;
47
- })();
48
-
49
- export const gradeSets = [
50
- {
51
- predicate: (n) => n >= 3 && n <= 5,
52
- set: [
53
- [comparison.lessThan, comparison.greaterThan],
54
- [fractions.xOverBlank, fractions.xBlankBlank],
55
- [vars.x, logic.longDivision],
56
- [exponent.squared, exponent.xToPowerOfN],
57
- ],
58
- },
59
- {
60
- predicate: (n) => n >= 6 && n <= 7,
61
- set: [
62
- [geometry.degree, comparison.lessThan, comparison.greaterThan],
63
- [operators.circleDot, comparison.lessThanEqual, comparison.greaterThanEqual],
64
- [vars.x, vars.y, exponent.squared, exponent.xToPowerOfN],
65
- [misc.plusMinus, fractions.xOverBlank, fractions.xBlankBlank, exponent.squareRoot],
66
- [constants.pi, misc.parenthesis, misc.absValue, exponent.nthRoot],
67
- ],
68
- },
69
- {
70
- predicate: (n) => n >= 8 || n === 'HS',
71
- set: hs,
72
- },
73
- {
74
- predicate: 'non-negative-integers',
75
- set: [
76
- [digits.seven, digits.eight, digits.nine],
77
- [digits.four, digits.five, digits.six],
78
- [digits.one, digits.two, digits.three],
79
- [digits.zero, { name: '', latex: '', write: '' }, { name: '', latex: '', write: '' }],
80
- [nav.left, nav.right, edit.del],
81
- ],
82
- },
83
- {
84
- predicate: 'integers',
85
- set: [
86
- [digits.seven, digits.eight, digits.nine],
87
- [digits.four, digits.five, digits.six],
88
- [digits.one, digits.two, digits.three],
89
- [digits.zero, { name: '', latex: '', write: '' }, basicOperators.minus],
90
- [nav.left, nav.right, edit.del],
91
- ],
92
- },
93
- {
94
- predicate: 'decimals',
95
- set: [
96
- [digits.seven, digits.eight, digits.nine],
97
- [digits.four, digits.five, digits.six],
98
- [digits.one, digits.two, digits.three],
99
- [digits.zero, digits.decimalPoint, basicOperators.minus],
100
- [nav.left, nav.right, edit.del],
101
- ],
102
- },
103
- {
104
- predicate: 'fractions',
105
- set: [
106
- [digits.seven, digits.eight, digits.nine],
107
- [digits.four, digits.five, digits.six],
108
- [digits.one, digits.two, digits.three],
109
- [digits.zero, fractions.blankOverBlank, basicOperators.minus],
110
- [nav.left, nav.right, edit.del],
111
- ],
112
- },
113
- {
114
- predicate: 'geometry',
115
- set: [
116
- [
117
- fractions.blankOverBlank,
118
- geometry.degree,
119
- geometry.primeArcminute,
120
- geometry.doublePrimeArcSecond,
121
- geometry.congruentTo,
122
- geometry.similarTo,
123
- ],
124
- [
125
- operators.circleDot,
126
- geometry.angle,
127
- geometry.measureOfAngle,
128
- geometry.triangle,
129
- geometry.notCongruentTo,
130
- misc.notSimilar,
131
- ],
132
- [trigonometry.sin, trigonometry.cos, trigonometry.tan, constants.pi, exponent.squareRoot, exponent.nthRoot],
133
- [trigonometry.csc, trigonometry.sec, trigonometry.cot, vars.theta, subSup.subscript, exponent.xToPowerOfN],
134
- [
135
- geometry.overline,
136
- geometry.overRightArrow,
137
- geometry.overLeftRightArrow,
138
- geometry.overArc,
139
- geometry.perpindicular,
140
- geometry.parallel,
141
- ],
142
- ],
143
- },
144
- // {
145
- // predicate: 'miscellaneous',
146
- // set: [
147
- // [
148
- // subSup.superscript,
149
- // subSup.subscript,
150
- // fractions.blankOverBlank,
151
- // misc.percentage,
152
- // geometry.segment,
153
- // geometry.parallel
154
- // ],
155
- // [
156
- // exponent.squareRoot,
157
- // exponent.nthRoot,
158
- // misc.absValue,
159
- // misc.parenthesis,
160
- // geometry.perpindicular,
161
- // geometry.angle
162
- // ],
163
- // [
164
- // comparison.lessThan,
165
- // comparison.greaterThan,
166
- // geometry.degree,
167
- // misc.approx,
168
- // geometry.measureOfAngle,
169
- // geometry.triangle
170
- // ],
171
- // [
172
- // misc.nApprox,
173
- // misc.notEqual,
174
- // geometry.congruentTo,
175
- // geometry.notCongruentTo,
176
- // geometry.parallelogram,
177
- // geometry.circledDot
178
- // ],
179
- // [
180
- // misc.similar,
181
- // misc.notSimilar,
182
- // comparison.lessThanEqual,
183
- // comparison.greaterThanEqual,
184
- // vars.x,
185
- // vars.y
186
- // ]
187
- // ]
188
- // },
189
- // {
190
- // predicate: 'everything',
191
- // set: [
192
- // [
193
- // subSup.superscript,
194
- // subSup.subscript,
195
- // fractions.blankOverBlank,
196
- // misc.percentage,
197
- // geometry.segment,
198
- // geometry.parallel
199
- // ],
200
- // [
201
- // exponent.squareRoot,
202
- // exponent.nthRoot,
203
- // misc.absValue,
204
- // misc.parenthesis,
205
- // geometry.perpindicular,
206
- // geometry.angle
207
- // ],
208
- // [
209
- // comparison.lessThan,
210
- // comparison.greaterThan,
211
- // geometry.degree,
212
- // misc.approx,
213
- // geometry.measureOfAngle,
214
- // geometry.triangle
215
- // ],
216
- // [
217
- // misc.nApprox,
218
- // misc.notEqual,
219
- // geometry.congruentTo,
220
- // geometry.notCongruentTo,
221
- // geometry.parallelogram,
222
- // geometry.circledDot
223
- // ],
224
- // [
225
- // misc.similar,
226
- // misc.notSimilar,
227
- // comparison.lessThanEqual,
228
- // comparison.greaterThanEqual,
229
- // vars.x,
230
- // vars.y
231
- // ]
232
- // ]
233
- // },
234
- {
235
- predicate: 'advanced-algebra',
236
- set: advancedAlgebra,
237
- },
238
- {
239
- predicate: 'statistics',
240
- set: statisticsSet,
241
- },
242
- {
243
- predicate: 'item-authoring',
244
- set: [
245
- [
246
- basicOperators.divide,
247
- fractions.blankOverBlank,
248
- logic.longDivision,
249
- constants.halfInfinity,
250
- exponent.squared,
251
- exponent.squareRoot,
252
- geometry.overline,
253
- geometry.overRightArrow,
254
- geometry.overLeftRightArrow,
255
- log.log,
256
- ],
257
- [
258
- basicOperators.multiply,
259
- operators.circleDot,
260
- { name: '', latex: '', write: '' },
261
- subSup.subscript,
262
- exponent.xToPowerOfN,
263
- exponent.nthRoot,
264
- geometry.perpindicular,
265
- geometry.parallel,
266
- geometry.overArc,
267
- log.logSubscript,
268
- ],
269
- [
270
- misc.plusMinus,
271
- constants.pi,
272
- vars.theta,
273
- geometry.degree,
274
- geometry.angle,
275
- geometry.leftArrow,
276
- geometry.rightArrow,
277
- geometry.triangle,
278
- geometry.square,
279
- log.ln,
280
- ],
281
- [
282
- misc.notEqual,
283
- misc.absValue,
284
- statistics.smallSigma,
285
- statistics.mu,
286
- logic.therefore,
287
- statistics.sigma,
288
- geometry.leftrightArrow,
289
- trigonometry.sin,
290
- trigonometry.cos,
291
- trigonometry.tan,
292
- ],
293
- [
294
- comparison.lessThanEqual,
295
- comparison.greaterThanEqual,
296
- { name: '', latex: '', write: '' },
297
- { name: '', latex: '', write: '' },
298
- constants.infinity,
299
- { name: '', latex: '', write: '' },
300
- { name: '', latex: '', write: '' },
301
- trigonometry.csc,
302
- trigonometry.sec,
303
- trigonometry.cot,
304
- ],
305
- ],
306
- },
307
- // for grade 1-2, we want to display the base set only
308
- // we need it here because we don't want to display the default set (grade 8)
309
- {
310
- predicate: (n) => n >= 1 && n <= 2,
311
- set: [],
312
- },
313
- ];
314
-
315
- export const keysForGrade = (n) => {
316
- const number = parseInt(n, 10);
317
- n = isNaN(number) ? n : number;
318
- if (!n) {
319
- return [];
320
- }
321
-
322
- const match = gradeSets.find((gs) => {
323
- if (typeof gs.predicate === 'string') {
324
- return gs.predicate === n;
325
- } else {
326
- return gs.predicate(n);
327
- }
328
- });
329
-
330
- if (match) {
331
- return match.set || [];
332
- }
333
-
334
- // if the grade is not found, return the default set which is grade 8 (as per PD-3549), for mode language it is not the default
335
- if (n !== 'language') {
336
- return gradeSets[2].set;
337
- }
338
- };
339
-
340
- const ALL_KEYS = [
341
- ...Object.values(basicOperators),
342
- ...Object.values(comparison),
343
- ...Object.values(constants),
344
- ...Object.values(digits),
345
- ...Object.values(exponent),
346
- ...Object.values(fractions),
347
- ...Object.values(geometry),
348
- ...Object.values(log),
349
- ...Object.values(matrices),
350
- ...Object.values(misc),
351
- ...Object.values(operators),
352
- ...Object.values(statistics),
353
- ...Object.values(subSup),
354
- ...Object.values(trigonometry),
355
- ...Object.values(vars),
356
- ];
357
-
358
- export const normalizeAdditionalKeys = (additionalKeys) => {
359
- return (additionalKeys || []).map((additionalkey) => {
360
- const { latex } = additionalkey;
361
- const predefinedKey = (ALL_KEYS || []).find(
362
- (key) => latex === key.latex || latex === key.write || latex === key.command || latex === key.otherNotation,
363
- );
364
-
365
- return !latex ? additionalkey : predefinedKey || additionalkey;
366
- });
367
- };
package/src/keys/index.js DELETED
@@ -1,20 +0,0 @@
1
- import digits from './digits';
2
- import * as nav from './navigation';
3
- import * as edit from './edit';
4
- import { divide, equals, minus, multiply, plus } from './basic-operators';
5
- import * as comparison from './comparison';
6
- import * as fractions from './fractions';
7
- import * as exponent from './exponent';
8
- import * as misc from './misc';
9
-
10
- const { one, two, three, four, five, six, seven, eight, nine, zero, comma, decimalPoint } = digits;
11
-
12
- export const baseSet = [
13
- [seven, eight, nine, divide],
14
- [four, five, six, multiply],
15
- [one, two, three, minus],
16
- [zero, decimalPoint, comma, plus],
17
- [nav.left, nav.right, edit.del, equals],
18
- ];
19
-
20
- export { comparison, fractions, exponent, misc };
package/src/keys/log.js DELETED
@@ -1,22 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('log');
4
-
5
- export const log = set({
6
- name: 'Log',
7
- label: 'log',
8
- command: '\\log',
9
- latex: '\\log',
10
- });
11
- export const logSubscript = set({
12
- name: 'log base n',
13
- label: 'log s',
14
- latex: '\\log_{}',
15
- command: ['\\log', '_'],
16
- });
17
- export const ln = set({
18
- name: 'natural log',
19
- label: 'ln',
20
- command: '\\ln',
21
- latex: '\\ln',
22
- });
package/src/keys/logic.js DELETED
@@ -1,15 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('logic');
4
-
5
- export const therefore = set({
6
- name: 'Therefore',
7
- label: '∴',
8
- write: '∴',
9
- });
10
-
11
- export const longDivision = set({
12
- name: 'Long division',
13
- latex: '\\longdiv{}',
14
- command: '\\longdiv',
15
- });
@@ -1,15 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('matrices');
4
-
5
- export const singleCellMatrix = set({
6
- name: 'Single Cell Matrix',
7
- label: '[ ]',
8
- write: '\\begin{pmatrix}\\end{pmatrix}',
9
- });
10
-
11
- export const doubleCellMatrix = set({
12
- name: 'Double Cell Matrix',
13
- label: '[ ] [ ] \\\\newline [ ] [ ]',
14
- write: '\\begin{bmatrix}&\\\\&\\end{bmatrix}',
15
- });
package/src/keys/misc.js DELETED
@@ -1,65 +0,0 @@
1
- import { mkSet } from './utils';
2
-
3
- const set = mkSet('misc');
4
-
5
- export const plusMinus = set({
6
- name: 'Plus or Minus',
7
- latex: '\\pm',
8
- write: '\\pm',
9
- });
10
-
11
- export const absValue = set({
12
- name: 'Absolute Value',
13
- latex: '\\abs{}',
14
- symbol: '| |',
15
- command: '|',
16
- });
17
-
18
- export const parenthesis = set({
19
- name: 'Parenthesis',
20
- latex: '\\left(\\right)',
21
- symbol: '( )',
22
- command: '(',
23
- });
24
-
25
- export const brackets = set({
26
- name: 'Brackets',
27
- latex: '\\left[\\right]',
28
- symbol: '[ ]',
29
- command: '[',
30
- });
31
-
32
- export const percentage = set({
33
- name: 'Percent',
34
- latex: '%',
35
- command: '%',
36
- });
37
-
38
- export const approx = set({
39
- latex: '\\approx',
40
- command: '\\approx',
41
- ariaLabel: 'Approximately equal to',
42
- });
43
-
44
- export const nApprox = set({
45
- latex: '\\napprox',
46
- command: '\\napprox',
47
- ariaLabel: 'Not pproximately equal to',
48
- });
49
-
50
- export const notEqual = set({
51
- latex: '\\neq',
52
- command: '\\neq',
53
- ariaLabel: 'Not equals',
54
- });
55
-
56
- export const similar = set({
57
- latex: '\\sim',
58
- command: '\\sim',
59
- ariaLabel: 'Similar',
60
- });
61
- export const notSimilar = set({
62
- latex: '\\nsim',
63
- command: '\\nsim',
64
- ariaLabel: 'Not similar',
65
- });