@khanacademy/perseus 13.2.0 → 15.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/CHANGELOG.md +47 -0
- package/dist/article-renderer.d.ts +1 -2
- package/dist/components/svg-image.d.ts +10 -9
- package/dist/es/index.js +51 -498
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +72 -511
- package/dist/index.js.map +1 -1
- package/dist/multi-items/item-types.d.ts +1 -1
- package/dist/multi-items/multi-renderer.d.ts +2 -2
- package/dist/perseus-api.d.ts +0 -3
- package/dist/server-item-renderer.d.ts +2 -15
- package/dist/strings.js +1 -0
- package/dist/styles/shared.d.ts +1 -0
- package/dist/types.d.ts +0 -2
- package/dist/util/a11y.d.ts +1 -0
- package/dist/widgets/expression.d.ts +0 -12
- package/dist/widgets/graded-group.d.ts +1 -1
- package/dist/widgets/label-image.d.ts +1 -1
- package/dist/widgets/matcher.d.ts +0 -1
- package/dist/widgets/passage.d.ts +1 -1
- package/dist/widgets/radio/widget.d.ts +1 -1
- package/dist/widgets/simulator.d.ts +0 -1
- package/dist/widgets/sorter.d.ts +0 -1
- package/package.json +8 -8
- package/src/__stories__/server-item-renderer.stories.tsx +1 -1
- package/src/__testdata__/server-item-renderer.testdata.ts +160 -0
- package/src/__tests__/article-renderer.test.tsx +2 -3
- package/src/__tests__/server-item-renderer.test.tsx +2 -2
- package/src/article-renderer.tsx +13 -15
- package/src/components/graph.tsx +14 -8
- package/src/components/svg-image.tsx +14 -12
- package/src/hints-renderer.tsx +1 -0
- package/src/index.ts +0 -1
- package/src/multi-items/item-types.ts +1 -1
- package/src/multi-items/multi-renderer.tsx +4 -4
- package/src/perseus-api.tsx +0 -6
- package/src/perseus-types.ts +8 -3
- package/src/server-item-renderer.tsx +12 -13
- package/src/types.ts +0 -5
- package/src/util.ts +1 -1
- package/src/widgets/__stories__/expression.stories.tsx +0 -1
- package/src/widgets/__stories__/random-widgets.stories.tsx +59 -0
- package/src/widgets/__stories__/test-keypad-context-wrapper.tsx +0 -1
- package/src/widgets/__testdata__/categorizer.testdata.ts +40 -0
- package/src/widgets/__testdata__/dropdown.testdata.ts +38 -0
- package/src/widgets/__testdata__/explanation.testdata.ts +30 -0
- package/src/widgets/__testdata__/expression.testdata.ts +82 -0
- package/src/widgets/__testdata__/interactive-graph-random.testdata.ts +269 -0
- package/src/widgets/__testdata__/radio.testdata.ts +63 -0
- package/src/widgets/__testdata__/randomizers.ts +51 -0
- package/src/widgets/__tests__/expression-mobile.test.tsx +0 -2
- package/src/widgets/__tests__/expression.test.tsx +4 -15
- package/src/widgets/__tests__/randomizers.test.ts +53 -0
- package/src/widgets/expression.tsx +1 -5
- package/src/widgets/graded-group.tsx +1 -1
- package/src/widgets/image.tsx +27 -20
- package/src/widgets/label-image/strings.ts +3 -1
- package/src/widgets/label-image.tsx +2 -2
- package/src/widgets/passage-ref.tsx +1 -1
- package/src/widgets/passage.tsx +1 -1
- package/src/widgets/radio/widget.tsx +1 -1
- package/src/widgets/radio.ts +1 -1
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/item-renderer.d.ts +0 -125
- package/dist/mixins/provide-keypad.d.ts +0 -39
- package/src/__stories__/item-renderer.stories.tsx +0 -30
- package/src/__testdata__/item-renderer.testdata.ts +0 -299
- package/src/__tests__/__snapshots__/item-renderer.test.tsx.snap +0 -224
- package/src/__tests__/item-renderer.test.tsx +0 -930
- package/src/item-renderer.tsx +0 -529
- package/src/mixins/provide-keypad.tsx +0 -138
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @khanacademy/perseus
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#833](https://github.com/Khan/perseus/pull/833) [`3cf5ac4c`](https://github.com/Khan/perseus/commit/3cf5ac4c3f9d51dbcddc6f75bfbf0f8778b20f78) Thanks [@handeyeco](https://github.com/handeyeco)! - Remove export of ItemRenderer
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- [#794](https://github.com/Khan/perseus/pull/794) [`a91c84fe`](https://github.com/Khan/perseus/commit/a91c84fe53827ff4333220777a9918882b7fe9f0) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Removing the useV2Keypad apiOption as the V1 keypad is no longer in use.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#839](https://github.com/Khan/perseus/pull/839) [`3e176246`](https://github.com/Khan/perseus/commit/3e176246025ba237682569481dd9960f7a0dabf4) Thanks [@nedredmond](https://github.com/nedredmond)! - Wrap string in internationalization function
|
|
16
|
+
|
|
17
|
+
* [#814](https://github.com/Khan/perseus/pull/814) [`105d2060`](https://github.com/Khan/perseus/commit/105d20603d935d35cff237b17f0bfb57ca751e4c) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Minor build change to how we provide Typescript type definitions (should be no change to build output).
|
|
18
|
+
|
|
19
|
+
* Updated dependencies [[`a91c84fe`](https://github.com/Khan/perseus/commit/a91c84fe53827ff4333220777a9918882b7fe9f0), [`105d2060`](https://github.com/Khan/perseus/commit/105d20603d935d35cff237b17f0bfb57ca751e4c)]:
|
|
20
|
+
- @khanacademy/math-input@16.1.0
|
|
21
|
+
- @khanacademy/perseus-core@1.4.0
|
|
22
|
+
- @khanacademy/kas@0.3.6
|
|
23
|
+
- @khanacademy/kmath@0.1.7
|
|
24
|
+
- @khanacademy/perseus-linter@0.3.9
|
|
25
|
+
- @khanacademy/pure-markdown@0.2.12
|
|
26
|
+
- @khanacademy/simple-markdown@0.11.1
|
|
27
|
+
|
|
28
|
+
## 14.0.0
|
|
29
|
+
|
|
30
|
+
### Major Changes
|
|
31
|
+
|
|
32
|
+
- [#825](https://github.com/Khan/perseus/pull/825) [`7cb40e4c`](https://github.com/Khan/perseus/commit/7cb40e4c919be50e5ced41e4937178bbf849ec74) Thanks [@benchristel](https://github.com/benchristel)! - We've removed the deprecated `useV2Keypad` prop from the MobileKeypad component.
|
|
33
|
+
|
|
34
|
+
The V2 keypad is now the default, and the old keypad has been removed.
|
|
35
|
+
|
|
36
|
+
Additionally, the mobile keypad no longer accepts the `keypadActive` or
|
|
37
|
+
`setKeypadActive` props. It now gets those values itself from the `KeypadContext`.
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- [#816](https://github.com/Khan/perseus/pull/816) [`cdcd162e`](https://github.com/Khan/perseus/commit/cdcd162ea0902d3ff1d77b1b66ad15f2d55a86cd) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Wrap all SvgImage instances in AssetContext (ensures that host applications can correctly wait for all images to load in a renderer before proceeding).
|
|
42
|
+
|
|
43
|
+
* [#788](https://github.com/Khan/perseus/pull/788) [`8f1f0208`](https://github.com/Khan/perseus/commit/8f1f0208fcc08e137053bfd05d330b6f8bf3522d) Thanks [@jeanettehead](https://github.com/jeanettehead)! - create randomized storybook stories for some widgets
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`7cb40e4c`](https://github.com/Khan/perseus/commit/7cb40e4c919be50e5ced41e4937178bbf849ec74)]:
|
|
48
|
+
- @khanacademy/math-input@16.0.0
|
|
49
|
+
|
|
3
50
|
## 13.2.0
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { DependenciesContext } from "./dependencies";
|
|
7
7
|
import Renderer from "./renderer";
|
|
8
|
-
import type { KeypadProps } from "./mixins/provide-keypad";
|
|
9
8
|
import type { PerseusRenderer } from "./perseus-types";
|
|
10
9
|
import type { APIOptions, PerseusDependenciesV2 } from "./types";
|
|
11
10
|
import type { KeypadAPI } from "@khanacademy/math-input";
|
|
12
11
|
import type { KeypadContextRendererInterface } from "@khanacademy/perseus-core";
|
|
13
12
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
14
|
-
type Props = Partial<React.ContextType<typeof DependenciesContext>> &
|
|
13
|
+
type Props = Partial<React.ContextType<typeof DependenciesContext>> & {
|
|
15
14
|
apiOptions: APIOptions;
|
|
16
15
|
json: PerseusRenderer | ReadonlyArray<PerseusRenderer>;
|
|
17
16
|
/**
|
|
@@ -24,6 +24,15 @@ type Props = {
|
|
|
24
24
|
zoomToFullSizeOnMobile?: boolean;
|
|
25
25
|
setAssetStatus: (assetKey: string, loaded: boolean) => void;
|
|
26
26
|
};
|
|
27
|
+
type DefaultProps = {
|
|
28
|
+
constrainHeight: NonNullable<Props["constrainHeight"]>;
|
|
29
|
+
onUpdate: NonNullable<Props["onUpdate"]>;
|
|
30
|
+
responsive: NonNullable<Props["responsive"]>;
|
|
31
|
+
scale: NonNullable<Props["scale"]>;
|
|
32
|
+
setAssetStatus: NonNullable<Props["setAssetStatus"]>;
|
|
33
|
+
src: NonNullable<Props["src"]>;
|
|
34
|
+
zoomToFullSizeOnMobile: NonNullable<Props["zoomToFullSizeOnMobile"]>;
|
|
35
|
+
};
|
|
27
36
|
type Label = {
|
|
28
37
|
coordinates: ReadonlyArray<any>;
|
|
29
38
|
content: string;
|
|
@@ -44,15 +53,7 @@ type State = {
|
|
|
44
53
|
};
|
|
45
54
|
declare class SvgImage extends React.Component<Props, State> {
|
|
46
55
|
_isMounted: boolean;
|
|
47
|
-
static defaultProps:
|
|
48
|
-
constrainHeight: boolean;
|
|
49
|
-
onUpdate: () => void;
|
|
50
|
-
responsive: boolean;
|
|
51
|
-
scale: number;
|
|
52
|
-
setAssetStatus: (src: string, status: boolean) => void;
|
|
53
|
-
src: string;
|
|
54
|
-
zoomToFullSizeOnMobile: boolean;
|
|
55
|
-
};
|
|
56
|
+
static defaultProps: DefaultProps;
|
|
56
57
|
constructor(props: Props);
|
|
57
58
|
componentDidMount(): void;
|
|
58
59
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|