@khanacademy/perseus 11.6.0 → 11.6.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/CHANGELOG.md +17 -0
- package/dist/es/index.js +513 -510
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.js +527 -523
- package/dist/index.js.map +1 -1
- package/dist/item-renderer.d.ts +3 -0
- package/dist/perseus-version.d.ts +8 -0
- package/dist/version.d.ts +1 -11
- package/package.json +9 -9
- package/src/components/__stories__/graphie.stories.tsx +2 -2
- package/src/index.ts +2 -5
- package/src/item-renderer.tsx +3 -0
- package/src/item-version.ts +2 -2
- package/src/perseus-version.ts +9 -0
- package/src/version.ts +9 -10
- package/src/widgets/__stories__/expression.stories.tsx +21 -10
- package/tsconfig-build.json +1 -0
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/item-renderer.d.ts
CHANGED
|
@@ -47,6 +47,9 @@ type SerializedState = {
|
|
|
47
47
|
[id: string]: any;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* @depreciated use ServerItemRenderer
|
|
52
|
+
*/
|
|
50
53
|
declare class ItemRenderer extends React.Component<Props, State> {
|
|
51
54
|
questionRenderer: Renderer;
|
|
52
55
|
hintsRenderer: React.ElementRef<typeof HintsRenderer> | null | undefined;
|
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "11.6.
|
|
6
|
+
"version": "11.6.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@khanacademy/kas": "^0.3.
|
|
26
|
-
"@khanacademy/kmath": "^0.1.
|
|
27
|
-
"@khanacademy/math-input": "^14.0.
|
|
28
|
-
"@khanacademy/perseus-core": "1.1.
|
|
29
|
-
"@khanacademy/perseus-linter": "^0.3.
|
|
30
|
-
"@khanacademy/pure-markdown": "^0.2.
|
|
31
|
-
"@khanacademy/simple-markdown": "^0.10.
|
|
25
|
+
"@khanacademy/kas": "^0.3.2",
|
|
26
|
+
"@khanacademy/kmath": "^0.1.3",
|
|
27
|
+
"@khanacademy/math-input": "^14.0.1",
|
|
28
|
+
"@khanacademy/perseus-core": "1.1.1",
|
|
29
|
+
"@khanacademy/perseus-linter": "^0.3.5",
|
|
30
|
+
"@khanacademy/pure-markdown": "^0.2.7",
|
|
31
|
+
"@khanacademy/simple-markdown": "^0.10.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@khanacademy/wonder-blocks-button": "^4.1.3",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"katex": "^0.11.1",
|
|
59
59
|
"lodash.debounce": "^4.0.8",
|
|
60
60
|
"mathquill": "git+https://git@github.com/Khan/mathquill.git#32d9f351aaa68537170b3120a52e99b8def3a2c3",
|
|
61
|
-
"perseus-build-settings": "^0.2.
|
|
61
|
+
"perseus-build-settings": "^0.2.1",
|
|
62
62
|
"prop-types": "^15.6.1",
|
|
63
63
|
"react": "16.14.0",
|
|
64
64
|
"react-dom": "16.14.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {ServerItemRendererWithDebugUI} from "../../../../../testing/server-item-renderer-with-debug-ui";
|
|
4
4
|
import {itemWithPieChart} from "../../__testdata__/graphie.testdata";
|
|
5
5
|
import Graphie from "../graphie";
|
|
6
6
|
|
|
@@ -29,5 +29,5 @@ export const SquareBoxSizeAndOtherwiseEmpty = (
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export const PieChartGraphieLabels = (args: StoryArgs): React.ReactElement => {
|
|
32
|
-
return <
|
|
32
|
+
return <ServerItemRendererWithDebugUI item={itemWithPieChart} />;
|
|
33
33
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
2
1
|
/**
|
|
3
2
|
* Main entry point
|
|
4
3
|
*/
|
|
5
4
|
|
|
6
|
-
import version from "./version";
|
|
7
|
-
|
|
8
5
|
export {default as init} from "./init";
|
|
9
6
|
|
|
10
7
|
export {ApiOptions, ClassNames} from "./perseus-api";
|
|
11
8
|
|
|
12
|
-
export
|
|
13
|
-
export
|
|
9
|
+
export {libVersion} from "./version";
|
|
10
|
+
export {apiVersion, itemDataVersion} from "./perseus-version";
|
|
14
11
|
export {default as itemVersion} from "./item-version";
|
|
15
12
|
|
|
16
13
|
/**
|
package/src/item-renderer.tsx
CHANGED
|
@@ -76,6 +76,9 @@ type SerializedState = {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @depreciated use ServerItemRenderer
|
|
81
|
+
*/
|
|
79
82
|
class ItemRenderer extends React.Component<Props, State> {
|
|
80
83
|
// @ts-expect-error - TS2564 - Property 'questionRenderer' has no initializer and is not definitely assigned in the constructor.
|
|
81
84
|
questionRenderer: Renderer;
|
package/src/item-version.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import allWidgets from "./all-widgets";
|
|
2
|
-
import
|
|
2
|
+
import {itemDataVersion} from "./perseus-version";
|
|
3
3
|
import * as Widgets from "./widgets";
|
|
4
4
|
|
|
5
5
|
Widgets.registerWidgets(allWidgets);
|
|
6
6
|
|
|
7
7
|
const ItemVersion = Widgets.getVersionVector();
|
|
8
|
-
ItemVersion["::renderer::"] =
|
|
8
|
+
ItemVersion["::renderer::"] = itemDataVersion;
|
|
9
9
|
|
|
10
10
|
export default ItemVersion;
|
package/src/version.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
minor: 0,
|
|
5
|
-
},
|
|
1
|
+
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
2
|
+
// version number during the release build.
|
|
3
|
+
// In dev, you'll never see the version number.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import {addLibraryVersionToPerseusDebug} from "@khanacademy/perseus-core";
|
|
6
|
+
|
|
7
|
+
const libName = "@khanacademy/perseus";
|
|
8
|
+
export const libVersion = "__lib_version__";
|
|
9
|
+
|
|
10
|
+
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {KeypadContext, KeypadType} from "@khanacademy/math-input";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {ServerItemRendererWithDebugUI} from "../../../../../testing/server-item-renderer-with-debug-ui";
|
|
5
5
|
import {
|
|
6
6
|
expressionItem2,
|
|
7
7
|
expressionItem3,
|
|
@@ -25,20 +25,27 @@ type Story = {
|
|
|
25
25
|
type WrappedKeypadContextProps = {
|
|
26
26
|
item: PerseusItem;
|
|
27
27
|
customKeypad: boolean;
|
|
28
|
+
isMobile?: boolean;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
const WrappedKeypadContext = (
|
|
31
|
+
const WrappedKeypadContext = ({
|
|
32
|
+
item,
|
|
33
|
+
customKeypad,
|
|
34
|
+
isMobile = false,
|
|
35
|
+
}: WrappedKeypadContextProps) => {
|
|
31
36
|
return (
|
|
32
37
|
<TestKeypadContextWrapper>
|
|
33
38
|
<KeypadContext.Consumer>
|
|
34
|
-
{({keypadElement
|
|
39
|
+
{({keypadElement}) => {
|
|
35
40
|
return (
|
|
36
|
-
<
|
|
37
|
-
item={
|
|
41
|
+
<ServerItemRendererWithDebugUI
|
|
42
|
+
item={item}
|
|
43
|
+
keypadElement={keypadElement}
|
|
38
44
|
// Hardcoding the V2 Keypad to true as the Storybook Args
|
|
39
45
|
// were not working.
|
|
40
46
|
apiOptions={{
|
|
41
|
-
|
|
47
|
+
isMobile: isMobile,
|
|
48
|
+
customKeypad: customKeypad,
|
|
42
49
|
useV2Keypad: true,
|
|
43
50
|
}}
|
|
44
51
|
/>
|
|
@@ -98,13 +105,17 @@ export const Mobile = (args: StoryArgs): React.ReactElement => {
|
|
|
98
105
|
return (
|
|
99
106
|
<div>
|
|
100
107
|
<p>
|
|
101
|
-
|
|
108
|
+
MathInput uses touch events;{" "}
|
|
102
109
|
<a href="https://developer.chrome.com/docs/devtools/device-mode/">
|
|
103
|
-
|
|
110
|
+
emulate mobile
|
|
104
111
|
</a>{" "}
|
|
105
|
-
to
|
|
112
|
+
to use the custom keypad.
|
|
106
113
|
</p>
|
|
107
|
-
<WrappedKeypadContext
|
|
114
|
+
<WrappedKeypadContext
|
|
115
|
+
item={expressionItem3}
|
|
116
|
+
customKeypad
|
|
117
|
+
isMobile
|
|
118
|
+
/>
|
|
108
119
|
</div>
|
|
109
120
|
);
|
|
110
121
|
};
|
package/tsconfig-build.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
{"path": "../kmath/tsconfig-build.json"},
|
|
19
19
|
{"path": "../math-input/tsconfig-build.json"},
|
|
20
20
|
{"path": "../perseus-core/tsconfig-build.json"},
|
|
21
|
+
{"path": "../perseus-core/tsconfig-build.json"},
|
|
21
22
|
{"path": "../perseus-linter/tsconfig-build.json"},
|
|
22
23
|
{"path": "../pure-markdown/tsconfig-build.json"},
|
|
23
24
|
{"path": "../simple-markdown/tsconfig-build.json"},
|