@khanacademy/math-input 17.0.4 → 17.0.6
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/components/input/math-wrapper.d.ts +2 -2
- package/dist/components/input/mathquill-types.d.ts +49 -6
- package/dist/es/index.js +8 -6
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/.eslintrc.js +0 -18
- package/CHANGELOG.md +0 -660
- package/less/main.less +0 -2
- package/less/overrides.less +0 -122
- package/src/components/__tests__/integration.test.tsx +0 -300
- package/src/components/aphrodite-css-transition-group/index.tsx +0 -78
- package/src/components/aphrodite-css-transition-group/transition-child.tsx +0 -192
- package/src/components/aphrodite-css-transition-group/types.ts +0 -20
- package/src/components/aphrodite-css-transition-group/util.ts +0 -97
- package/src/components/input/__tests__/context-tracking.test.ts +0 -176
- package/src/components/input/__tests__/mathquill-helpers.test.ts +0 -105
- package/src/components/input/__tests__/mathquill.test.ts +0 -747
- package/src/components/input/__tests__/test-math-wrapper.ts +0 -29
- package/src/components/input/cursor-contexts.ts +0 -37
- package/src/components/input/cursor-handle.tsx +0 -137
- package/src/components/input/cursor-styles.ts +0 -10
- package/src/components/input/drag-listener.ts +0 -79
- package/src/components/input/math-input.tsx +0 -1036
- package/src/components/input/math-wrapper.ts +0 -189
- package/src/components/input/mathquill-helpers.ts +0 -262
- package/src/components/input/mathquill-instance.ts +0 -106
- package/src/components/input/mathquill-types.ts +0 -32
- package/src/components/input/scroll-into-view.ts +0 -65
- package/src/components/key-handlers/__tests__/handle-jump-out.test.ts +0 -94
- package/src/components/key-handlers/handle-arrow.ts +0 -70
- package/src/components/key-handlers/handle-backspace.ts +0 -277
- package/src/components/key-handlers/handle-exponent.ts +0 -53
- package/src/components/key-handlers/handle-jump-out.ts +0 -107
- package/src/components/key-handlers/key-translator.ts +0 -222
- package/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap +0 -1913
- package/src/components/keypad/__tests__/__snapshots__/mobile-keypad.test.tsx.snap +0 -600
- package/src/components/keypad/__tests__/keypad-button.test.tsx +0 -84
- package/src/components/keypad/__tests__/keypad-v2-mathquill.test.tsx +0 -304
- package/src/components/keypad/__tests__/keypad-v2.cypress.ts +0 -16
- package/src/components/keypad/__tests__/keypad.test.tsx +0 -321
- package/src/components/keypad/__tests__/mobile-keypad.test.tsx +0 -115
- package/src/components/keypad/__tests__/test-data-tabs.ts +0 -21
- package/src/components/keypad/button-assets.tsx +0 -1880
- package/src/components/keypad/index.tsx +0 -2
- package/src/components/keypad/keypad-button.stories.tsx +0 -81
- package/src/components/keypad/keypad-button.tsx +0 -124
- package/src/components/keypad/keypad-mathquill.stories.tsx +0 -109
- package/src/components/keypad/keypad-pages/extras-page.tsx +0 -35
- package/src/components/keypad/keypad-pages/fractions-page.tsx +0 -125
- package/src/components/keypad/keypad-pages/geometry-page.tsx +0 -34
- package/src/components/keypad/keypad-pages/keypad-pages.stories.tsx +0 -37
- package/src/components/keypad/keypad-pages/numbers-page.tsx +0 -94
- package/src/components/keypad/keypad-pages/operators-page.tsx +0 -117
- package/src/components/keypad/keypad.tsx +0 -233
- package/src/components/keypad/mobile-keypad-internals.tsx +0 -240
- package/src/components/keypad/mobile-keypad.tsx +0 -24
- package/src/components/keypad/navigation-button.tsx +0 -127
- package/src/components/keypad/navigation-pad.stories.tsx +0 -26
- package/src/components/keypad/navigation-pad.tsx +0 -67
- package/src/components/keypad/shared-keys.tsx +0 -109
- package/src/components/keypad/utils.ts +0 -34
- package/src/components/keypad-context.tsx +0 -70
- package/src/components/prop-types.ts +0 -16
- package/src/components/tabbar/__tests__/tabbar.test.tsx +0 -105
- package/src/components/tabbar/icons.tsx +0 -122
- package/src/components/tabbar/index.ts +0 -1
- package/src/components/tabbar/item.tsx +0 -146
- package/src/components/tabbar/tabbar.stories.tsx +0 -83
- package/src/components/tabbar/tabbar.tsx +0 -65
- package/src/data/key-configs.ts +0 -770
- package/src/data/keys.ts +0 -123
- package/src/enums.ts +0 -27
- package/src/fake-react-native-web/index.ts +0 -11
- package/src/fake-react-native-web/text.tsx +0 -55
- package/src/fake-react-native-web/view.tsx +0 -91
- package/src/full-keypad.stories.tsx +0 -142
- package/src/full-mobile-input.stories.tsx +0 -115
- package/src/index.ts +0 -52
- package/src/types.ts +0 -70
- package/src/utils.test.ts +0 -33
- package/src/utils.ts +0 -61
- package/src/version.ts +0 -10
- package/tsconfig-build.json +0 -11
- package/tsconfig-build.tsbuildinfo +0 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,6 @@ var wonderStuffCore = require('@khanacademy/wonder-stuff-core');
|
|
|
9
9
|
var aphrodite = require('aphrodite');
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var ReactDOM = require('react-dom');
|
|
12
|
-
var $ = require('jquery');
|
|
13
12
|
var MathQuill = require('mathquill');
|
|
14
13
|
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
15
14
|
var Clickable = require('@khanacademy/wonder-blocks-clickable');
|
|
@@ -41,14 +40,13 @@ var Color__default = /*#__PURE__*/_interopDefaultLegacy(Color);
|
|
|
41
40
|
var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n);
|
|
42
41
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
43
42
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
44
|
-
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
|
45
43
|
var MathQuill__default = /*#__PURE__*/_interopDefaultLegacy(MathQuill);
|
|
46
44
|
var Clickable__default = /*#__PURE__*/_interopDefaultLegacy(Clickable);
|
|
47
45
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
48
46
|
|
|
49
47
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
50
48
|
const libName = "@khanacademy/math-input";
|
|
51
|
-
const libVersion = "17.0.
|
|
49
|
+
const libVersion = "17.0.6";
|
|
52
50
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
53
51
|
|
|
54
52
|
function _extends() {
|
|
@@ -440,9 +438,12 @@ let MathFieldActionType = /*#__PURE__*/function (MathFieldActionType) {
|
|
|
440
438
|
}({});
|
|
441
439
|
|
|
442
440
|
/**
|
|
443
|
-
* The MathQuill
|
|
444
|
-
*
|
|
445
|
-
*
|
|
441
|
+
* The MathQuill API (see mathuill.d.ts) does not include types
|
|
442
|
+
* for cursor() and controller(), and adding these types there
|
|
443
|
+
* in the MathQuill repo causes unexpected conflicts with other types.
|
|
444
|
+
*
|
|
445
|
+
* We don't want to use the cursor and controller default type `any`
|
|
446
|
+
* so we declare the types here.
|
|
446
447
|
*/
|
|
447
448
|
|
|
448
449
|
const Numerals = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
@@ -1358,7 +1359,7 @@ class MathWrapper {
|
|
|
1358
1359
|
const controller = this.mathField.controller();
|
|
1359
1360
|
const pageX = x - document.body.scrollLeft;
|
|
1360
1361
|
const pageY = y - document.body.scrollTop;
|
|
1361
|
-
controller.seek(
|
|
1362
|
+
controller.seek(el, pageX, pageY).cursor.startSelection();
|
|
1362
1363
|
|
|
1363
1364
|
// Unless that would leave us mid-command, in which case, we
|
|
1364
1365
|
// need to adjust and place the cursor inside the parens
|