@khanacademy/perseus 7.0.0 → 7.0.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/CHANGELOG.md +11 -0
- package/dist/es/index.js +18 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/util.d.ts +3 -1
- package/dist/util.js.flow +3 -1
- package/package.json +3 -3
- package/src/mixins/provide-keypad.tsx +2 -2
- package/src/util.ts +19 -1
- package/src/widgets/__stories__/test-keypad-context-wrapper.tsx +2 -2
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -3683,6 +3683,21 @@ const supportsPassiveEvents = () => {
|
|
|
3683
3683
|
function captureScratchpadTouchStart$4(e) {
|
|
3684
3684
|
e.stopPropagation();
|
|
3685
3685
|
}
|
|
3686
|
+
async function getImageSizeModern(url) {
|
|
3687
|
+
const image = new Image();
|
|
3688
|
+
return new Promise((resolve, reject) => {
|
|
3689
|
+
// Handle the success case
|
|
3690
|
+
image.onload = () => {
|
|
3691
|
+
resolve([image.naturalWidth, image.naturalHeight]);
|
|
3692
|
+
};
|
|
3693
|
+
|
|
3694
|
+
// Handle the error case
|
|
3695
|
+
image.onerror = reject;
|
|
3696
|
+
|
|
3697
|
+
// Kick off the loading
|
|
3698
|
+
image.src = url;
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3686
3701
|
function getImageSize(url, callback) {
|
|
3687
3702
|
const img = new Image();
|
|
3688
3703
|
img.onload = function () {
|
|
@@ -3817,6 +3832,7 @@ const Util = {
|
|
|
3817
3832
|
supportsPassiveEvents,
|
|
3818
3833
|
captureScratchpadTouchStart: captureScratchpadTouchStart$4,
|
|
3819
3834
|
getImageSize,
|
|
3835
|
+
getImageSizeModern,
|
|
3820
3836
|
getRealImageUrl,
|
|
3821
3837
|
isLabeledSVG,
|
|
3822
3838
|
getBaseUrl,
|
|
@@ -44193,7 +44209,7 @@ const ProvideKeypad = {
|
|
|
44193
44209
|
_this._keypadContainer = document.createElement("div");
|
|
44194
44210
|
// @ts-expect-error [FEI-5003] - TS2339 - Property '_keypadContainer' does not exist on type '{ readonly propTypes: { readonly apiOptions: React.PropType<{ customKeypad?: boolean | undefined; nativeKeypadProxy?: ((...a: readonly any[]) => unknown) | undefined; }>; readonly keypadStyle: Requireable<any>; }; readonly getInitialState: () => { ...; }; readonly componentDidMount: () => void; readonly componentWil...'.
|
|
44195
44211
|
(_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.appendChild(_this._keypadContainer);
|
|
44196
|
-
render( /*#__PURE__*/React__namespace.createElement(mathInput.
|
|
44212
|
+
render( /*#__PURE__*/React__namespace.createElement(mathInput.MobileKeypad, {
|
|
44197
44213
|
onElementMounted: element => {
|
|
44198
44214
|
// NOTE(kevinb): The reason why this setState works is
|
|
44199
44215
|
// b/c we're calling it manually from item-renderer.jsx
|