@pie-lib/math-input 0.1.0 → 0.1.1-next.1
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/dist/horizontal-keypad.d.ts +1 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +12 -2
- package/dist/keypad/accessible-keypad.d.ts +8 -5
- package/dist/keypad/accessible-keypad.js +1 -1
- package/dist/keypad/index.d.ts +0 -1
- package/dist/keypad/keys-layout.d.ts +1 -2
- package/dist/keypad/keys-layout.js +1 -1
- package/dist/keypad/model.d.ts +0 -1
- package/dist/keys/basic-operators.d.ts +0 -1
- package/dist/keys/chars.d.ts +0 -1
- package/dist/keys/comparison.d.ts +0 -1
- package/dist/keys/constants.d.ts +0 -1
- package/dist/keys/digits.d.ts +14 -2
- package/dist/keys/digits.js +1 -1
- package/dist/keys/edit.d.ts +0 -1
- package/dist/keys/exponent.d.ts +0 -1
- package/dist/keys/fractions.d.ts +0 -1
- package/dist/keys/geometry.d.ts +0 -1
- package/dist/keys/grades.d.ts +0 -1
- package/dist/keys/index.d.ts +0 -1
- package/dist/keys/log.d.ts +0 -1
- package/dist/keys/logic.d.ts +0 -1
- package/dist/keys/matrices.d.ts +0 -1
- package/dist/keys/misc.d.ts +0 -1
- package/dist/keys/navigation.d.ts +0 -1
- package/dist/keys/operators.d.ts +0 -1
- package/dist/keys/statistics.d.ts +0 -1
- package/dist/keys/sub-sup.d.ts +0 -1
- package/dist/keys/trigonometry.d.ts +0 -1
- package/dist/keys/utils.d.ts +0 -1
- package/dist/keys/utils.js +1 -1
- package/dist/keys/vars.d.ts +0 -1
- package/dist/math-input.d.ts +1 -2
- package/dist/mq/common-mq-styles.d.ts +0 -1
- package/dist/mq/custom-elements.d.ts +0 -1
- package/dist/mq/index.d.ts +0 -1
- package/dist/mq/input.d.ts +1 -2
- package/dist/mq/input.js +15 -15
- package/dist/mq/static.d.ts +1 -2
- package/dist/mq/static.js +18 -18
- package/dist/updateSpans.d.ts +0 -1
- package/package.json +11 -5
- package/dist/horizontal-keypad.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/keypad/accessible-keypad.d.ts.map +0 -1
- package/dist/keypad/index.d.ts.map +0 -1
- package/dist/keypad/keys-layout.d.ts.map +0 -1
- package/dist/keypad/model.d.ts.map +0 -1
- package/dist/keys/basic-operators.d.ts.map +0 -1
- package/dist/keys/chars.d.ts.map +0 -1
- package/dist/keys/comparison.d.ts.map +0 -1
- package/dist/keys/constants.d.ts.map +0 -1
- package/dist/keys/digits.d.ts.map +0 -1
- package/dist/keys/edit.d.ts.map +0 -1
- package/dist/keys/exponent.d.ts.map +0 -1
- package/dist/keys/fractions.d.ts.map +0 -1
- package/dist/keys/geometry.d.ts.map +0 -1
- package/dist/keys/grades.d.ts.map +0 -1
- package/dist/keys/index.d.ts.map +0 -1
- package/dist/keys/log.d.ts.map +0 -1
- package/dist/keys/logic.d.ts.map +0 -1
- package/dist/keys/matrices.d.ts.map +0 -1
- package/dist/keys/misc.d.ts.map +0 -1
- package/dist/keys/navigation.d.ts.map +0 -1
- package/dist/keys/operators.d.ts.map +0 -1
- package/dist/keys/statistics.d.ts.map +0 -1
- package/dist/keys/sub-sup.d.ts.map +0 -1
- package/dist/keys/trigonometry.d.ts.map +0 -1
- package/dist/keys/utils.d.ts.map +0 -1
- package/dist/keys/vars.d.ts.map +0 -1
- package/dist/math-input.d.ts.map +0 -1
- package/dist/mq/common-mq-styles.d.ts.map +0 -1
- package/dist/mq/custom-elements.d.ts.map +0 -1
- package/dist/mq/index.d.ts.map +0 -1
- package/dist/mq/input.d.ts.map +0 -1
- package/dist/mq/static.d.ts.map +0 -1
- package/dist/updateSpans.d.ts.map +0 -1
- package/src/horizontal-keypad.tsx +0 -82
- package/src/index.tsx +0 -27
- package/src/keypad/accessible-keypad.tsx +0 -731
- package/src/keypad/index.tsx +0 -3
- package/src/keypad/keys-layout.ts +0 -26
- package/src/keypad/model.ts +0 -149
- package/src/keys/basic-operators.ts +0 -42
- package/src/keys/chars.ts +0 -15
- package/src/keys/comparison.ts +0 -38
- package/src/keys/constants.ts +0 -45
- package/src/keys/digits.ts +0 -50
- package/src/keys/edit.ts +0 -13
- package/src/keys/exponent.ts +0 -38
- package/src/keys/fractions.ts +0 -36
- package/src/keys/geometry.ts +0 -154
- package/src/keys/grades.ts +0 -377
- package/src/keys/index.ts +0 -30
- package/src/keys/log.ts +0 -32
- package/src/keys/logic.ts +0 -25
- package/src/keys/matrices.ts +0 -25
- package/src/keys/misc.ts +0 -75
- package/src/keys/navigation.ts +0 -18
- package/src/keys/operators.ts +0 -20
- package/src/keys/statistics.ts +0 -48
- package/src/keys/sub-sup.ts +0 -25
- package/src/keys/trigonometry.ts +0 -25
- package/src/keys/utils.ts +0 -76
- package/src/keys/vars.ts +0 -29
- package/src/math-input.tsx +0 -129
- package/src/mq/common-mq-styles.ts +0 -115
- package/src/mq/custom-elements.tsx +0 -21
- package/src/mq/index.ts +0 -15
- package/src/mq/input.tsx +0 -172
- package/src/mq/static.tsx +0 -279
- package/src/updateSpans.ts +0 -26
package/src/keypad/index.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keypad/keys-layout.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { times, zip } from 'lodash-es';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Sort additional keys.
|
|
15
|
-
*
|
|
16
|
-
* Expects an array of rows.
|
|
17
|
-
* @param {} keys
|
|
18
|
-
*/
|
|
19
|
-
export const sortKeys = (keys) => {
|
|
20
|
-
// add any missing rows
|
|
21
|
-
times(5 - keys.length, () => keys.push([]));
|
|
22
|
-
|
|
23
|
-
const out = zip.apply(null, keys);
|
|
24
|
-
|
|
25
|
-
return out;
|
|
26
|
-
};
|
package/src/keypad/model.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export type KeypadLane = 'numbers' | 'operators' | 'templates';
|
|
2
|
-
|
|
3
|
-
export type KeyVisualType =
|
|
4
|
-
| 'text'
|
|
5
|
-
| 'icon'
|
|
6
|
-
| 'symbolText'
|
|
7
|
-
| 'fractionTemplate'
|
|
8
|
-
| 'mixedFractionTemplate'
|
|
9
|
-
| 'longdivTemplate'
|
|
10
|
-
| 'squaredTemplate'
|
|
11
|
-
| 'supTemplate'
|
|
12
|
-
| 'subTemplate'
|
|
13
|
-
| 'sqrtTemplate'
|
|
14
|
-
| 'nthRootTemplate'
|
|
15
|
-
| 'parenTemplate'
|
|
16
|
-
| 'bracketTemplate'
|
|
17
|
-
| 'absTemplate'
|
|
18
|
-
| 'logSubTemplate'
|
|
19
|
-
| 'overlineTemplate'
|
|
20
|
-
| 'overArrowTemplate'
|
|
21
|
-
| 'overBiArrowTemplate'
|
|
22
|
-
| 'overArcTemplate';
|
|
23
|
-
|
|
24
|
-
export interface LegacyKey {
|
|
25
|
-
name?: string;
|
|
26
|
-
label?: string;
|
|
27
|
-
latex?: string;
|
|
28
|
-
write?: string;
|
|
29
|
-
command?: string | string[];
|
|
30
|
-
keystroke?: string;
|
|
31
|
-
icon?: any;
|
|
32
|
-
category?: string;
|
|
33
|
-
ariaLabel?: string;
|
|
34
|
-
actions?: Record<string, unknown>;
|
|
35
|
-
extraProps?: Record<string, unknown>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface KeyDefinition {
|
|
39
|
-
id: string;
|
|
40
|
-
lane: KeypadLane;
|
|
41
|
-
visualType: KeyVisualType;
|
|
42
|
-
ariaLabel: string;
|
|
43
|
-
key: LegacyKey;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const OPERATOR_NAMES = new Set(['divide', 'multiply', 'minus', 'plus', 'equals']);
|
|
47
|
-
const TEMPLATE_LATEX = new Map<string, KeyVisualType>([
|
|
48
|
-
['\\frac{}{}', 'fractionTemplate'],
|
|
49
|
-
['\\frac{x}{ }', 'fractionTemplate'],
|
|
50
|
-
['x\\frac{}{}', 'mixedFractionTemplate'],
|
|
51
|
-
['\\longdiv{}', 'longdivTemplate'],
|
|
52
|
-
['x^2', 'squaredTemplate'],
|
|
53
|
-
['x^{}', 'supTemplate'],
|
|
54
|
-
['x_{}', 'subTemplate'],
|
|
55
|
-
['\\sqrt{}', 'sqrtTemplate'],
|
|
56
|
-
['\\sqrt[{}]{}', 'nthRootTemplate'],
|
|
57
|
-
['\\left(\\right)', 'parenTemplate'],
|
|
58
|
-
['\\left[\\right]', 'bracketTemplate'],
|
|
59
|
-
['\\abs{}', 'absTemplate'],
|
|
60
|
-
['\\log_{}', 'logSubTemplate'],
|
|
61
|
-
['\\overline{}', 'overlineTemplate'],
|
|
62
|
-
['\\overline{x}', 'overlineTemplate'],
|
|
63
|
-
['\\overline{y}', 'overlineTemplate'],
|
|
64
|
-
['\\overrightarrow{}', 'overArrowTemplate'],
|
|
65
|
-
['\\overleftrightarrow{\\overline{}}', 'overBiArrowTemplate'],
|
|
66
|
-
['\\overleftrightarrow{AB}', 'overBiArrowTemplate'],
|
|
67
|
-
['\\overarc{\\overline{}}', 'overArcTemplate'],
|
|
68
|
-
]);
|
|
69
|
-
|
|
70
|
-
export const toColumnMajor = (rows: LegacyKey[][]): LegacyKey[] => {
|
|
71
|
-
const padded = [...rows.map((r) => [...r])];
|
|
72
|
-
while (padded.length < 5) {
|
|
73
|
-
padded.push([]);
|
|
74
|
-
}
|
|
75
|
-
const out: LegacyKey[] = [];
|
|
76
|
-
const maxCols = Math.max(...padded.map((row) => row.length), 0);
|
|
77
|
-
for (let col = 0; col < maxCols; col++) {
|
|
78
|
-
for (let row = 0; row < padded.length; row++) {
|
|
79
|
-
const value = padded[row][col];
|
|
80
|
-
if (value) {
|
|
81
|
-
out.push(value);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return out;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const isOperator = (key: LegacyKey): boolean =>
|
|
89
|
-
key.category === 'operators' || (key.name ? OPERATOR_NAMES.has(String(key.name).toLowerCase()) : false);
|
|
90
|
-
|
|
91
|
-
const getLane = (key: LegacyKey): KeypadLane => {
|
|
92
|
-
if (isOperator(key)) {
|
|
93
|
-
return 'operators';
|
|
94
|
-
}
|
|
95
|
-
if (key.latex || key.command || key.category === 'comparison') {
|
|
96
|
-
return 'templates';
|
|
97
|
-
}
|
|
98
|
-
return 'numbers';
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const getVisualType = (key: LegacyKey): KeyVisualType => {
|
|
102
|
-
if (key.latex && TEMPLATE_LATEX.has(key.latex)) {
|
|
103
|
-
return TEMPLATE_LATEX.get(key.latex) as KeyVisualType;
|
|
104
|
-
}
|
|
105
|
-
if (key.icon) {
|
|
106
|
-
return 'icon';
|
|
107
|
-
}
|
|
108
|
-
if (key.latex) {
|
|
109
|
-
return 'symbolText';
|
|
110
|
-
}
|
|
111
|
-
return 'text';
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const getAriaLabel = (key: LegacyKey): string => {
|
|
115
|
-
return key.ariaLabel || key.name || key.label || key.latex || 'keypad action';
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const toDefinition = (key: LegacyKey, index: number): KeyDefinition => ({
|
|
119
|
-
id: `${key.label || key.latex || key.name || key.command || 'key'}-${index}`,
|
|
120
|
-
lane: getLane(key),
|
|
121
|
-
visualType: getVisualType(key),
|
|
122
|
-
ariaLabel: getAriaLabel(key),
|
|
123
|
-
key,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
export const buildKeyDefinitions = (orderedKeys: LegacyKey[]): KeyDefinition[] => {
|
|
127
|
-
return orderedKeys.map((k, idx) => toDefinition(k, idx)).filter((k) => Boolean(k.key && k.ariaLabel));
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const laneDefinitions = (definitions: KeyDefinition[]): Record<KeypadLane, KeyDefinition[]> => {
|
|
131
|
-
return definitions.reduce(
|
|
132
|
-
(acc, definition) => {
|
|
133
|
-
acc[definition.lane].push(definition);
|
|
134
|
-
return acc;
|
|
135
|
-
},
|
|
136
|
-
{ numbers: [], operators: [], templates: [] } as Record<KeypadLane, KeyDefinition[]>,
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const toLaneGrid = (items: KeyDefinition[], rowCount = 5): (KeyDefinition | null)[][] => {
|
|
141
|
-
const cols = Math.max(1, Math.ceil(items.length / rowCount));
|
|
142
|
-
const grid: (KeyDefinition | null)[][] = Array.from({ length: rowCount }, () => Array.from({ length: cols }, () => null));
|
|
143
|
-
items.forEach((item, idx) => {
|
|
144
|
-
const row = idx % rowCount;
|
|
145
|
-
const col = Math.floor(idx / rowCount);
|
|
146
|
-
grid[row][col] = item;
|
|
147
|
-
});
|
|
148
|
-
return grid;
|
|
149
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/basic-operators.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { DIVIDE, MULTIPLY } from './chars';
|
|
12
|
-
import { mkSet } from './utils';
|
|
13
|
-
|
|
14
|
-
const set = mkSet('operators');
|
|
15
|
-
|
|
16
|
-
export const equals = set({
|
|
17
|
-
write: '=',
|
|
18
|
-
label: '=',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const plus = set({
|
|
22
|
-
write: '+',
|
|
23
|
-
label: '+',
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const minus = set({
|
|
27
|
-
write: '−',
|
|
28
|
-
label: '−',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const divide = set({
|
|
32
|
-
name: 'divide',
|
|
33
|
-
label: DIVIDE,
|
|
34
|
-
command: '\\divide',
|
|
35
|
-
otherNotation: '\\div',
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const multiply = set({
|
|
39
|
-
name: 'multiply',
|
|
40
|
-
label: MULTIPLY,
|
|
41
|
-
command: '\\times',
|
|
42
|
-
});
|
package/src/keys/chars.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/chars.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export const DELETE = '\u232B';
|
|
12
|
-
export const LEFT_ARROW = '◀';
|
|
13
|
-
export const RIGHT_ARROW = '▶';
|
|
14
|
-
export const DIVIDE = '\u00F7';
|
|
15
|
-
export const MULTIPLY = '\u00D7';
|
package/src/keys/comparison.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/comparison.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const set = (o) => ({ ...o, category: 'comparison' });
|
|
12
|
-
|
|
13
|
-
export const lessThan = set({
|
|
14
|
-
name: 'Less than',
|
|
15
|
-
latex: '<',
|
|
16
|
-
command: '\\lt',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const greaterThan = set({
|
|
20
|
-
name: 'Greater than',
|
|
21
|
-
latex: '>',
|
|
22
|
-
command: '\\gt',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const lessThanEqual = set({
|
|
26
|
-
name: 'Less than or equal',
|
|
27
|
-
latex: '\\le',
|
|
28
|
-
symbol: '<=',
|
|
29
|
-
command: '\\le',
|
|
30
|
-
ariaLabel: 'less than or equal to',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const greaterThanEqual = set({
|
|
34
|
-
name: 'Greater than or equal',
|
|
35
|
-
symbol: '>=',
|
|
36
|
-
command: '\\ge',
|
|
37
|
-
latex: '\\ge',
|
|
38
|
-
});
|
package/src/keys/constants.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/constants.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { mkSet } from './utils';
|
|
12
|
-
|
|
13
|
-
const set = mkSet('constants');
|
|
14
|
-
|
|
15
|
-
export const pi = set({
|
|
16
|
-
name: 'Pi',
|
|
17
|
-
label: 'π',
|
|
18
|
-
latex: '\\pi',
|
|
19
|
-
command: '\\pi',
|
|
20
|
-
category: 'constants',
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const eulers = set({
|
|
24
|
-
name: 'Eulers',
|
|
25
|
-
label: 'e',
|
|
26
|
-
latex: 'e',
|
|
27
|
-
command: 'e',
|
|
28
|
-
category: 'constants',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const infinity = set({
|
|
32
|
-
name: 'Infinity',
|
|
33
|
-
label: '\\infty',
|
|
34
|
-
latex: '\\infty',
|
|
35
|
-
command: '\\infty',
|
|
36
|
-
category: 'constants',
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const halfInfinity = set({
|
|
40
|
-
name: 'Half Infinity',
|
|
41
|
-
label: '\\propto',
|
|
42
|
-
latex: '\\propto',
|
|
43
|
-
command: '\\propto',
|
|
44
|
-
category: 'constants',
|
|
45
|
-
});
|
package/src/keys/digits.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/digits.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { times } from 'lodash-es';
|
|
12
|
-
|
|
13
|
-
const digitMap = {
|
|
14
|
-
0: 'zero',
|
|
15
|
-
1: 'one',
|
|
16
|
-
2: 'two',
|
|
17
|
-
3: 'three',
|
|
18
|
-
4: 'four',
|
|
19
|
-
5: 'five',
|
|
20
|
-
6: 'six',
|
|
21
|
-
7: 'seven',
|
|
22
|
-
8: 'eight',
|
|
23
|
-
9: 'nine',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const comma = { name: 'comma', label: ',', write: ',', category: 'digit' };
|
|
27
|
-
|
|
28
|
-
const decimalPoint = {
|
|
29
|
-
name: 'decimal-point',
|
|
30
|
-
label: '.',
|
|
31
|
-
write: '.',
|
|
32
|
-
category: 'digit',
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default times(10, String)
|
|
36
|
-
.map((n) => {
|
|
37
|
-
return {
|
|
38
|
-
name: digitMap[n],
|
|
39
|
-
write: n,
|
|
40
|
-
label: n,
|
|
41
|
-
category: 'digit',
|
|
42
|
-
};
|
|
43
|
-
})
|
|
44
|
-
.reduce(
|
|
45
|
-
(acc, o) => {
|
|
46
|
-
acc[o.name] = o;
|
|
47
|
-
return acc;
|
|
48
|
-
},
|
|
49
|
-
{ comma, decimalPoint },
|
|
50
|
-
);
|
package/src/keys/edit.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/edit.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { DELETE } from './chars';
|
|
12
|
-
|
|
13
|
-
export const del = { label: DELETE, category: 'edit', keystroke: 'Backspace', ariaLabel: 'Delete' };
|
package/src/keys/exponent.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/exponent.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { mkSet } from './utils';
|
|
12
|
-
|
|
13
|
-
const set = mkSet('exponent');
|
|
14
|
-
|
|
15
|
-
export const squared = set({
|
|
16
|
-
name: 'Squared',
|
|
17
|
-
latex: 'x^2',
|
|
18
|
-
write: '^2',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const xToPowerOfN = set({
|
|
22
|
-
name: 'X to the power of n',
|
|
23
|
-
latex: 'x^{}',
|
|
24
|
-
command: '^',
|
|
25
|
-
ariaLabel: 'exponent',
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export const squareRoot = set({
|
|
29
|
-
name: 'Square root',
|
|
30
|
-
latex: '\\sqrt{}',
|
|
31
|
-
command: '\\sqrt',
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const nthRoot = set({
|
|
35
|
-
name: 'Nth root',
|
|
36
|
-
latex: '\\sqrt[{}]{}',
|
|
37
|
-
command: '\\nthroot',
|
|
38
|
-
});
|
package/src/keys/fractions.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/fractions.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { mkSet } from './utils';
|
|
12
|
-
|
|
13
|
-
const set = mkSet('fractions');
|
|
14
|
-
|
|
15
|
-
export const blankOverBlank = set({
|
|
16
|
-
name: 'blank/blank',
|
|
17
|
-
latex: '\\frac{}{}',
|
|
18
|
-
command: '\\frac',
|
|
19
|
-
ariaLabel: 'fraction',
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const xOverBlank = set({
|
|
23
|
-
latex: '\\frac{x}{ }',
|
|
24
|
-
name: 'X/blank',
|
|
25
|
-
label: 'x/[]',
|
|
26
|
-
command: '/',
|
|
27
|
-
ariaLabel: 'x over blank fraction',
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export const xBlankBlank = set({
|
|
31
|
-
name: 'X (blank/blank)',
|
|
32
|
-
latex: 'x\\frac{}{}',
|
|
33
|
-
label: 'x([]/[])',
|
|
34
|
-
command: '\\frac',
|
|
35
|
-
ariaLabel: 'mixed number',
|
|
36
|
-
});
|
package/src/keys/geometry.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @synced-from pie-lib/packages/math-input/src/keys/geometry.js
|
|
4
|
-
* @auto-generated
|
|
5
|
-
*
|
|
6
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
7
|
-
* Manual edits will be overwritten on next sync.
|
|
8
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const set = (o) => ({ ...o, category: 'geometry' });
|
|
12
|
-
|
|
13
|
-
export const overline = set({
|
|
14
|
-
name: 'Line',
|
|
15
|
-
latex: '\\overline{}',
|
|
16
|
-
command: '\\overline',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const overRightArrow = set({
|
|
20
|
-
name: 'Ray',
|
|
21
|
-
latex: '\\overrightarrow{}',
|
|
22
|
-
command: '\\overrightarrow',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const overLeftRightArrow = set({
|
|
26
|
-
name: 'Segment',
|
|
27
|
-
latex: '\\overleftrightarrow{\\overline{}}', // used this notation to display the pink box
|
|
28
|
-
symbol: 'AB',
|
|
29
|
-
command: '\\overleftrightarrow',
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const segment = set({
|
|
33
|
-
name: 'Segment',
|
|
34
|
-
latex: '\\overleftrightarrow{AB}',
|
|
35
|
-
write: '\\overleftrightarrow{AB}',
|
|
36
|
-
label: 'AB',
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const parallel = set({
|
|
40
|
-
name: 'Parallel',
|
|
41
|
-
latex: '\\parallel',
|
|
42
|
-
command: '\\parallel',
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export const notParallel = set({
|
|
46
|
-
name: 'Not Parallel',
|
|
47
|
-
latex: '\\nparallel',
|
|
48
|
-
command: '\\nparallel',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const perpindicular = set({
|
|
52
|
-
name: 'Perpendicular',
|
|
53
|
-
latex: '\\perp',
|
|
54
|
-
command: '\\perpendicular',
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export const angle = set({
|
|
58
|
-
name: 'Angle',
|
|
59
|
-
latex: '\\angle',
|
|
60
|
-
command: '\\angle',
|
|
61
|
-
});
|
|
62
|
-
export const overArc = set({
|
|
63
|
-
name: 'Over arc',
|
|
64
|
-
latex: '\\overarc{\\overline{}}', // used this notation to display the pink box
|
|
65
|
-
command: '\\overarc',
|
|
66
|
-
});
|
|
67
|
-
export const measureOfAngle = set({
|
|
68
|
-
name: 'Measured Angle',
|
|
69
|
-
latex: '\\measuredangle',
|
|
70
|
-
command: ['m', '\\angle'],
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export const triangle = set({
|
|
74
|
-
name: 'Triangle',
|
|
75
|
-
latex: '\\triangle',
|
|
76
|
-
command: '\\triangle',
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export const square = set({
|
|
80
|
-
name: 'Square',
|
|
81
|
-
latex: '\\square',
|
|
82
|
-
command: '\\square',
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
export const parallelogram = set({
|
|
86
|
-
name: 'Parallelogram',
|
|
87
|
-
latex: '\\parallelogram',
|
|
88
|
-
command: '\\parallelogram',
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export const circledDot = set({
|
|
92
|
-
name: 'Circled Dot',
|
|
93
|
-
latex: '\\odot',
|
|
94
|
-
command: '\\odot',
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export const degree = set({
|
|
98
|
-
name: 'Degree',
|
|
99
|
-
latex: '\\degree',
|
|
100
|
-
command: '\\degree',
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
export const similarTo = set({
|
|
104
|
-
name: 'Similar',
|
|
105
|
-
command: '\\sim',
|
|
106
|
-
latex: '\\sim',
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
export const congruentTo = set({
|
|
110
|
-
name: 'Congruent To',
|
|
111
|
-
command: '\\cong',
|
|
112
|
-
latex: '\\cong',
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export const notCongruentTo = set({
|
|
116
|
-
name: 'Not Congruent To',
|
|
117
|
-
command: '\\ncong',
|
|
118
|
-
latex: '\\ncong',
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const primeArcminute = set({
|
|
122
|
-
name: 'Prime',
|
|
123
|
-
label: 'pam',
|
|
124
|
-
// eslint-disable-next-line
|
|
125
|
-
latex: "'",
|
|
126
|
-
// eslint-disable-next-line
|
|
127
|
-
write: "'",
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
export const doublePrimeArcSecond = set({
|
|
131
|
-
name: 'Double Prime',
|
|
132
|
-
// eslint-disable-next-line
|
|
133
|
-
latex: "''",
|
|
134
|
-
// eslint-disable-next-line
|
|
135
|
-
write: "''",
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
export const leftArrow = set({
|
|
139
|
-
name: 'Left Arrow',
|
|
140
|
-
latex: '\\leftarrow',
|
|
141
|
-
command: '\\leftarrow',
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export const rightArrow = set({
|
|
145
|
-
name: 'Right Arrow',
|
|
146
|
-
latex: '\\rightarrow',
|
|
147
|
-
command: '\\rightarrow',
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
export const leftrightArrow = set({
|
|
151
|
-
name: 'Left and Right Arrow',
|
|
152
|
-
latex: '\\leftrightarrow',
|
|
153
|
-
command: '\\leftrightarrow',
|
|
154
|
-
});
|