@khanacademy/math-input 23.0.6 → 25.0.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/es/index.js +21 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js.map +1 -1
- package/dist/index.js +66 -31
- package/dist/index.js.map +1 -1
- package/dist/strings.js.map +1 -1
- package/package.json +5 -5
package/dist/es/strings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.js","sources":["../../src/strings.ts"],"sourcesContent":["/**\n * The translated strings that are used to render the Math Input.\n */\nexport type MathInputStrings = {\n mathInputBox: string;\n fingerTap: string;\n before: ({obj}: {obj: string}) => string;\n after: ({obj}: {obj: string}) => string;\n \"beginning of\": ({obj}: {obj: string}) => string;\n \"end of\": ({obj}: {obj: string}) => string;\n Baseline: string;\n Superscript: string;\n selected: ({obj}: {obj: string}) => string;\n \"no answer\": string;\n \"nothing selected\": string;\n \"nothing to the right\": string;\n \"nothing to the left\": string;\n \"block is empty\": string;\n \"nothing above\": string;\n labelValue: ({label, value}: {label: string; value: string}) => string;\n plus: string;\n minus: string;\n negative: string;\n times: string;\n divide: string;\n decimal: string;\n percent: string;\n cdot: string;\n equalsSign: string;\n notEqualsSign: string;\n greaterThanSign: string;\n lessThanSign: string;\n greaterThanOrEqualToSign: string;\n lessThanOrEqualSign: string;\n fractionExpressionInNumerator: string;\n fractionExcludingExpression: string;\n customExponent: string;\n square: string;\n cube: string;\n squareRoot: string;\n cubeRoot: string;\n radicalWithCustomRoot: string;\n leftParenthesis: string;\n rightParenthesis: string;\n naturalLog: string;\n logBase10: string;\n logCustomBase: string;\n sine: string;\n sin: string;\n cosine: string;\n cos: string;\n tangent: string;\n tan: string;\n pi: string;\n theta: string;\n upArrow: string;\n rightArrow: string;\n downArrow: string;\n leftArrow: string;\n navOutOfParentheses: string;\n navOutOfExponent: string;\n navOutOfBase: string;\n navIntoNumerator: string;\n navOutOfNumeratorIntoDenominator: string;\n navOutOfDenominator: string;\n delete: string;\n dismiss: string;\n};\n\n/**\n * Untranslated strings used in the math input. To be used by an external\n * translator to produce translated strings, passed in as `MathInputStrings`.\n */\nexport const strings: {\n [key in keyof MathInputStrings]:\n | string\n | {context?: string; message: string}\n | {context?: string; one: string; other: string};\n} = {\n mathInputBox: \"Math input box\",\n fingerTap: \"Tap with one or two fingers to open keyboard\",\n before: \"before %(obj)s\",\n after: \"after %(obj)s\",\n \"beginning of\": \"beginning of %(obj)s\",\n \"end of\": \"end of %(obj)s\",\n Baseline: \"Baseline\",\n Superscript: \"Superscript\",\n selected: \"%(obj)s selected\",\n \"no answer\": \"no answer\",\n \"nothing selected\": \"nothing selected\",\n \"nothing to the right\": \"nothing to the right\",\n \"nothing to the left\": \"nothing to the left\",\n \"block is empty\": \"block is empty\",\n \"nothing above\": \"nothing above\",\n labelValue: \"%(label)s: %(value)s\",\n plus: {\n context: \"A label for a 'plus' sign.\",\n message: \"Plus\",\n },\n minus: {context: \"A label for a 'minus' sign.\", message: \"Minus\"},\n negative: {context: \"A label for a 'negative' sign.\", message: \"Negative\"},\n times: {context: \"A label for a 'multiply' sign.\", message: \"Multiply\"},\n divide: {context: \"A label for a 'divide' sign.\", message: \"Divide\"},\n decimal: {\n context: \"A label for a 'decimal' sign (represented as '.' or ',').\",\n message: \"Decimal\",\n },\n percent: {\n context: \"A label for a 'percent' sign (represented as '%').\",\n message: \"Percent\",\n },\n cdot: {\n context:\n \"A label for a 'centered dot' multiplication sign (represented as '⋅').\",\n message: \"Multiply\",\n },\n equalsSign: {\n context: \"A label for an 'equals' sign (represented as '=').\",\n message: \"Equals sign\",\n },\n notEqualsSign: {\n context: \"A label for a 'not-equals' sign (represented as '≠').\",\n message: \"Not-equals sign\",\n },\n greaterThanSign: {\n context: \"A label for a 'greater than' sign (represented as '>').\",\n message: \"Greater than sign\",\n },\n lessThanSign: {\n context: \"A label for a 'less than' sign (represented as '<').\",\n message: \"Less than sign\",\n },\n greaterThanOrEqualToSign: {\n context:\n \"A label for a 'greater than or equal to' sign (represented as '≥').\",\n message: \"Greater than or equal to sign\",\n },\n lessThanOrEqualSign: {\n context:\n \"A label for a 'less than or equal to' sign (represented as '≤').\",\n message: \"Less than or equal to sign\",\n },\n fractionExpressionInNumerator: {\n context:\n \"A label for a button that creates a new fraction and puts the current expression in the numerator of that fraction.\",\n message: \"Fraction, with current expression in numerator\",\n },\n fractionExcludingExpression: {\n context:\n \"A label for a button that creates a new fraction next to the cursor.\",\n message: \"Fraction, excluding the current expression\",\n },\n customExponent: {\n context:\n \"A label for a button that will allow the user to input a custom exponent.\",\n message: \"Custom exponent\",\n },\n square: {\n context:\n \"A label for a button that will square (take to the second power) some math.\",\n message: \"Square\",\n },\n cube: {\n context:\n \"A label for a button that will cube (take to the third power) some math.\",\n message: \"Cube\",\n },\n squareRoot: {\n context:\n \"A label for a button that will allow the user to input a square root.\",\n message: \"Square root\",\n },\n cubeRoot: {\n context:\n \"A label for a button that will allow the user to input a cube root.\",\n message: \"Cube root\",\n },\n radicalWithCustomRoot: {\n context:\n \"A label for a button that will allow the user to input a radical with a custom root.\",\n message: \"Radical with custom root\",\n },\n leftParenthesis: {\n context:\n \"A label for a button that will allow the user to input a left parenthesis (i.e. '(')\",\n message: \"Left parenthesis\",\n },\n rightParenthesis: {\n context:\n \"A label for a button that will allow the user to input a right parenthesis (i.e. ')')\",\n message: \"Right parenthesis\",\n },\n naturalLog: {\n context:\n \"A label for a button that will allow the user to input a natural logarithm.\",\n message: \"Natural logarithm\",\n },\n logBase10: {\n context:\n \"A label for a button that will allow the user to input a logarithm with base 10.\",\n message: \"Logarithm with base 10\",\n },\n logCustomBase: {\n context:\n \"A label for a button that will allow the user to input a logarithm with a custom base.\",\n message: \"Logarithm with custom base\",\n },\n sine: {\n context:\n \"A label for a button that will allow the user to input a sine function.\",\n message: \"Sine\",\n },\n sin: {\n context:\n \"A label for a button that will allow the user to input a sine function (shorthand version).\",\n message: \"sin\",\n },\n cosine: {\n context:\n \"A label for a button that will allow the user to input a cosine function.\",\n message: \"Cosine\",\n },\n cos: {\n context:\n \"A label for a button that will allow the user to input a cosine function (shorthand version).\",\n message: \"cos\",\n },\n tangent: {\n context:\n \"A label for a button that will allow the user to input a tangent function.\",\n message: \"Tangent\",\n },\n tan: {\n context:\n \"A label for a button that will allow the user to input a tangent function (shorthand version).\",\n message: \"tan\",\n },\n pi: {\n context:\n \"A label for a button that will allow the user to input the mathematical constant pi (i.e., π)\",\n message: \"Pi\",\n },\n theta: {\n context:\n \"A label for a button that will allow the user to input the mathematical constant theta (i.e., θ)\",\n message: \"Theta\",\n },\n upArrow: \"Up arrow\",\n rightArrow: \"Right arrow\",\n downArrow: \"Down arrow\",\n leftArrow: \"Left arrow\",\n navOutOfParentheses: \"Navigate right out of a set of parentheses\",\n navOutOfExponent: \"Navigate right out of an exponent\",\n navOutOfBase: \"Navigate right out of a base\",\n navIntoNumerator: \"Navigate right into the numerator of a fraction\",\n navOutOfNumeratorIntoDenominator:\n \"Navigate right out of the numerator and into the denominator\",\n navOutOfDenominator: \"Navigate right out of the denominator of a fraction\",\n delete: \"Delete\",\n dismiss: {\n context: \"A label for a button that will dismiss/hide a keypad.\",\n message: \"Dismiss\",\n },\n};\n\n/**\n * Mock strings for the Math Input package, to be used for tests and Storybook.\n */\nexport const mockStrings: MathInputStrings = {\n mathInputBox: \"Math input box\",\n fingerTap: \"Tap with one or two fingers to open keyboard\",\n before: ({obj}: {obj: string}) => `before ${obj}`,\n after: ({obj}: {obj: string}) => `after ${obj}`,\n \"beginning of\": ({obj}: {obj: string}) => `beginning of ${obj}`,\n \"end of\": ({obj}: {obj: string}) => `end of ${obj}`,\n Baseline: \"Baseline\",\n Superscript: \"Superscript\",\n selected: ({obj}: {obj: string}) => `${obj} selected`,\n \"no answer\": \"no answer\",\n \"nothing selected\": \"nothing selected\",\n \"nothing to the right\": \"nothing to the right\",\n \"nothing to the left\": \"nothing to the left\",\n \"block is empty\": \"block is empty\",\n \"nothing above\": \"nothing above\",\n labelValue: ({label, value}: {label: string; value: string}) =>\n `${label}: ${value}`,\n plus: \"Plus\",\n minus: \"Minus\",\n negative: \"Negative\",\n times: \"Multiply\",\n divide: \"Divide\",\n decimal: \"Decimal\",\n percent: \"Percent\",\n cdot: \"Multiply\",\n equalsSign: \"Equals sign\",\n notEqualsSign: \"Not-equals sign\",\n greaterThanSign: \"Greater than sign\",\n lessThanSign: \"Less than sign\",\n greaterThanOrEqualToSign: \"Greater than or equal to sign\",\n lessThanOrEqualSign: \"Less than or equal to sign\",\n fractionExpressionInNumerator:\n \"Fraction, with current expression in numerator\",\n fractionExcludingExpression: \"Fraction, excluding the current expression\",\n customExponent: \"Custom exponent\",\n square: \"Square\",\n cube: \"Cube\",\n squareRoot: \"Square root\",\n cubeRoot: \"Cube root\",\n radicalWithCustomRoot: \"Radical with custom root\",\n leftParenthesis: \"Left parenthesis\",\n rightParenthesis: \"Right parenthesis\",\n naturalLog: \"Natural logarithm\",\n logBase10: \"Logarithm with base 10\",\n logCustomBase: \"Logarithm with custom base\",\n sine: \"Sine\",\n sin: \"sin\",\n cosine: \"Cosine\",\n cos: \"cos\",\n tangent: \"Tangent\",\n tan: \"tan\",\n pi: \"Pi\",\n theta: \"Theta\",\n upArrow: \"Up arrow\",\n rightArrow: \"Right arrow\",\n downArrow: \"Down arrow\",\n leftArrow: \"Left arrow\",\n navOutOfParentheses: \"Navigate right out of a set of parentheses\",\n navOutOfExponent: \"Navigate right out of an exponent\",\n navOutOfBase: \"Navigate right out of a base\",\n navIntoNumerator: \"Navigate right into the numerator of a fraction\",\n navOutOfNumeratorIntoDenominator:\n \"Navigate right out of the numerator and into the denominator\",\n navOutOfDenominator: \"Navigate right out of the denominator of a fraction\",\n delete: \"Delete\",\n dismiss: \"Dismiss\",\n};\n"],"names":["strings","mathInputBox","fingerTap","before","after","Baseline","Superscript","selected","labelValue","plus","context","message","minus","negative","times","divide","decimal","percent","cdot","equalsSign","notEqualsSign","greaterThanSign","lessThanSign","greaterThanOrEqualToSign","lessThanOrEqualSign","fractionExpressionInNumerator","fractionExcludingExpression","customExponent","square","cube","squareRoot","cubeRoot","radicalWithCustomRoot","leftParenthesis","rightParenthesis","naturalLog","logBase10","logCustomBase","sine","sin","cosine","cos","tangent","tan","pi","theta","upArrow","rightArrow","downArrow","leftArrow","navOutOfParentheses","navOutOfExponent","navOutOfBase","navIntoNumerator","navOutOfNumeratorIntoDenominator","navOutOfDenominator","delete","dismiss","mockStrings","obj","beginning of","end of","label","value"],"mappings":"AAAA;AACA;AACA;;AAmEA;AACA;AACA;AACA;AACO,MAAMA,OAKZ,GAAG;AACAC,EAAAA,YAAY,EAAE,gBAAgB;AAC9BC,EAAAA,SAAS,EAAE,8CAA8C;AACzDC,EAAAA,MAAM,EAAE,gBAAgB;AACxBC,EAAAA,KAAK,EAAE,eAAe;AACtB,EAAA,cAAc,EAAE,sBAAsB;AACtC,EAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,QAAQ,EAAE,kBAAkB;AAC5B,EAAA,WAAW,EAAE,WAAW;AACxB,EAAA,kBAAkB,EAAE,kBAAkB;AACtC,EAAA,sBAAsB,EAAE,sBAAsB;AAC9C,EAAA,qBAAqB,EAAE,qBAAqB;AAC5C,EAAA,gBAAgB,EAAE,gBAAgB;AAClC,EAAA,eAAe,EAAE,eAAe;AAChCC,EAAAA,UAAU,EAAE,sBAAsB;AAClCC,EAAAA,IAAI,EAAE;AACFC,IAAAA,OAAO,EAAE,4BAA4B;AACrCC,IAAAA,OAAO,EAAE,MAAA;GACZ;AACDC,EAAAA,KAAK,EAAE;AAACF,IAAAA,OAAO,EAAE,6BAA6B;AAAEC,IAAAA,OAAO,EAAE,OAAA;GAAQ;AACjEE,EAAAA,QAAQ,EAAE;AAACH,IAAAA,OAAO,EAAE,gCAAgC;AAAEC,IAAAA,OAAO,EAAE,U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AgB,EAAE,mCAAmC;AACrDC,EAAAA,YAAY,EAAE,8BAA8B;AAC5CC,EAAAA,gBAAgB,EAAE,iDAAiD;AACnEC,EAAAA,gCAAgC,EAC5B,8DAA8D;AAClEC,EAAAA,mBAAmB,EAAE,qDAAqD;AAC1EC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,OAAO,EAAE,SAAA;AACb;;;;"}
|
|
1
|
+
{"version":3,"file":"strings.js","sources":["../../src/strings.ts"],"sourcesContent":["/**\n * The translated strings that are used to render the Math Input.\n */\nexport type MathInputStrings = {\n mathInputBox: string;\n fingerTap: string;\n before: ({obj}: {obj: string}) => string;\n after: ({obj}: {obj: string}) => string;\n \"beginning of\": ({obj}: {obj: string}) => string;\n \"end of\": ({obj}: {obj: string}) => string;\n Baseline: string;\n Superscript: string;\n selected: ({obj}: {obj: string}) => string;\n \"no answer\": string;\n \"nothing selected\": string;\n \"nothing to the right\": string;\n \"nothing to the left\": string;\n \"block is empty\": string;\n \"nothing above\": string;\n labelValue: ({label, value}: {label: string; value: string}) => string;\n plus: string;\n minus: string;\n negative: string;\n times: string;\n divide: string;\n decimal: string;\n percent: string;\n cdot: string;\n equalsSign: string;\n notEqualsSign: string;\n greaterThanSign: string;\n lessThanSign: string;\n greaterThanOrEqualToSign: string;\n lessThanOrEqualSign: string;\n fractionExpressionInNumerator: string;\n fractionExcludingExpression: string;\n customExponent: string;\n square: string;\n cube: string;\n squareRoot: string;\n cubeRoot: string;\n radicalWithCustomRoot: string;\n leftParenthesis: string;\n rightParenthesis: string;\n naturalLog: string;\n logBase10: string;\n logCustomBase: string;\n sine: string;\n sin: string;\n cosine: string;\n cos: string;\n tangent: string;\n tan: string;\n pi: string;\n theta: string;\n upArrow: string;\n rightArrow: string;\n downArrow: string;\n leftArrow: string;\n navOutOfParentheses: string;\n navOutOfExponent: string;\n navOutOfBase: string;\n navIntoNumerator: string;\n navOutOfNumeratorIntoDenominator: string;\n navOutOfDenominator: string;\n delete: string;\n dismiss: string;\n};\n\n/**\n * Untranslated strings used in the math input. To be used by an external\n * translator to produce translated strings, passed in as `MathInputStrings`.\n */\nexport const strings: {\n [key in keyof MathInputStrings]:\n | string\n | {context?: string; message: string}\n | {context?: string; one: string; other: string};\n} = {\n mathInputBox: \"Math input box\",\n fingerTap: \"Tap with one or two fingers to open keyboard\",\n before: \"before %(obj)s\",\n after: \"after %(obj)s\",\n \"beginning of\": \"beginning of %(obj)s\",\n \"end of\": \"end of %(obj)s\",\n Baseline: \"Baseline\",\n Superscript: \"Superscript\",\n selected: \"%(obj)s selected\",\n \"no answer\": \"no answer\",\n \"nothing selected\": \"nothing selected\",\n \"nothing to the right\": \"nothing to the right\",\n \"nothing to the left\": \"nothing to the left\",\n \"block is empty\": \"block is empty\",\n \"nothing above\": \"nothing above\",\n labelValue: \"%(label)s: %(value)s\",\n plus: {\n context: \"A label for a 'plus' sign.\",\n message: \"Plus\",\n },\n minus: {context: \"A label for a 'minus' sign.\", message: \"Minus\"},\n negative: {context: \"A label for a 'negative' sign.\", message: \"Negative\"},\n times: {context: \"A label for a 'multiply' sign.\", message: \"Multiply\"},\n divide: {context: \"A label for a 'divide' sign.\", message: \"Divide\"},\n decimal: {\n context: \"A label for a 'decimal' sign (represented as '.' or ',').\",\n message: \"Decimal\",\n },\n percent: {\n context: \"A label for a 'percent' sign (represented as '%').\",\n message: \"Percent\",\n },\n cdot: {\n context:\n \"A label for a 'centered dot' multiplication sign (represented as '⋅').\",\n message: \"Multiply\",\n },\n equalsSign: {\n context: \"A label for an 'equals' sign (represented as '=').\",\n message: \"Equals sign\",\n },\n notEqualsSign: {\n context: \"A label for a 'not-equals' sign (represented as '≠').\",\n message: \"Not-equals sign\",\n },\n greaterThanSign: {\n context: \"A label for a 'greater than' sign (represented as '>').\",\n message: \"Greater than sign\",\n },\n lessThanSign: {\n context: \"A label for a 'less than' sign (represented as '<').\",\n message: \"Less than sign\",\n },\n greaterThanOrEqualToSign: {\n context:\n \"A label for a 'greater than or equal to' sign (represented as '≥').\",\n message: \"Greater than or equal to sign\",\n },\n lessThanOrEqualSign: {\n context:\n \"A label for a 'less than or equal to' sign (represented as '≤').\",\n message: \"Less than or equal to sign\",\n },\n fractionExpressionInNumerator: {\n context:\n \"A label for a button that creates a new fraction and puts the current expression in the numerator of that fraction.\",\n message: \"Fraction, with current expression in numerator\",\n },\n fractionExcludingExpression: {\n context:\n \"A label for a button that creates a new fraction next to the cursor.\",\n message: \"Fraction, excluding the current expression\",\n },\n customExponent: {\n context:\n \"A label for a button that will allow the user to input a custom exponent.\",\n message: \"Custom exponent\",\n },\n square: {\n context:\n \"A label for a button that will square (take to the second power) some math.\",\n message: \"Square\",\n },\n cube: {\n context:\n \"A label for a button that will cube (take to the third power) some math.\",\n message: \"Cube\",\n },\n squareRoot: {\n context:\n \"A label for a button that will allow the user to input a square root.\",\n message: \"Square root\",\n },\n cubeRoot: {\n context:\n \"A label for a button that will allow the user to input a cube root.\",\n message: \"Cube root\",\n },\n radicalWithCustomRoot: {\n context:\n \"A label for a button that will allow the user to input a radical with a custom root.\",\n message: \"Radical with custom root\",\n },\n leftParenthesis: {\n context:\n \"A label for a button that will allow the user to input a left parenthesis (i.e. '(')\",\n message: \"Left parenthesis\",\n },\n rightParenthesis: {\n context:\n \"A label for a button that will allow the user to input a right parenthesis (i.e. ')')\",\n message: \"Right parenthesis\",\n },\n naturalLog: {\n context:\n \"A label for a button that will allow the user to input a natural logarithm.\",\n message: \"Natural logarithm\",\n },\n logBase10: {\n context:\n \"A label for a button that will allow the user to input a logarithm with base 10.\",\n message: \"Logarithm with base 10\",\n },\n logCustomBase: {\n context:\n \"A label for a button that will allow the user to input a logarithm with a custom base.\",\n message: \"Logarithm with custom base\",\n },\n sine: {\n context:\n \"A label for a button that will allow the user to input a sine function.\",\n message: \"Sine\",\n },\n sin: {\n context:\n \"A label for a button that will allow the user to input a sine function (shorthand version).\",\n message: \"sin\",\n },\n cosine: {\n context:\n \"A label for a button that will allow the user to input a cosine function.\",\n message: \"Cosine\",\n },\n cos: {\n context:\n \"A label for a button that will allow the user to input a cosine function (shorthand version).\",\n message: \"cos\",\n },\n tangent: {\n context:\n \"A label for a button that will allow the user to input a tangent function.\",\n message: \"Tangent\",\n },\n tan: {\n context:\n \"A label for a button that will allow the user to input a tangent function (shorthand version).\",\n message: \"tan\",\n },\n pi: {\n context:\n \"A label for a button that will allow the user to input the mathematical constant pi (i.e., π)\",\n message: \"Pi\",\n },\n theta: {\n context:\n \"A label for a button that will allow the user to input the mathematical constant theta (i.e., θ)\",\n message: \"Theta\",\n },\n upArrow: \"Up arrow\",\n rightArrow: \"Right arrow\",\n downArrow: \"Down arrow\",\n leftArrow: \"Left arrow\",\n navOutOfParentheses: \"Navigate right out of a set of parentheses\",\n navOutOfExponent: \"Navigate right out of an exponent\",\n navOutOfBase: \"Navigate right out of a base\",\n navIntoNumerator: \"Navigate right into the numerator of a fraction\",\n navOutOfNumeratorIntoDenominator:\n \"Navigate right out of the numerator and into the denominator\",\n navOutOfDenominator: \"Navigate right out of the denominator of a fraction\",\n delete: \"Delete\",\n dismiss: {\n context: \"A label for a button that will dismiss/hide a keypad.\",\n message: \"Dismiss\",\n },\n};\n\n/**\n * Mock strings for the Math Input package, to be used for tests and Storybook.\n */\nexport const mockStrings: MathInputStrings = {\n mathInputBox: \"Math input box\",\n fingerTap: \"Tap with one or two fingers to open keyboard\",\n before: ({obj}: {obj: string}) => `before ${obj}`,\n after: ({obj}: {obj: string}) => `after ${obj}`,\n \"beginning of\": ({obj}: {obj: string}) => `beginning of ${obj}`,\n \"end of\": ({obj}: {obj: string}) => `end of ${obj}`,\n Baseline: \"Baseline\",\n Superscript: \"Superscript\",\n selected: ({obj}: {obj: string}) => `${obj} selected`,\n \"no answer\": \"no answer\",\n \"nothing selected\": \"nothing selected\",\n \"nothing to the right\": \"nothing to the right\",\n \"nothing to the left\": \"nothing to the left\",\n \"block is empty\": \"block is empty\",\n \"nothing above\": \"nothing above\",\n labelValue: ({label, value}: {label: string; value: string}) =>\n `${label}: ${value}`,\n plus: \"Plus\",\n minus: \"Minus\",\n negative: \"Negative\",\n times: \"Multiply\",\n divide: \"Divide\",\n decimal: \"Decimal\",\n percent: \"Percent\",\n cdot: \"Multiply\",\n equalsSign: \"Equals sign\",\n notEqualsSign: \"Not-equals sign\",\n greaterThanSign: \"Greater than sign\",\n lessThanSign: \"Less than sign\",\n greaterThanOrEqualToSign: \"Greater than or equal to sign\",\n lessThanOrEqualSign: \"Less than or equal to sign\",\n fractionExpressionInNumerator:\n \"Fraction, with current expression in numerator\",\n fractionExcludingExpression: \"Fraction, excluding the current expression\",\n customExponent: \"Custom exponent\",\n square: \"Square\",\n cube: \"Cube\",\n squareRoot: \"Square root\",\n cubeRoot: \"Cube root\",\n radicalWithCustomRoot: \"Radical with custom root\",\n leftParenthesis: \"Left parenthesis\",\n rightParenthesis: \"Right parenthesis\",\n naturalLog: \"Natural logarithm\",\n logBase10: \"Logarithm with base 10\",\n logCustomBase: \"Logarithm with custom base\",\n sine: \"Sine\",\n sin: \"sin\",\n cosine: \"Cosine\",\n cos: \"cos\",\n tangent: \"Tangent\",\n tan: \"tan\",\n pi: \"Pi\",\n theta: \"Theta\",\n upArrow: \"Up arrow\",\n rightArrow: \"Right arrow\",\n downArrow: \"Down arrow\",\n leftArrow: \"Left arrow\",\n navOutOfParentheses: \"Navigate right out of a set of parentheses\",\n navOutOfExponent: \"Navigate right out of an exponent\",\n navOutOfBase: \"Navigate right out of a base\",\n navIntoNumerator: \"Navigate right into the numerator of a fraction\",\n navOutOfNumeratorIntoDenominator:\n \"Navigate right out of the numerator and into the denominator\",\n navOutOfDenominator: \"Navigate right out of the denominator of a fraction\",\n delete: \"Delete\",\n dismiss: \"Dismiss\",\n};\n"],"names":["strings","mathInputBox","fingerTap","before","after","Baseline","Superscript","selected","labelValue","plus","context","message","minus","negative","times","divide","decimal","percent","cdot","equalsSign","notEqualsSign","greaterThanSign","lessThanSign","greaterThanOrEqualToSign","lessThanOrEqualSign","fractionExpressionInNumerator","fractionExcludingExpression","customExponent","square","cube","squareRoot","cubeRoot","radicalWithCustomRoot","leftParenthesis","rightParenthesis","naturalLog","logBase10","logCustomBase","sine","sin","cosine","cos","tangent","tan","pi","theta","upArrow","rightArrow","downArrow","leftArrow","navOutOfParentheses","navOutOfExponent","navOutOfBase","navIntoNumerator","navOutOfNumeratorIntoDenominator","navOutOfDenominator","delete","dismiss","mockStrings","obj","beginning of","end of","label","value"],"mappings":"AAAA;AACA;AACA;;AAmEA;AACA;AACA;AACA;AACO,MAAMA,OAKZ,GAAG;AACAC,EAAAA,YAAY,EAAE,gBAAgB;AAC9BC,EAAAA,SAAS,EAAE,8CAA8C;AACzDC,EAAAA,MAAM,EAAE,gBAAgB;AACxBC,EAAAA,KAAK,EAAE,eAAe;AACtB,EAAA,cAAc,EAAE,sBAAsB;AACtC,EAAA,QAAQ,EAAE,gBAAgB;AAC1BC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,QAAQ,EAAE,kBAAkB;AAC5B,EAAA,WAAW,EAAE,WAAW;AACxB,EAAA,kBAAkB,EAAE,kBAAkB;AACtC,EAAA,sBAAsB,EAAE,sBAAsB;AAC9C,EAAA,qBAAqB,EAAE,qBAAqB;AAC5C,EAAA,gBAAgB,EAAE,gBAAgB;AAClC,EAAA,eAAe,EAAE,eAAe;AAChCC,EAAAA,UAAU,EAAE,sBAAsB;AAClCC,EAAAA,IAAI,EAAE;AACFC,IAAAA,OAAO,EAAE,4BAA4B;AACrCC,IAAAA,OAAO,EAAE;GACZ;AACDC,EAAAA,KAAK,EAAE;AAACF,IAAAA,OAAO,EAAE,6BAA6B;AAAEC,IAAAA,OAAO,EAAE;GAAQ;AACjEE,EAAAA,QAAQ,EAAE;AAACH,IAAAA,OAAO,EAAE,gCAAgC;AAAEC,IAAAA,OAAO,EAAE;GAAW;AAC1EG,EAAAA,KAAK,EAAE;AAACJ,IAAAA,OAAO,EAAE,gCA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require('@khanacademy/wonder-blocks-timing');
|
|
20
20
|
var PropTypes = require('prop-types');
|
|
21
21
|
|
|
22
|
-
function
|
|
22
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
23
23
|
|
|
24
|
-
function
|
|
25
|
-
if (e && e
|
|
24
|
+
function _interopNamespaceCompat(e) {
|
|
25
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
26
26
|
var n = Object.create(null);
|
|
27
27
|
if (e) {
|
|
28
28
|
Object.keys(e).forEach(function (k) {
|
|
@@ -35,20 +35,23 @@ function _interopNamespace(e) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
n
|
|
38
|
+
n.default = e;
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var _extends__default = /*#__PURE__*/
|
|
43
|
-
var React__namespace = /*#__PURE__*/
|
|
44
|
-
var ReactDOM__default = /*#__PURE__*/
|
|
45
|
-
var MathQuill__default = /*#__PURE__*/
|
|
46
|
-
var Clickable__default = /*#__PURE__*/
|
|
47
|
-
var PropTypes__default = /*#__PURE__*/
|
|
42
|
+
var _extends__default = /*#__PURE__*/_interopDefaultCompat(_extends);
|
|
43
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
44
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultCompat(ReactDOM);
|
|
45
|
+
var MathQuill__default = /*#__PURE__*/_interopDefaultCompat(MathQuill);
|
|
46
|
+
var Clickable__default = /*#__PURE__*/_interopDefaultCompat(Clickable);
|
|
47
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultCompat(PropTypes);
|
|
48
48
|
|
|
49
49
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
50
|
+
// version number during the release build.
|
|
51
|
+
// In dev, you'll never see the version number.
|
|
52
|
+
|
|
50
53
|
const libName = "@khanacademy/math-input";
|
|
51
|
-
const libVersion = "
|
|
54
|
+
const libVersion = "25.0.0";
|
|
52
55
|
perseusUtils.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
53
56
|
|
|
54
57
|
class View extends React__namespace.Component {
|
|
@@ -105,6 +108,7 @@ class View extends React__namespace.Component {
|
|
|
105
108
|
* The translated strings that are used to render the Math Input.
|
|
106
109
|
*/
|
|
107
110
|
|
|
111
|
+
|
|
108
112
|
/**
|
|
109
113
|
* Mock strings for the Math Input package, to be used for tests and Storybook.
|
|
110
114
|
*/
|
|
@@ -248,6 +252,7 @@ const cursorHandleDistanceMultiplier = 1.045;
|
|
|
248
252
|
/**
|
|
249
253
|
* Renders the green tear-shaped handle under the cursor.
|
|
250
254
|
*/
|
|
255
|
+
|
|
251
256
|
const touchTargetRadiusPx = 2 * cursorHandleRadiusPx;
|
|
252
257
|
const touchTargetHeightPx = 2 * touchTargetRadiusPx;
|
|
253
258
|
const touchTargetWidthPx = 2 * touchTargetRadiusPx;
|
|
@@ -277,7 +282,7 @@ class CursorHandle extends React__namespace.Component {
|
|
|
277
282
|
// This is essentially webapp's interactiveComponent + 1.
|
|
278
283
|
// TODO(charlie): Pull in those styles somehow to avoid breakages.
|
|
279
284
|
zIndex: 4,
|
|
280
|
-
left: -
|
|
285
|
+
left: -44 / 2,
|
|
281
286
|
top: 0,
|
|
282
287
|
transform: transformString,
|
|
283
288
|
width: touchTargetWidthPx,
|
|
@@ -474,7 +479,7 @@ const inJest = typeof process !== "undefined" && !!process?.env?.JEST_WORKER_ID;
|
|
|
474
479
|
|
|
475
480
|
// We only need one MathQuill instance (referred to as MQ in the docs)
|
|
476
481
|
// and that contains some MQ constants and the MathField constructor
|
|
477
|
-
const mathQuillInstance = MathQuill__default
|
|
482
|
+
const mathQuillInstance = MathQuill__default.default.getInterface(3);
|
|
478
483
|
const createBaseConfig = () => ({
|
|
479
484
|
// LaTeX commands that, when typed, are immediately replaced by the
|
|
480
485
|
// appropriate symbol. This does not include ln, log, or any of the
|
|
@@ -742,6 +747,7 @@ function getCursorContext(mathField) {
|
|
|
742
747
|
|
|
743
748
|
// If that didn't work, check if the parent or grandparent is a special
|
|
744
749
|
// context, so that we can jump outwards.
|
|
750
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
745
751
|
if (isParens(cursor.parent && cursor.parent.parent)) {
|
|
746
752
|
return CursorContext.IN_PARENS;
|
|
747
753
|
} else if (isNumerator(cursor.parent)) {
|
|
@@ -1287,6 +1293,21 @@ const getKeyTranslator = (locale, strings) => ({
|
|
|
1287
1293
|
});
|
|
1288
1294
|
|
|
1289
1295
|
// Notes about MathQuill
|
|
1296
|
+
//
|
|
1297
|
+
// MathQuill's stores its layout as nested linked lists. Each node in the
|
|
1298
|
+
// list has MQ.L '-1' and MQ.R '1' properties that define links to
|
|
1299
|
+
// the left and right nodes respectively. They also have
|
|
1300
|
+
//
|
|
1301
|
+
// ctrlSeq: contains the latex code snippet that defines that node.
|
|
1302
|
+
// jQ: jQuery object for the DOM node(s) for this MathQuill node.
|
|
1303
|
+
// ends: pointers to the nodes at the ends of the container.
|
|
1304
|
+
// parent: parent node.
|
|
1305
|
+
// blocks: an array containing one or more nodes that make up the node.
|
|
1306
|
+
// sub?: subscript node if there is one as is the case in log_n
|
|
1307
|
+
//
|
|
1308
|
+
// All of the code below is super fragile. Please be especially careful
|
|
1309
|
+
// when upgrading MathQuill.
|
|
1310
|
+
|
|
1290
1311
|
/**
|
|
1291
1312
|
* This file contains a wrapper around MathQuill so that we can provide a
|
|
1292
1313
|
* more regular interface for the functionality we need while insulating us
|
|
@@ -1345,6 +1366,8 @@ class MathWrapper {
|
|
|
1345
1366
|
pressKey(key) {
|
|
1346
1367
|
const cursor = this.getCursor();
|
|
1347
1368
|
const translator = this.mobileKeyTranslator[key];
|
|
1369
|
+
|
|
1370
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1348
1371
|
if (translator) {
|
|
1349
1372
|
translator(this.mathField, key);
|
|
1350
1373
|
}
|
|
@@ -1375,7 +1398,10 @@ class MathWrapper {
|
|
|
1375
1398
|
* should be placed
|
|
1376
1399
|
*/
|
|
1377
1400
|
setCursorPosition(x, y, hitNode) {
|
|
1401
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1378
1402
|
const el = hitNode || document.elementFromPoint(x, y);
|
|
1403
|
+
|
|
1404
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1379
1405
|
if (el) {
|
|
1380
1406
|
const cursor = this.getCursor();
|
|
1381
1407
|
if (el.hasAttribute("mq-root-block")) {
|
|
@@ -1541,7 +1567,7 @@ class MathInput extends React__namespace.Component {
|
|
|
1541
1567
|
});
|
|
1542
1568
|
this.mathField.setContent(this.props.value);
|
|
1543
1569
|
this._updateInputPadding();
|
|
1544
|
-
this._container = ReactDOM__default
|
|
1570
|
+
this._container = ReactDOM__default.default.findDOMNode(this);
|
|
1545
1571
|
this._root = this._container.querySelector(".mq-root-block");
|
|
1546
1572
|
this._root.addEventListener("scroll", this._handleScroll);
|
|
1547
1573
|
const isWithinKeypadBounds = (x, y) => {
|
|
@@ -1655,7 +1681,7 @@ class MathInput extends React__namespace.Component {
|
|
|
1655
1681
|
window.removeEventListener("click", this.blurOnClickOutside);
|
|
1656
1682
|
}
|
|
1657
1683
|
_updateInputPadding = () => {
|
|
1658
|
-
this._container = ReactDOM__default
|
|
1684
|
+
this._container = ReactDOM__default.default.findDOMNode(this);
|
|
1659
1685
|
this._root = this._container.querySelector(".mq-root-block");
|
|
1660
1686
|
const padding = this.getInputInnerPadding();
|
|
1661
1687
|
// NOTE(diedra): This overrides the default 2px padding from Mathquil.
|
|
@@ -1838,6 +1864,8 @@ class MathInput extends React__namespace.Component {
|
|
|
1838
1864
|
// @ts-expect-error - TS2531 - Object is possibly 'null'.
|
|
1839
1865
|
const id = element.getAttribute("mathquill-command-id");
|
|
1840
1866
|
if (id != null) {
|
|
1867
|
+
|
|
1868
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
1841
1869
|
counts[id] = (counts[id] || 0) + 1;
|
|
1842
1870
|
elementsById[id] = element;
|
|
1843
1871
|
} else {
|
|
@@ -2282,10 +2310,10 @@ class MathInput extends React__namespace.Component {
|
|
|
2282
2310
|
onKeyUp: this.handleKeyUp
|
|
2283
2311
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
2284
2312
|
ref: node => {
|
|
2285
|
-
this._mathContainer = ReactDOM__default
|
|
2313
|
+
this._mathContainer = ReactDOM__default.default.findDOMNode(node);
|
|
2286
2314
|
},
|
|
2287
2315
|
style: innerStyle
|
|
2288
|
-
})), showInputFocusStyle && handle.visible && /*#__PURE__*/React__namespace.createElement(CursorHandle, _extends__default
|
|
2316
|
+
})), showInputFocusStyle && handle.visible && /*#__PURE__*/React__namespace.createElement(CursorHandle, _extends__default.default({}, handle, {
|
|
2289
2317
|
onTouchStart: this.onCursorHandleTouchStart,
|
|
2290
2318
|
onTouchMove: this.onCursorHandleTouchMove,
|
|
2291
2319
|
onTouchEnd: this.onCursorHandleTouchEnd,
|
|
@@ -2539,7 +2567,7 @@ function TabbarItem(props) {
|
|
|
2539
2567
|
}
|
|
2540
2568
|
return () => clearTimeout(timeout);
|
|
2541
2569
|
}, [role, focus, tabRef]);
|
|
2542
|
-
return /*#__PURE__*/React__namespace.createElement(Clickable__default
|
|
2570
|
+
return /*#__PURE__*/React__namespace.createElement(Clickable__default.default, {
|
|
2543
2571
|
onClick: onClick,
|
|
2544
2572
|
disabled: itemState === "disabled",
|
|
2545
2573
|
"aria-label": itemType,
|
|
@@ -4710,7 +4738,7 @@ const KeypadButton = _ref => {
|
|
|
4710
4738
|
// apart from the ICON SVG, so we need to use testId.
|
|
4711
4739
|
,
|
|
4712
4740
|
testId: keyConfig.id
|
|
4713
|
-
}, /*#__PURE__*/React__namespace.createElement(Clickable__default
|
|
4741
|
+
}, /*#__PURE__*/React__namespace.createElement(Clickable__default.default, {
|
|
4714
4742
|
onClick: e => onClickKey(keyConfig.id, e),
|
|
4715
4743
|
onMouseDown: e =>
|
|
4716
4744
|
// Prevent the default behavior of forcing the focus to the
|
|
@@ -4821,6 +4849,7 @@ const expandedViewThreshold = 500;
|
|
|
4821
4849
|
// based on the cursorContext prop. It is used in the keypad to determine
|
|
4822
4850
|
// which key to render as the "jump out" key.
|
|
4823
4851
|
function getCursorContextConfig(strings, cursorContext) {
|
|
4852
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
4824
4853
|
if (!cursorContext) {
|
|
4825
4854
|
return null;
|
|
4826
4855
|
}
|
|
@@ -5121,7 +5150,7 @@ function NavigationButton(_ref) {
|
|
|
5121
5150
|
gridColumn: coord[0] + 1,
|
|
5122
5151
|
gridRow: coord[1] + 1
|
|
5123
5152
|
}
|
|
5124
|
-
}, /*#__PURE__*/React__namespace.createElement(Clickable__default
|
|
5153
|
+
}, /*#__PURE__*/React__namespace.createElement(Clickable__default.default, {
|
|
5125
5154
|
onClick: e => onClickKey(keyConfig.id, e),
|
|
5126
5155
|
style: styles$3.clickable,
|
|
5127
5156
|
"aria-label": keyConfig.ariaLabel
|
|
@@ -5471,6 +5500,8 @@ const styles$1 = aphrodite.StyleSheet.create({
|
|
|
5471
5500
|
|
|
5472
5501
|
function flatten(list) {
|
|
5473
5502
|
const result = [];
|
|
5503
|
+
|
|
5504
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
5474
5505
|
if (!list) {
|
|
5475
5506
|
return result;
|
|
5476
5507
|
}
|
|
@@ -5486,6 +5517,8 @@ function flatten(list) {
|
|
|
5486
5517
|
function processStyleType(style) {
|
|
5487
5518
|
const stylesheetStyles = [];
|
|
5488
5519
|
const inlineStyles = [];
|
|
5520
|
+
|
|
5521
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
5489
5522
|
if (!style) {
|
|
5490
5523
|
return {
|
|
5491
5524
|
style: {},
|
|
@@ -5620,7 +5653,7 @@ class TransitionChild extends React__namespace.Component {
|
|
|
5620
5653
|
}
|
|
5621
5654
|
};
|
|
5622
5655
|
transition(animationType, duration) {
|
|
5623
|
-
const node = ReactDOM__default
|
|
5656
|
+
const node = ReactDOM__default.default.findDOMNode(this);
|
|
5624
5657
|
if (!(node instanceof Element)) {
|
|
5625
5658
|
return;
|
|
5626
5659
|
}
|
|
@@ -5662,7 +5695,7 @@ class TransitionChild extends React__namespace.Component {
|
|
|
5662
5695
|
}
|
|
5663
5696
|
flushClassNameQueue = () => {
|
|
5664
5697
|
if (this._isMounted) {
|
|
5665
|
-
const node = ReactDOM__default
|
|
5698
|
+
const node = ReactDOM__default.default.findDOMNode(this);
|
|
5666
5699
|
if (node instanceof Element) {
|
|
5667
5700
|
this.classNameQueue.forEach(_ref2 => {
|
|
5668
5701
|
let [removeClassName, addClassName] = _ref2;
|
|
@@ -5830,6 +5863,7 @@ class MobileKeypadInternals extends React__namespace.Component {
|
|
|
5830
5863
|
// callback into `configureKeypad`. However, implementing this properly
|
|
5831
5864
|
// would require middleware, etc., so we just hack it on with
|
|
5832
5865
|
// `setTimeout` for now.
|
|
5866
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
5833
5867
|
setTimeout(() => cb && cb());
|
|
5834
5868
|
};
|
|
5835
5869
|
setCursor = cursor => {
|
|
@@ -5843,7 +5877,7 @@ class MobileKeypadInternals extends React__namespace.Component {
|
|
|
5843
5877
|
});
|
|
5844
5878
|
};
|
|
5845
5879
|
getDOMNode = () => {
|
|
5846
|
-
return ReactDOM__default
|
|
5880
|
+
return ReactDOM__default.default.findDOMNode(this);
|
|
5847
5881
|
};
|
|
5848
5882
|
_handleClickKey(key) {
|
|
5849
5883
|
if (key === "DISMISS") {
|
|
@@ -5926,7 +5960,7 @@ function MobileKeypad(props) {
|
|
|
5926
5960
|
keypadActive,
|
|
5927
5961
|
setKeypadActive
|
|
5928
5962
|
} = _ref;
|
|
5929
|
-
return /*#__PURE__*/React__namespace.createElement(MobileKeypadInternals, _extends__default
|
|
5963
|
+
return /*#__PURE__*/React__namespace.createElement(MobileKeypadInternals, _extends__default.default({}, props, {
|
|
5930
5964
|
keypadActive: keypadActive,
|
|
5931
5965
|
setKeypadActive: setKeypadActive
|
|
5932
5966
|
}));
|
|
@@ -5937,15 +5971,16 @@ function MobileKeypad(props) {
|
|
|
5937
5971
|
* React PropTypes that may be shared between components.
|
|
5938
5972
|
*/
|
|
5939
5973
|
|
|
5974
|
+
|
|
5940
5975
|
// NOTE(jared): This is no longer guaranteed to be React element
|
|
5941
5976
|
// @deprecated Use `KeypadAPI` Typescript interface instead.
|
|
5942
|
-
const keypadElementPropType = PropTypes__default
|
|
5943
|
-
activate: PropTypes__default
|
|
5944
|
-
dismiss: PropTypes__default
|
|
5945
|
-
configure: PropTypes__default
|
|
5946
|
-
setCursor: PropTypes__default
|
|
5947
|
-
setKeyHandler: PropTypes__default
|
|
5948
|
-
getDOMNode: PropTypes__default
|
|
5977
|
+
const keypadElementPropType = PropTypes__default.default.shape({
|
|
5978
|
+
activate: PropTypes__default.default.func.isRequired,
|
|
5979
|
+
dismiss: PropTypes__default.default.func.isRequired,
|
|
5980
|
+
configure: PropTypes__default.default.func.isRequired,
|
|
5981
|
+
setCursor: PropTypes__default.default.func.isRequired,
|
|
5982
|
+
setKeyHandler: PropTypes__default.default.func.isRequired,
|
|
5983
|
+
getDOMNode: PropTypes__default.default.func.isRequired
|
|
5949
5984
|
});
|
|
5950
5985
|
|
|
5951
5986
|
exports.CursorContext = CursorContext;
|