Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into expr-widget-hackathon
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinb-khan committed Nov 1, 2024
2 parents b8b9f9d + 035191c commit 0f3349d
Show file tree
Hide file tree
Showing 170 changed files with 2,877 additions and 2,467 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-gorillas-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Internal: Refactor interactive graph components to support whole-graph screenreader descriptions
6 changes: 6 additions & 0 deletions .changeset/old-lamps-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/math-input": patch
"@khanacademy/perseus": patch
---

Improve prop types for various components
5 changes: 0 additions & 5 deletions .changeset/perfect-guests-raise.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/rude-spies-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Wraps a text node in a `span` to reduce bugs caused by Google Translate
5 changes: 5 additions & 0 deletions .changeset/wise-keys-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": minor
---

Add a screenreader-accessible label to movable points on interactive graphs
24 changes: 24 additions & 0 deletions dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @khanacademy/perseus-dev-ui

## 3.1.0

### Minor Changes

- [#1764](https://github.com/Khan/perseus/pull/1764) [`c2e678e5c`](https://github.com/Khan/perseus/commit/c2e678e5c109a8e0161907fea54aacb572e16bb3) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Adding new interactive graph type "unlimited-points" for mafs.

### Patch Changes

- Updated dependencies [[`14d0764e4`](https://github.com/Khan/perseus/commit/14d0764e4498dae81921a91e5202291461b52374), [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484)]:
- @khanacademy/perseus-linter@1.2.4
- @khanacademy/kas@0.3.16
- @khanacademy/kmath@0.1.16
- @khanacademy/math-input@21.1.3
- @khanacademy/perseus-core@1.5.3
- @khanacademy/pure-markdown@0.3.11
- @khanacademy/simple-markdown@0.13.4

## 3.0.11

### Patch Changes

- Updated dependencies [[`f3139edfe`](https://github.com/Khan/perseus/commit/f3139edfeb5f8b6faf0e537961165e3d3499c30b)]:
- @khanacademy/math-input@21.1.2

## 3.0.10

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions dev/gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const questions: [PerseusRenderer, number][] = pairWithIndices([
interactiveGraph.polygonWithAnglesAndFourSidesQuestion,
interactiveGraph.polygonWithFourSidesSnappingQuestion,
interactiveGraph.polygonWithAnglesAndAnglesSnapToQuestion,
interactiveGraph.polygonWithUnlimitedSidesQuestion,
interactiveGraph.rayQuestion,
interactiveGraph.sinusoidQuestion,
interactiveGraph.noneQuestion,
Expand Down
16 changes: 8 additions & 8 deletions dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Perseus dev UI",
"author": "Khan Academy",
"license": "MIT",
"version": "3.0.10",
"version": "3.1.0",
"private": true,
"repository": {
"type": "git",
Expand All @@ -14,13 +14,13 @@
"dev": "vite"
},
"dependencies": {
"@khanacademy/kas": "^0.3.15",
"@khanacademy/kmath": "^0.1.15",
"@khanacademy/math-input": "^21.1.1",
"@khanacademy/perseus-core": "1.5.2",
"@khanacademy/perseus-linter": "^1.2.3",
"@khanacademy/pure-markdown": "^0.3.10",
"@khanacademy/simple-markdown": "^0.13.3",
"@khanacademy/kas": "^0.3.16",
"@khanacademy/kmath": "^0.1.16",
"@khanacademy/math-input": "^21.1.3",
"@khanacademy/perseus-core": "1.5.3",
"@khanacademy/perseus-linter": "^1.2.4",
"@khanacademy/pure-markdown": "^0.3.11",
"@khanacademy/simple-markdown": "^0.13.4",
"@khanacademy/wonder-blocks-banner": "3.1.7",
"@khanacademy/wonder-blocks-icon": "4.1.3",
"@khanacademy/wonder-blocks-icon-button": "5.3.4",
Expand Down
5 changes: 4 additions & 1 deletion packages/kas/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
rules: {
"import/no-extraneous-dependencies": [
"error",
{packageDir: [__dirname, path.join(__dirname, "../../")]},
{
packageDir: [__dirname, path.join(__dirname, "../../")],
includeTypes: true,
},
],
},
};
9 changes: 9 additions & 0 deletions packages/kas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @khanacademy/kas

## 0.3.16

### Patch Changes

- [#1791](https://github.com/Khan/perseus/pull/1791) [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484) Thanks [@handeyeco](https://github.com/handeyeco)! - Check types for import/no-extraneous-dependencies eslint check

- Updated dependencies [[`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484)]:
- @khanacademy/perseus-core@1.5.3

## 0.3.15

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/kas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A lightweight JavaScript CAS for comparing expressions and equations.",
"author": "Khan Academy",
"license": "MIT",
"version": "0.3.15",
"version": "0.3.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -26,7 +26,7 @@
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
},
"dependencies": {
"@khanacademy/perseus-core": "1.5.2"
"@khanacademy/perseus-core": "1.5.3"
},
"devDependencies": {
"jison": "0.4.15",
Expand Down
5 changes: 4 additions & 1 deletion packages/keypad-context/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
rules: {
"import/no-extraneous-dependencies": [
"error",
{packageDir: [__dirname, path.join(__dirname, "../../")]},
{
packageDir: [__dirname, path.join(__dirname, "../../")],
includeTypes: true,
},
],
},
};
9 changes: 9 additions & 0 deletions packages/keypad-context/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @khanacademy/keypad-context

## 1.0.4

### Patch Changes

- [#1791](https://github.com/Khan/perseus/pull/1791) [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484) Thanks [@handeyeco](https://github.com/handeyeco)! - Check types for import/no-extraneous-dependencies eslint check

- Updated dependencies [[`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484)]:
- @khanacademy/perseus-core@1.5.3

## 1.0.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/keypad-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Perseus keypad context",
"author": "Khan Academy",
"license": "MIT",
"version": "1.0.3",
"version": "1.0.4",
"publishConfig": {
"access": "public"
},
Expand All @@ -25,7 +25,7 @@
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
},
"dependencies": {
"@khanacademy/perseus-core": "1.5.2"
"@khanacademy/perseus-core": "1.5.3"
},
"devDependencies": {
"react": "^18.2.0"
Expand Down
5 changes: 4 additions & 1 deletion packages/kmath/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
rules: {
"import/no-extraneous-dependencies": [
"error",
{packageDir: [__dirname, path.join(__dirname, "../../")]},
{
packageDir: [__dirname, path.join(__dirname, "../../")],
includeTypes: true,
},
],
},
};
9 changes: 9 additions & 0 deletions packages/kmath/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @khanacademy/kmath

## 0.1.16

### Patch Changes

- [#1791](https://github.com/Khan/perseus/pull/1791) [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484) Thanks [@handeyeco](https://github.com/handeyeco)! - Check types for import/no-extraneous-dependencies eslint check

- Updated dependencies [[`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484)]:
- @khanacademy/perseus-core@1.5.3

## 0.1.15

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/kmath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Khan Academy's Javascript Numeric Math Utilities",
"author": "Khan Academy",
"license": "MIT",
"version": "0.1.15",
"version": "0.1.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -24,7 +24,7 @@
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
},
"dependencies": {
"@khanacademy/perseus-core": "1.5.2"
"@khanacademy/perseus-core": "1.5.3"
},
"devDependencies": {
"perseus-build-settings": "^0.4.1",
Expand Down
1 change: 1 addition & 0 deletions packages/math-input/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
// it's right so I made a ticket to circle back to it
// https://khanacademy.atlassian.net/browse/LC-864
devDependencies: ["**/*.stories.tsx", "**/*.test.tsx"],
includeTypes: true,
},
],
},
Expand Down
16 changes: 16 additions & 0 deletions packages/math-input/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @khanacademy/math-input

## 21.1.3

### Patch Changes

- [#1791](https://github.com/Khan/perseus/pull/1791) [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484) Thanks [@handeyeco](https://github.com/handeyeco)! - Check types for import/no-extraneous-dependencies eslint check

- Updated dependencies [[`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484)]:
- @khanacademy/keypad-context@1.0.4
- @khanacademy/perseus-core@1.5.3

## 21.1.2

### Patch Changes

- [#1799](https://github.com/Khan/perseus/pull/1799) [`f3139edfe`](https://github.com/Khan/perseus/commit/f3139edfeb5f8b6faf0e537961165e3d3499c30b) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Change functional components to use default parameters instead of deprecated 'defaultProps'

## 21.1.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/math-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Khan Academy's new expression editor for the mobile web.",
"author": "Khan Academy",
"license": "MIT",
"version": "21.1.1",
"version": "21.1.3",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -38,8 +38,8 @@
],
"scripts": {},
"dependencies": {
"@khanacademy/keypad-context": "^1.0.3",
"@khanacademy/perseus-core": "1.5.2",
"@khanacademy/keypad-context": "^1.0.4",
"@khanacademy/perseus-core": "1.5.3",
"mathquill": "https://github.com/Khan/mathquill/releases/download/v1.0.0/mathquill-v1.0.0.tgz"
},
"devDependencies": {
Expand Down
13 changes: 3 additions & 10 deletions packages/math-input/src/components/keypad/keypad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {CursorContext} from "../input/cursor-contexts";
import type {AnalyticsEventHandlerFn} from "@khanacademy/perseus-core";

export type Props = {
extraKeys: ReadonlyArray<Key>;
extraKeys?: ReadonlyArray<Key>;
cursorContext?: (typeof CursorContext)[keyof typeof CursorContext];
showDismiss?: boolean;
expandedView?: boolean;
Expand All @@ -39,10 +39,6 @@ export type Props = {
onAnalyticsEvent: AnalyticsEventHandlerFn;
};

const defaultProps = {
extraKeys: [],
};

function getAvailableTabs(props: Props): ReadonlyArray<KeypadPageType> {
// We don't want to show any available tabs on the fractions keypad
if (props.fractionsOnly) {
Expand Down Expand Up @@ -73,7 +69,7 @@ function getAvailableTabs(props: Props): ReadonlyArray<KeypadPageType> {

// The main (v2) Keypad. Use this component to present an accessible, onscreen
// keypad to learners for entering math expressions.
export default function Keypad(props: Props) {
export default function Keypad({extraKeys = [], ...props}: Props) {
// If we're using the Fractions keypad, we want to default select that page
// Otherwise, we want to default to the Numbers page
const defaultSelectedPage = props.fractionsOnly ? "Fractions" : "Numbers";
Expand All @@ -82,12 +78,11 @@ export default function Keypad(props: Props) {
const [isMounted, setIsMounted] = React.useState<boolean>(false);

// We don't want any tabs available on mobile fractions keypad
const availableTabs = getAvailableTabs(props);
const availableTabs = getAvailableTabs({...props, extraKeys});

const {
onClickKey,
cursorContext,
extraKeys,
convertDotToTimes,
divisionKey,
preAlgebra,
Expand Down Expand Up @@ -197,8 +192,6 @@ export default function Keypad(props: Props) {
);
}

Keypad.defaultProps = defaultProps;

const styles = StyleSheet.create({
keypadOuterContainer: {
display: "flex",
Expand Down
5 changes: 4 additions & 1 deletion packages/perseus-core/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
rules: {
"import/no-extraneous-dependencies": [
"error",
{packageDir: [__dirname, path.join(__dirname, "../../")]},
{
packageDir: [__dirname, path.join(__dirname, "../../")],
includeTypes: true,
},
],
},
};
6 changes: 6 additions & 0 deletions packages/perseus-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @khanacademy/perseus-core

## 1.5.3

### Patch Changes

- [#1791](https://github.com/Khan/perseus/pull/1791) [`b119147fc`](https://github.com/Khan/perseus/commit/b119147fc042bf71193d61f9cea99b5f3d73b484) Thanks [@handeyeco](https://github.com/handeyeco)! - Check types for import/no-extraneous-dependencies eslint check

## 1.5.2

### Patch Changes
Expand Down
6 changes: 4 additions & 2 deletions packages/perseus-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Shared Perseus infrastructure",
"author": "Khan Academy",
"license": "MIT",
"version": "1.5.2",
"version": "1.5.3",
"publishConfig": {
"access": "public"
},
Expand All @@ -25,7 +25,9 @@
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
},
"dependencies": {},
"devDependencies": {},
"devDependencies": {
"@khanacademy/wonder-stuff-core": "1.5.2"
},
"peerDependencies": {},
"keywords": []
}
5 changes: 4 additions & 1 deletion packages/perseus-editor/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module.exports = {
rules: {
"import/no-extraneous-dependencies": [
"error",
{packageDir: [__dirname, path.join(__dirname, "../../")]},
{
packageDir: [__dirname, path.join(__dirname, "../../")],
includeTypes: true,
},
],
},
};
Loading

0 comments on commit 0f3349d

Please sign in to comment.