@khanacademy/math-input 26.2.7 → 26.2.9

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
@@ -42,7 +42,7 @@ var ReactDOM__default = /*#__PURE__*/_interopDefaultCompat(ReactDOM);
42
42
  var Clickable__default = /*#__PURE__*/_interopDefaultCompat(Clickable);
43
43
  var PropTypes__default = /*#__PURE__*/_interopDefaultCompat(PropTypes);
44
44
 
45
- const libName="@khanacademy/math-input";const libVersion="26.2.7";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
45
+ const libName="@khanacademy/math-input";const libVersion="26.2.9";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
46
46
 
47
47
  function getDefaultExportFromCjs (x) {
48
48
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -1453,7 +1453,7 @@ const ArithmeticOperators=["+","-","\\cdot","\\times","\\div"];const EqualityOpe
1453
1453
 
1454
1454
  const KeysForJumpContext={[CursorContext.IN_PARENS]:"JUMP_OUT_PARENTHESES",[CursorContext.IN_SUPER_SCRIPT]:"JUMP_OUT_EXPONENT",[CursorContext.IN_SUB_SCRIPT]:"JUMP_OUT_BASE",[CursorContext.BEFORE_FRACTION]:"JUMP_INTO_NUMERATOR",[CursorContext.IN_NUMERATOR]:"JUMP_OUT_NUMERATOR",[CursorContext.IN_DENOMINATOR]:"JUMP_OUT_DENOMINATOR"};function handleJumpOut(mathField,key){const cursor=mathField.cursor();const context=getCursorContext(mathField);if(KeysForJumpContext[context]!==key){return}switch(context){case CursorContext.IN_PARENS:cursor.insRightOf(cursor.parent.parent);mathField.keystroke("Right");break;case CursorContext.BEFORE_FRACTION:let fractionNode;let visitor=cursor;while(visitor[mathQuillInstance.R]!==MathFieldActionType.MQ_END){if(isFraction(visitor[mathQuillInstance.R])){fractionNode=visitor[mathQuillInstance.R];}visitor=visitor[mathQuillInstance.R];}cursor.insLeftOf(fractionNode);mathField.keystroke("Right");break;case CursorContext.IN_NUMERATOR:const siblingDenominator=cursor.parent.parent.blocks[1];while(cursor.parent!==siblingDenominator){mathField.keystroke("Right");}break;case CursorContext.IN_DENOMINATOR:cursor.insRightOf(cursor.parent.parent);break;case CursorContext.IN_SUB_SCRIPT:cursor.insRightOf(cursor.parent.parent);if(isParens(cursor[mathQuillInstance.R])){mathField.keystroke("Right");}break;case CursorContext.IN_SUPER_SCRIPT:cursor.insRightOf(cursor.parent.parent);break;default:throw new Error(`Attempted to 'Jump Out' from node, but found no `+`appropriate cursor context: ${context}`)}}
1455
1455
 
1456
- function buildGenericCallback(str,type=MathFieldActionType.WRITE){return function(mathQuill){switch(type){case MathFieldActionType.WRITE:{mathQuill.write(str);return}case MathFieldActionType.CMD:{mathQuill.cmd(str);return}case MathFieldActionType.KEYSTROKE:{mathQuill.keystroke(str);return}}}}function buildTranslatableFunctionCallback(command,supportedTranslations,defaultCommand){const cmd=supportedTranslations.includes(command)?command:defaultCommand;return function(mathField){mathField.write(`${cmd}\\left(\\right)`);mathField.keystroke("Left");}}function buildNormalFunctionCallback(command){return function(mathField){mathField.write(`\\${command}\\left(\\right)`);mathField.keystroke("Left");}}const getKeyTranslator=(locale,strings)=>({EXP:handleExponent,EXP_2:handleExponent,EXP_3:handleExponent,JUMP_OUT_PARENTHESES:handleJumpOut,JUMP_OUT_EXPONENT:handleJumpOut,JUMP_OUT_BASE:handleJumpOut,JUMP_INTO_NUMERATOR:handleJumpOut,JUMP_OUT_NUMERATOR:handleJumpOut,JUMP_OUT_DENOMINATOR:handleJumpOut,LEFT:handleArrow,RIGHT:handleArrow,LOG:buildNormalFunctionCallback("log"),LN:buildNormalFunctionCallback("ln"),COS:buildNormalFunctionCallback(strings.cos),SIN:buildTranslatableFunctionCallback(strings.sin,["sin","sen"],"sin"),TAN:buildTranslatableFunctionCallback(strings.tan,["tan","tg"],"tan"),CDOT:buildGenericCallback("\\cdot"),DECIMAL:buildGenericCallback(perseusCore.getDecimalSeparator(locale)),DIVIDE:buildGenericCallback("\\div"),EQUAL:buildGenericCallback("="),GEQ:buildGenericCallback("\\geq"),GT:buildGenericCallback(">"),LEQ:buildGenericCallback("\\leq"),LT:buildGenericCallback("<"),MINUS:buildGenericCallback("-"),NEGATIVE:buildGenericCallback("-"),NEQ:buildGenericCallback("\\neq"),PERCENT:buildGenericCallback("%"),PERIOD:buildGenericCallback("."),PLUS:buildGenericCallback("+"),TIMES:buildGenericCallback("\\times"),FRAC_INCLUSIVE:buildGenericCallback("/",MathFieldActionType.CMD),FRAC:buildGenericCallback("\\frac",MathFieldActionType.CMD),LEFT_PAREN:buildGenericCallback("(",MathFieldActionType.CMD),RIGHT_PAREN:buildGenericCallback(")",MathFieldActionType.CMD),SQRT:buildGenericCallback("sqrt",MathFieldActionType.CMD),PI:buildGenericCallback("pi",MathFieldActionType.CMD),THETA:buildGenericCallback("theta",MathFieldActionType.CMD),RADICAL:buildGenericCallback("nthroot",MathFieldActionType.CMD),BACKSPACE:buildGenericCallback("Backspace",MathFieldActionType.KEYSTROKE),UP:buildGenericCallback("Up",MathFieldActionType.KEYSTROKE),DOWN:buildGenericCallback("Down",MathFieldActionType.KEYSTROKE),CUBE_ROOT:mathQuill=>{mathQuill.write("\\sqrt[3]{}");mathQuill.keystroke("Left");},FRAC_EXCLUSIVE:mathQuill=>{const cursor=mathQuill.cursor();const shouldNavigateLeft=cursor[mathQuillInstance.L]===MathFieldActionType.MQ_END;mathQuill.cmd("\\frac");if(shouldNavigateLeft){mathQuill.keystroke("Left");}},LOG_N:mathQuill=>{mathQuill.write("log_{ }\\left(\\right)");mathQuill.keystroke("Left");mathQuill.keystroke("Left");mathQuill.keystroke("Left");},DISMISS:()=>{},NUM_0:buildGenericCallback("0"),NUM_1:buildGenericCallback("1"),NUM_2:buildGenericCallback("2"),NUM_3:buildGenericCallback("3"),NUM_4:buildGenericCallback("4"),NUM_5:buildGenericCallback("5"),NUM_6:buildGenericCallback("6"),NUM_7:buildGenericCallback("7"),NUM_8:buildGenericCallback("8"),NUM_9:buildGenericCallback("9"),a:buildGenericCallback("a"),b:buildGenericCallback("b"),c:buildGenericCallback("c"),d:buildGenericCallback("d"),e:buildGenericCallback("e"),f:buildGenericCallback("f"),g:buildGenericCallback("g"),h:buildGenericCallback("h"),i:buildGenericCallback("i"),j:buildGenericCallback("j"),k:buildGenericCallback("k"),l:buildGenericCallback("l"),m:buildGenericCallback("m"),n:buildGenericCallback("n"),o:buildGenericCallback("o"),p:buildGenericCallback("p"),q:buildGenericCallback("q"),r:buildGenericCallback("r"),s:buildGenericCallback("s"),t:buildGenericCallback("t"),u:buildGenericCallback("u"),v:buildGenericCallback("v"),w:buildGenericCallback("w"),x:buildGenericCallback("x"),y:buildGenericCallback("y"),z:buildGenericCallback("z"),A:buildGenericCallback("A"),B:buildGenericCallback("B"),C:buildGenericCallback("C"),D:buildGenericCallback("D"),E:buildGenericCallback("E"),F:buildGenericCallback("F"),G:buildGenericCallback("G"),H:buildGenericCallback("H"),I:buildGenericCallback("I"),J:buildGenericCallback("J"),K:buildGenericCallback("K"),L:buildGenericCallback("L"),M:buildGenericCallback("M"),N:buildGenericCallback("N"),O:buildGenericCallback("O"),P:buildGenericCallback("P"),Q:buildGenericCallback("Q"),R:buildGenericCallback("R"),S:buildGenericCallback("S"),T:buildGenericCallback("T"),U:buildGenericCallback("U"),V:buildGenericCallback("V"),W:buildGenericCallback("W"),X:buildGenericCallback("X"),Y:buildGenericCallback("Y"),Z:buildGenericCallback("Z")});
1456
+ function buildGenericCallback(str,type=MathFieldActionType.WRITE){return function(mathQuill){switch(type){case MathFieldActionType.WRITE:{mathQuill.write(str);return}case MathFieldActionType.CMD:{mathQuill.cmd(str);return}case MathFieldActionType.KEYSTROKE:{mathQuill.keystroke(str);return}}}}function buildTranslatableFunctionCallback(command,supportedTranslations,defaultCommand){const cmd=supportedTranslations.includes(command)?command:defaultCommand;return function(mathField){mathField.write(`${cmd}\\left(\\right)`);mathField.keystroke("Left");}}function buildNormalFunctionCallback(command){return function(mathField){mathField.write(`\\${command}\\left(\\right)`);mathField.keystroke("Left");}}const getKeyTranslator=(locale,strings)=>({EXP:handleExponent,EXP_2:handleExponent,EXP_3:handleExponent,JUMP_OUT_PARENTHESES:handleJumpOut,JUMP_OUT_EXPONENT:handleJumpOut,JUMP_OUT_BASE:handleJumpOut,JUMP_INTO_NUMERATOR:handleJumpOut,JUMP_OUT_NUMERATOR:handleJumpOut,JUMP_OUT_DENOMINATOR:handleJumpOut,LEFT:handleArrow,RIGHT:handleArrow,LOG:buildNormalFunctionCallback("log"),LN:buildNormalFunctionCallback("ln"),COS:buildNormalFunctionCallback(strings.cos),SIN:buildTranslatableFunctionCallback(strings.sin,["sin","sen"],"sin"),TAN:buildTranslatableFunctionCallback(strings.tan,["tan","tg"],"tan"),CDOT:buildGenericCallback("\\cdot"),DECIMAL:buildGenericCallback(perseusCore.getDecimalSeparator(locale)),DIVIDE:buildGenericCallback(perseusCore.getDivideSymbolForTex(locale)),EQUAL:buildGenericCallback("="),GEQ:buildGenericCallback("\\geq"),GT:buildGenericCallback(">"),LEQ:buildGenericCallback("\\leq"),LT:buildGenericCallback("<"),MINUS:buildGenericCallback("-"),NEGATIVE:buildGenericCallback("-"),NEQ:buildGenericCallback("\\neq"),PERCENT:buildGenericCallback("%"),PERIOD:buildGenericCallback("."),PLUS:buildGenericCallback("+"),TIMES:buildGenericCallback("\\times"),FRAC_INCLUSIVE:buildGenericCallback("/",MathFieldActionType.CMD),FRAC:buildGenericCallback("\\frac",MathFieldActionType.CMD),LEFT_PAREN:buildGenericCallback("(",MathFieldActionType.CMD),RIGHT_PAREN:buildGenericCallback(")",MathFieldActionType.CMD),SQRT:buildGenericCallback("sqrt",MathFieldActionType.CMD),PI:buildGenericCallback("pi",MathFieldActionType.CMD),THETA:buildGenericCallback("theta",MathFieldActionType.CMD),RADICAL:buildGenericCallback("nthroot",MathFieldActionType.CMD),BACKSPACE:buildGenericCallback("Backspace",MathFieldActionType.KEYSTROKE),UP:buildGenericCallback("Up",MathFieldActionType.KEYSTROKE),DOWN:buildGenericCallback("Down",MathFieldActionType.KEYSTROKE),CUBE_ROOT:mathQuill=>{mathQuill.write("\\sqrt[3]{}");mathQuill.keystroke("Left");},FRAC_EXCLUSIVE:mathQuill=>{const cursor=mathQuill.cursor();const shouldNavigateLeft=cursor[mathQuillInstance.L]===MathFieldActionType.MQ_END;mathQuill.cmd("\\frac");if(shouldNavigateLeft){mathQuill.keystroke("Left");}},LOG_N:mathQuill=>{mathQuill.write("log_{ }\\left(\\right)");mathQuill.keystroke("Left");mathQuill.keystroke("Left");mathQuill.keystroke("Left");},DISMISS:()=>{},NUM_0:buildGenericCallback("0"),NUM_1:buildGenericCallback("1"),NUM_2:buildGenericCallback("2"),NUM_3:buildGenericCallback("3"),NUM_4:buildGenericCallback("4"),NUM_5:buildGenericCallback("5"),NUM_6:buildGenericCallback("6"),NUM_7:buildGenericCallback("7"),NUM_8:buildGenericCallback("8"),NUM_9:buildGenericCallback("9"),a:buildGenericCallback("a"),b:buildGenericCallback("b"),c:buildGenericCallback("c"),d:buildGenericCallback("d"),e:buildGenericCallback("e"),f:buildGenericCallback("f"),g:buildGenericCallback("g"),h:buildGenericCallback("h"),i:buildGenericCallback("i"),j:buildGenericCallback("j"),k:buildGenericCallback("k"),l:buildGenericCallback("l"),m:buildGenericCallback("m"),n:buildGenericCallback("n"),o:buildGenericCallback("o"),p:buildGenericCallback("p"),q:buildGenericCallback("q"),r:buildGenericCallback("r"),s:buildGenericCallback("s"),t:buildGenericCallback("t"),u:buildGenericCallback("u"),v:buildGenericCallback("v"),w:buildGenericCallback("w"),x:buildGenericCallback("x"),y:buildGenericCallback("y"),z:buildGenericCallback("z"),A:buildGenericCallback("A"),B:buildGenericCallback("B"),C:buildGenericCallback("C"),D:buildGenericCallback("D"),E:buildGenericCallback("E"),F:buildGenericCallback("F"),G:buildGenericCallback("G"),H:buildGenericCallback("H"),I:buildGenericCallback("I"),J:buildGenericCallback("J"),K:buildGenericCallback("K"),L:buildGenericCallback("L"),M:buildGenericCallback("M"),N:buildGenericCallback("N"),O:buildGenericCallback("O"),P:buildGenericCallback("P"),Q:buildGenericCallback("Q"),R:buildGenericCallback("R"),S:buildGenericCallback("S"),T:buildGenericCallback("T"),U:buildGenericCallback("U"),V:buildGenericCallback("V"),W:buildGenericCallback("W"),X:buildGenericCallback("X"),Y:buildGenericCallback("Y"),Z:buildGenericCallback("Z")});
1457
1457
 
1458
1458
  class MathWrapper{focus(){this.mathField.cursor().show();this.mathField.focus();}blur(){this.mathField.cursor().hide();this.mathField.blur();}pressKey(key){const cursor=this.getCursor();const translator=this.mobileKeyTranslator[key];if(translator){translator(this.mathField,key);}if(!cursor.selection){cursor.show();}if(this.callbacks.onSelectionChanged){this.callbacks.onSelectionChanged(cursor.selection);}return {context:this.contextForCursor()}}setCursorPosition(x,y,hitNode){const el=hitNode||document.elementFromPoint(x,y);if(el){const cursor=this.getCursor();if(el.hasAttribute("mq-root-block")){cursor.insAtRightEnd(this.mathField.controller().root);}else {const controller=this.mathField.controller();const pageX=x-document.body.scrollLeft;const pageY=y-document.body.scrollTop;controller.seek(el,pageX,pageY).cursor.startSelection();const command=maybeFindCommand(cursor[mathQuillInstance.L]);if(command&&command.endNode){cursor.insLeftOf(command.endNode);this.mathField.keystroke("Right");}}if(this.callbacks.onCursorMove){this.callbacks.onCursorMove({context:this.contextForCursor()});}}}getCursor(){return this.mathField.cursor()}contextForCursor(){return getCursorContext(this.mathField)}getSelection(){return this.getCursor().selection}getContent(){return this.mathField.latex()}setContent(latex){this.mathField.latex(latex);}isEmpty(){const cursor=this.getCursor();return cursor.parent.id===1&&cursor[1]===0&&cursor[-1]===0}constructor(mathFieldMount,ariaLabel,strings,locale,callbacks={}){this.mathField=createMathField(mathFieldMount,locale,strings,()=>{return {substituteTextarea:function(){return document.createElement("span")}}});this.mathField?.setAriaLabel(ariaLabel);this.callbacks=callbacks;this.mobileKeyTranslator={...getKeyTranslator(locale,strings),BACKSPACE:handleBackspace};}}
1459
1459
 
@@ -1499,7 +1499,7 @@ class TransitionChild extends React__namespace.Component{static getDerivedStateF
1499
1499
 
1500
1500
  class AphroditeCSSTransitionGroup extends React__namespace.Component{render(){const{children}=this.props;return jsxRuntimeExports.jsx(reactTransitionGroup.TransitionGroup,{component:null,children:React__namespace.Children.map(children,child=>jsxRuntimeExports.jsx(TransitionChild$1,{transitionStyles:this.props.transitionStyle,appearTimeout:this.props.transitionAppearTimeout,enterTimeout:this.props.transitionEnterTimeout,leaveTimeout:this.props.transitionLeaveTimeout,children:child}))})}}
1501
1501
 
1502
- const AnimationDurationInMS=200;class MobileKeypadInternals extends React__namespace.Component{componentDidMount(){this._resize();window.addEventListener("resize",this._throttleResizeHandler);window.addEventListener("orientationchange",this._throttleResizeHandler);if("ResizeObserver"in window){this._containerResizeObserver=new window.ResizeObserver(this._throttleResizeHandler);if(this._containerRef.current){this._containerResizeObserver.observe?.(this._containerRef.current);}}this.props.onElementMounted?.({activate:this.activate,dismiss:this.dismiss,configure:this.configure,setCursor:this.setCursor,setKeyHandler:this.setKeyHandler,getDOMNode:this.getDOMNode});}componentWillUnmount(){window.removeEventListener("resize",this._throttleResizeHandler);window.removeEventListener("orientationchange",this._throttleResizeHandler);this._containerResizeObserver?.disconnect?.();}_handleClickKey(key){if(key==="DISMISS"){this.dismiss();return}const cursor=this.state.keyHandler?.(key);this.setState({cursor});}render(){const{keypadActive,style}=this.props;const{containerWidth,cursor,keypadConfig}=this.state;const containerStyle=[styles.keypadContainer,...Array.isArray(style)?style:[style]];const isExpression=keypadConfig?.keypadType==="EXPRESSION";const convertDotToTimes=keypadConfig?.times;return jsxRuntimeExports.jsx(View,{style:containerStyle,forwardRef:this._containerRef,children:jsxRuntimeExports.jsx(AphroditeCSSTransitionGroup,{transitionEnterTimeout:AnimationDurationInMS,transitionLeaveTimeout:AnimationDurationInMS,transitionStyle:{appear:{transform:"translate3d(0, 100%, 0)",transition:`${AnimationDurationInMS}ms ease-out`},appearActive:{transform:"translate3d(0, 100%, 0)"},enter:{transform:"translate3d(0, 50%, 0)",transition:`${AnimationDurationInMS}ms ease-out`},enterActive:{transform:"translate3d(0, 0, 0)"},leave:{transform:"translate3d(0, 0, 0)",transition:`${AnimationDurationInMS}ms ease-out`},leaveActive:{transform:"translate3d(0, 100%, 0)"}},children:keypadActive?jsxRuntimeExports.jsx(Keypad,{onAnalyticsEvent:this.props.onAnalyticsEvent,extraKeys:keypadConfig?.extraKeys,onClickKey:key=>this._handleClickKey(key),cursorContext:cursor?.context,fractionsOnly:!isExpression,convertDotToTimes:convertDotToTimes,divisionKey:isExpression,trigonometry:isExpression,preAlgebra:isExpression,logarithms:isExpression,basicRelations:isExpression,advancedRelations:isExpression,expandedView:containerWidth>expandedViewThreshold,showDismiss:true,scientific:isExpression&&keypadConfig?.scientific}):null})})}constructor(...args){super(...args),this._containerRef=React__namespace.createRef(),this._containerResizeObserver=null,this._throttleResize=false,this.state={containerWidth:0},this._resize=()=>{const containerWidth=this._containerRef.current?.clientWidth||0;this.setState({containerWidth});},this._throttleResizeHandler=()=>{if(this._throttleResize){return}this._throttleResize=true;setTimeout(()=>{this._resize();this._throttleResize=false;},100);},this.activate=()=>{this.props.setKeypadActive(true);},this.dismiss=()=>{this.props.setKeypadActive(false);this.props.onDismiss?.();},this.configure=(configuration,cb)=>{this.setState({keypadConfig:configuration});setTimeout(()=>cb&&cb());},this.setCursor=cursor=>{this.setState({cursor});},this.setKeyHandler=keyHandler=>{this.setState({keyHandler});},this.getDOMNode=()=>{return ReactDOM__default.default.findDOMNode(this)};}}const styles=aphrodite.StyleSheet.create({keypadContainer:{bottom:0,left:0,right:0,position:"fixed"}});
1502
+ const AnimationDurationInMS=200;class MobileKeypadInternals extends React__namespace.Component{componentDidMount(){this._resize();window.addEventListener("resize",this._throttleResizeHandler);window.addEventListener("orientationchange",this._throttleResizeHandler);if("ResizeObserver"in window){this._containerResizeObserver=new window.ResizeObserver(this._throttleResizeHandler);if(this._containerRef.current){this._containerResizeObserver.observe?.(this._containerRef.current);}}this.props.onElementMounted?.({activate:this.activate,dismiss:this.dismiss,configure:this.configure,setCursor:this.setCursor,setKeyHandler:this.setKeyHandler,getDOMNode:this.getDOMNode});}componentWillUnmount(){window.removeEventListener("resize",this._throttleResizeHandler);window.removeEventListener("orientationchange",this._throttleResizeHandler);this._containerResizeObserver?.disconnect?.();}_handleClickKey(key){if(key==="DISMISS"){this.dismiss();return}const cursor=this.state.keyHandler?.(key);this.setState({cursor});}render(){const{keypadActive,style}=this.props;const{containerWidth,cursor,keypadConfig}=this.state;const containerStyle=[styles.keypadContainer,...Array.isArray(style)?style:[style]];const isExpression=keypadConfig?.keypadType==="EXPRESSION";const convertDotToTimes=keypadConfig?.times;return jsxRuntimeExports.jsx(View,{style:containerStyle,forwardRef:this._containerRef,children:jsxRuntimeExports.jsx(AphroditeCSSTransitionGroup,{transitionEnterTimeout:AnimationDurationInMS,transitionLeaveTimeout:AnimationDurationInMS,transitionStyle:{appear:{transform:"translate3d(0, 100%, 0)",transition:`${AnimationDurationInMS}ms ease-out`},appearActive:{transform:"translate3d(0, 100%, 0)"},enter:{transform:"translate3d(0, 50%, 0)",transition:`${AnimationDurationInMS}ms ease-out`},enterActive:{transform:"translate3d(0, 0, 0)"},leave:{transform:"translate3d(0, 0, 0)",transition:`${AnimationDurationInMS}ms ease-out`},leaveActive:{transform:"translate3d(0, 100%, 0)"}},children:keypadActive?jsxRuntimeExports.jsx(Keypad,{onAnalyticsEvent:this.props.onAnalyticsEvent,extraKeys:keypadConfig?.extraKeys,onClickKey:key=>this._handleClickKey(key),cursorContext:cursor?.context,fractionsOnly:!isExpression,convertDotToTimes:convertDotToTimes,divisionKey:isExpression,trigonometry:isExpression,preAlgebra:isExpression,logarithms:isExpression,basicRelations:isExpression,advancedRelations:isExpression,expandedView:containerWidth>expandedViewThreshold,showDismiss:true,scientific:isExpression&&keypadConfig?.scientific}):null})})}constructor(...args){super(...args),this._containerRef=React__namespace.createRef(),this._containerResizeObserver=null,this._throttleResize=false,this.state={containerWidth:0},this._resize=()=>{const containerWidth=this._containerRef.current?.clientWidth||0;this.setState({containerWidth});},this._throttleResizeHandler=()=>{if(this._throttleResize){return}this._throttleResize=true;setTimeout(()=>{this._resize();this._throttleResize=false;},100);},this.activate=()=>{this.props.setKeypadActive(true);},this.dismiss=()=>{this.props.setKeypadActive(false);this.props.onDismiss?.();},this.configure=(configuration,cb)=>{this.setState({keypadConfig:configuration});setTimeout(()=>cb&&cb());},this.setCursor=cursor=>{this.setState({cursor});},this.setKeyHandler=keyHandler=>{this.setState({keyHandler});},this.getDOMNode=()=>{return ReactDOM__default.default.findDOMNode(this)};}}const styles=aphrodite.StyleSheet.create({keypadContainer:{bottom:0,left:0,right:0,position:"fixed",borderStyle:"solid",borderWidth:1,borderColor:wonderBlocksTokens.semanticColor.core.border.neutral.subtle}});
1503
1503
 
1504
1504
  function MobileKeypad(props){return jsxRuntimeExports.jsx(keypadContext.KeypadContext.Consumer,{children:({keypadActive,setKeypadActive})=>jsxRuntimeExports.jsx(MobileKeypadInternals,{...props,keypadActive:keypadActive,setKeypadActive:setKeypadActive})})}
1505
1505