@pie-lib/math-input 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/horizontal-keypad.d.ts +32 -0
- package/dist/horizontal-keypad.d.ts.map +1 -0
- package/dist/horizontal-keypad.js +57 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/keypad/accessible-keypad.d.ts +34 -0
- package/dist/keypad/accessible-keypad.d.ts.map +1 -0
- package/dist/keypad/accessible-keypad.js +614 -0
- package/dist/keypad/index.d.ts +3 -0
- package/dist/keypad/index.d.ts.map +1 -0
- package/dist/keypad/keys-layout.d.ts +16 -0
- package/dist/keypad/keys-layout.d.ts.map +1 -0
- package/dist/keypad/keys-layout.js +5 -0
- package/dist/keypad/model.d.ts +29 -0
- package/dist/keypad/model.d.ts.map +1 -0
- package/dist/keypad/model.js +4 -0
- package/dist/keys/basic-operators.d.ts +14 -0
- package/dist/keys/basic-operators.d.ts.map +1 -0
- package/dist/keys/basic-operators.js +30 -0
- package/dist/keys/chars.d.ts +14 -0
- package/dist/keys/chars.d.ts.map +1 -0
- package/dist/keys/comparison.d.ts +13 -0
- package/dist/keys/comparison.d.ts.map +1 -0
- package/dist/keys/comparison.js +32 -0
- package/dist/keys/constants.d.ts +13 -0
- package/dist/keys/constants.d.ts.map +1 -0
- package/dist/keys/constants.js +35 -0
- package/dist/keys/digits.d.ts +11 -0
- package/dist/keys/digits.d.ts.map +1 -0
- package/dist/keys/digits.js +34 -0
- package/dist/keys/edit.d.ts +15 -0
- package/dist/keys/edit.d.ts.map +1 -0
- package/dist/keys/edit.js +9 -0
- package/dist/keys/exponent.d.ts +13 -0
- package/dist/keys/exponent.d.ts.map +1 -0
- package/dist/keys/exponent.js +28 -0
- package/dist/keys/fractions.d.ts +12 -0
- package/dist/keys/fractions.d.ts.map +1 -0
- package/dist/keys/fractions.js +27 -0
- package/dist/keys/geometry.d.ts +32 -0
- package/dist/keys/geometry.d.ts.map +1 -0
- package/dist/keys/geometry.js +127 -0
- package/dist/keys/grades.d.ts +18 -0
- package/dist/keys/grades.d.ts.map +1 -0
- package/dist/keys/grades.js +414 -0
- package/dist/keys/index.d.ts +15 -0
- package/dist/keys/index.d.ts.map +1 -0
- package/dist/keys/index.js +50 -0
- package/dist/keys/log.d.ts +12 -0
- package/dist/keys/log.d.ts.map +1 -0
- package/dist/keys/log.js +25 -0
- package/dist/keys/logic.d.ts +11 -0
- package/dist/keys/logic.d.ts.map +1 -0
- package/dist/keys/logic.js +13 -0
- package/dist/keys/matrices.d.ts +11 -0
- package/dist/keys/matrices.d.ts.map +1 -0
- package/dist/keys/matrices.js +17 -0
- package/dist/keys/misc.d.ts +19 -0
- package/dist/keys/misc.d.ts.map +1 -0
- package/dist/keys/misc.js +60 -0
- package/dist/keys/navigation.d.ts +11 -0
- package/dist/keys/navigation.d.ts.map +1 -0
- package/dist/keys/navigation.js +13 -0
- package/dist/keys/operators.d.ts +10 -0
- package/dist/keys/operators.d.ts.map +1 -0
- package/dist/keys/operators.js +11 -0
- package/dist/keys/statistics.d.ts +14 -0
- package/dist/keys/statistics.d.ts.map +1 -0
- package/dist/keys/statistics.js +38 -0
- package/dist/keys/sub-sup.d.ts +11 -0
- package/dist/keys/sub-sup.d.ts.map +1 -0
- package/dist/keys/sub-sup.js +17 -0
- package/dist/keys/trigonometry.d.ts +15 -0
- package/dist/keys/trigonometry.d.ts.map +1 -0
- package/dist/keys/trigonometry.js +43 -0
- package/dist/keys/utils.d.ts +14 -0
- package/dist/keys/utils.d.ts.map +1 -0
- package/dist/keys/utils.js +24 -0
- package/dist/keys/vars.d.ts +12 -0
- package/dist/keys/vars.d.ts.map +1 -0
- package/dist/keys/vars.js +22 -0
- package/dist/math-input.d.ts +31 -0
- package/dist/math-input.d.ts.map +1 -0
- package/dist/mq/common-mq-styles.d.ts +226 -0
- package/dist/mq/common-mq-styles.d.ts.map +1 -0
- package/dist/mq/common-mq-styles.js +54 -0
- package/dist/mq/custom-elements.d.ts +11 -0
- package/dist/mq/custom-elements.d.ts.map +1 -0
- package/dist/mq/custom-elements.js +10 -0
- package/dist/mq/index.d.ts +13 -0
- package/dist/mq/index.d.ts.map +1 -0
- package/dist/mq/index.js +12 -0
- package/dist/mq/input.d.ts +36 -0
- package/dist/mq/input.d.ts.map +1 -0
- package/dist/mq/input.js +83 -0
- package/dist/mq/static.d.ts +44 -0
- package/dist/mq/static.d.ts.map +1 -0
- package/dist/mq/static.js +142 -0
- package/dist/updateSpans.d.ts +11 -0
- package/dist/updateSpans.d.ts.map +1 -0
- package/dist/updateSpans.js +9 -0
- package/package.json +38 -0
- package/src/horizontal-keypad.tsx +82 -0
- package/src/index.tsx +27 -0
- package/src/keypad/accessible-keypad.tsx +731 -0
- package/src/keypad/index.tsx +3 -0
- package/src/keypad/keys-layout.ts +26 -0
- package/src/keypad/model.ts +149 -0
- package/src/keys/basic-operators.ts +42 -0
- package/src/keys/chars.ts +15 -0
- package/src/keys/comparison.ts +38 -0
- package/src/keys/constants.ts +45 -0
- package/src/keys/digits.ts +50 -0
- package/src/keys/edit.ts +13 -0
- package/src/keys/exponent.ts +38 -0
- package/src/keys/fractions.ts +36 -0
- package/src/keys/geometry.ts +154 -0
- package/src/keys/grades.ts +377 -0
- package/src/keys/index.ts +30 -0
- package/src/keys/log.ts +32 -0
- package/src/keys/logic.ts +25 -0
- package/src/keys/matrices.ts +25 -0
- package/src/keys/misc.ts +75 -0
- package/src/keys/navigation.ts +18 -0
- package/src/keys/operators.ts +20 -0
- package/src/keys/statistics.ts +48 -0
- package/src/keys/sub-sup.ts +25 -0
- package/src/keys/trigonometry.ts +25 -0
- package/src/keys/utils.ts +76 -0
- package/src/keys/vars.ts +29 -0
- package/src/math-input.tsx +129 -0
- package/src/mq/common-mq-styles.ts +115 -0
- package/src/mq/custom-elements.tsx +21 -0
- package/src/mq/index.ts +15 -0
- package/src/mq/input.tsx +172 -0
- package/src/mq/static.tsx +279 -0
- package/src/updateSpans.ts +26 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __exportAll };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/math-input/src/horizontal-keypad.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export default class HorizontalKeypad extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
className: PropTypes.Requireable<string>;
|
|
14
|
+
controlledKeypadMode: PropTypes.Requireable<boolean>;
|
|
15
|
+
mode: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
16
|
+
layoutForKeyPad: PropTypes.Requireable<object>;
|
|
17
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
noDecimal: PropTypes.Requireable<boolean>;
|
|
20
|
+
additionalKeys: PropTypes.Requireable<any[]>;
|
|
21
|
+
setKeypadInteraction: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
onRequestClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
|
+
};
|
|
24
|
+
static defaultProps: {
|
|
25
|
+
mode: string;
|
|
26
|
+
noDecimal: boolean;
|
|
27
|
+
additionalKeys: never[];
|
|
28
|
+
};
|
|
29
|
+
keypadPress: any;
|
|
30
|
+
render(): JSX.Element;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=horizontal-keypad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"horizontal-keypad.d.ts","sourceRoot":"","sources":["../src/horizontal-keypad.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAenC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAS;IAC3D,MAAM,CAAC,SAAS;;;;;;;;;;;MAWd;IAEF,MAAM,CAAC,YAAY;;;;MAIjB;IAEF,WAAW,EAAE,GAAG,CAId;IAEF,MAAM;CA6BP"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { extendKeySet as e } from "./keys/utils.js";
|
|
2
|
+
import { keysForGrade as t, normalizeAdditionalKeys as n } from "./keys/grades.js";
|
|
3
|
+
import r from "./keypad/accessible-keypad.js";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import a from "prop-types";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/horizontal-keypad.tsx
|
|
8
|
+
var s = (e) => {
|
|
9
|
+
if (e.command) return {
|
|
10
|
+
value: e.command,
|
|
11
|
+
type: "command"
|
|
12
|
+
};
|
|
13
|
+
if (e.write) return { value: e.write };
|
|
14
|
+
if (e.keystroke) return {
|
|
15
|
+
type: "cursor",
|
|
16
|
+
value: e.keystroke
|
|
17
|
+
};
|
|
18
|
+
}, c = class extends i.Component {
|
|
19
|
+
static propTypes = {
|
|
20
|
+
className: a.string,
|
|
21
|
+
controlledKeypadMode: a.bool,
|
|
22
|
+
mode: a.oneOfType([a.string, a.number]),
|
|
23
|
+
layoutForKeyPad: a.object,
|
|
24
|
+
onClick: a.func.isRequired,
|
|
25
|
+
onFocus: a.func,
|
|
26
|
+
noDecimal: a.bool,
|
|
27
|
+
additionalKeys: a.array,
|
|
28
|
+
setKeypadInteraction: a.func,
|
|
29
|
+
onRequestClose: a.func
|
|
30
|
+
};
|
|
31
|
+
static defaultProps = {
|
|
32
|
+
mode: "scientific",
|
|
33
|
+
noDecimal: !1,
|
|
34
|
+
additionalKeys: []
|
|
35
|
+
};
|
|
36
|
+
keypadPress = (e) => {
|
|
37
|
+
let { onClick: t } = this.props;
|
|
38
|
+
t(s(e));
|
|
39
|
+
};
|
|
40
|
+
render() {
|
|
41
|
+
let { mode: i, onFocus: a, controlledKeypadMode: s, noDecimal: c, className: l, additionalKeys: u, layoutForKeyPad: d, setKeypadInteraction: f, onRequestClose: p } = this.props, m = n(u);
|
|
42
|
+
return /* @__PURE__ */ o(r, {
|
|
43
|
+
className: l,
|
|
44
|
+
controlledKeypadMode: s,
|
|
45
|
+
onFocus: a,
|
|
46
|
+
noDecimal: c,
|
|
47
|
+
layoutForKeyPad: d,
|
|
48
|
+
additionalKeys: e(t(i), m),
|
|
49
|
+
onPress: this.keypadPress,
|
|
50
|
+
mode: i,
|
|
51
|
+
setKeypadInteraction: f,
|
|
52
|
+
onRequestClose: p
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { c as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/math-input/src/index.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import { keysForGrade } from './keys/grades';
|
|
10
|
+
import { updateSpans } from './updateSpans';
|
|
11
|
+
import * as keys from './keys';
|
|
12
|
+
import HorizontalKeypad from './horizontal-keypad';
|
|
13
|
+
import * as mq from './mq';
|
|
14
|
+
declare const addBrackets: (s: any) => any;
|
|
15
|
+
declare const removeBrackets: (s: any) => any;
|
|
16
|
+
export { keysForGrade, addBrackets, removeBrackets, keys, HorizontalKeypad, mq, updateSpans };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAO3B,QAAA,MAAM,WAAW,GAAI,MAAC,QAAuC,CAAC;AAC9D,QAAA,MAAM,cAAc,GAAI,MAAC,QAAqC,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { keysForGrade as e } from "./keys/grades.js";
|
|
2
|
+
import { updateSpans as t } from "./updateSpans.js";
|
|
3
|
+
import { keys_exports as n } from "./keys/index.js";
|
|
4
|
+
import r from "./horizontal-keypad.js";
|
|
5
|
+
import { mq_exports as i } from "./mq/index.js";
|
|
6
|
+
//#region src/index.tsx
|
|
7
|
+
var a = (e) => e.indexOf("\\(") === 0 ? e : `\\(${e}`, o = (e) => e.indexOf("\\)") === e.length - 2 ? e : `${e}\\)`, s = (e) => e.indexOf("\\(") === 0 ? e.substring(2) : e, c = (e) => e.indexOf("\\)") === e.length - 2 ? e.substring(0, e.length - 2) : e, l = (e) => o(a(e)), u = (e) => c(s(e));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { r as HorizontalKeypad, l as addBrackets, n as keys, e as keysForGrade, i as mq, u as removeBrackets, t as updateSpans };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export default class AccessibleKeypad extends React.Component {
|
|
4
|
+
static propTypes: {
|
|
5
|
+
className: PropTypes.Requireable<string>;
|
|
6
|
+
controlledKeypadMode: PropTypes.Requireable<boolean>;
|
|
7
|
+
baseSet: PropTypes.Requireable<any[]>;
|
|
8
|
+
additionalKeys: PropTypes.Requireable<any[]>;
|
|
9
|
+
layoutForKeyPad: PropTypes.Requireable<object>;
|
|
10
|
+
onPress: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
noDecimal: PropTypes.Requireable<boolean>;
|
|
13
|
+
setKeypadInteraction: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
mode: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
15
|
+
onRequestClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
static defaultProps: {
|
|
18
|
+
baseSet: any[][];
|
|
19
|
+
noDecimal: boolean;
|
|
20
|
+
};
|
|
21
|
+
constructor(props: any);
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
handleKeypadInteraction: () => void;
|
|
25
|
+
keyIsNotAllowed: (key: any) => any;
|
|
26
|
+
flowKeys: (base: any, extras: any) => any;
|
|
27
|
+
toRenderModel: () => any;
|
|
28
|
+
pressKey: (definition: any) => void;
|
|
29
|
+
moveFocus: (nextIndex: any) => void;
|
|
30
|
+
onButtonKeyDown: (event: any, index: any) => void;
|
|
31
|
+
renderKey: (definition: any, index: any) => JSX.Element;
|
|
32
|
+
render(): JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=accessible-keypad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessible-keypad.d.ts","sourceRoot":"","sources":["../../src/keypad/accessible-keypad.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAkfnC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAS;IAC3D,MAAM,CAAC,SAAS;;;;;;;;;;;;MAYd;IAEF,MAAM,CAAC,YAAY;;;MAGjB;gBAEU,KAAK,KAAA;IAOjB,iBAAiB;IAmBjB,oBAAoB;IAcpB,uBAAuB,aAIrB;IAEF,eAAe,GAAI,QAAG,SAGpB;IAEF,QAAQ,GAAI,SAAI,EAAE,WAAM,SAGtB;IAEF,aAAa,YAuBX;IAEF,QAAQ,GAAI,eAAU,UAMpB;IAEF,SAAS,GAAI,cAAS,UAQpB;IAEF,eAAe,GAAI,UAAK,EAAE,UAAK,UAyB7B;IAEF,SAAS,GAAI,eAAU,EAAE,UAAK,iBAiD5B;IAEF,MAAM;CAiCP"}
|