@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/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.Keypad, {
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