@khanacademy/perseus 47.0.1 → 48.1.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.
@@ -228,10 +228,6 @@ declare class Renderer extends React.Component<Props, State> implements GetPromp
228
228
  * @deprecated use scorePerseusItem
229
229
  */
230
230
  score(): PerseusScore;
231
- /**
232
- * @deprecated use scorePerseusItem
233
- */
234
- guessAndScore: () => [UserInputArray, PerseusScore];
235
231
  handletranslationLintErrors: (lintErrors: ReadonlyArray<string>) => void;
236
232
  render(): React.ReactNode;
237
233
  }
@@ -105,12 +105,6 @@ export declare class ServerItemRenderer extends React.Component<Props, State> im
105
105
  * Returns an object of the widget `.getUserInput()` results
106
106
  */
107
107
  getUserInput(): UserInputMap;
108
- /**
109
- * Grades the item.
110
- *
111
- * @deprecated use scorePerseusItem
112
- */
113
- scoreInput(): KEScore;
114
108
  /**
115
109
  * Returns an array of all widget IDs in the order they occur in
116
110
  * the question content.
@@ -0,0 +1,35 @@
1
+ import type { Coord } from "../interactive2/types";
2
+ import type { CSSProperties } from "aphrodite";
3
+ /**
4
+ * A Graphie axis range.
5
+ */
6
+ export type GraphieRange = [number, number];
7
+ /**
8
+ * A Graphie label.
9
+ */
10
+ export type GraphieLabel = {
11
+ content: string;
12
+ alignment: number | "center" | "above" | "above right" | "right" | "below right" | "below" | "below left" | "left" | "above left";
13
+ coordinates: GraphieRange;
14
+ style: CSSProperties;
15
+ typesetAsMath: boolean;
16
+ };
17
+ /**
18
+ * The Graphie data (labels, etc.)
19
+ */
20
+ export type GraphieData = {
21
+ range: [GraphieRange, GraphieRange];
22
+ labels: Array<GraphieLabel>;
23
+ };
24
+ export declare function getLocalizedDataUrl(url: string): string;
25
+ /**
26
+ * Parse JSONP for a web+graphie://... hash to extract Graphie data, or throw
27
+ * an error if invalid JSONP.
28
+ */
29
+ export declare function parseDataFromJSONP(graphieHash: string, graphieJSONP: string, errorCallback: (error?: any) => void): GraphieData | null;
30
+ type CacheEntry = {
31
+ labels: ReadonlyArray<any>;
32
+ range: [Coord, Coord];
33
+ };
34
+ export declare function loadGraphie(url: string, onDataLoaded: (data: CacheEntry, localized: boolean) => void): void;
35
+ export {};
@@ -1,5 +1,11 @@
1
- import type { CategorizerWidget, ExpressionWidget, InteractiveGraphWidget, NumericInputWidget, PerseusItem, RadioWidget } from "../perseus-types";
1
+ import type { CategorizerWidget, ExpressionWidget, InteractiveGraphWidget, NumericInputWidget, PerseusItem, PerseusRenderer, RadioWidget } from "../perseus-types";
2
+ import type { PerseusScore } from "../types";
3
+ import type { UserInputMap } from "../validation.types";
2
4
  export declare const genericPerseusItemData: PerseusItem;
5
+ /**
6
+ * Thin wrapper around scorePerseusItem for internal testing
7
+ */
8
+ export declare function scorePerseusItemTesting(perseusRenderData: PerseusRenderer, userInputMap: UserInputMap): PerseusScore;
3
9
  /**
4
10
  * Generate a Perseus item object for testing purposes.
5
11
  *
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": "47.0.1",
6
+ "version": "48.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -40,14 +40,14 @@
40
40
  "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
41
41
  },
42
42
  "dependencies": {
43
- "@khanacademy/kas": "^0.4.2",
44
- "@khanacademy/keypad-context": "^1.0.4",
45
- "@khanacademy/kmath": "^0.1.16",
46
- "@khanacademy/math-input": "^21.1.6",
47
- "@khanacademy/perseus-core": "1.5.3",
48
- "@khanacademy/perseus-linter": "^1.2.4",
49
- "@khanacademy/pure-markdown": "^0.3.13",
50
- "@khanacademy/simple-markdown": "^0.13.6",
43
+ "@khanacademy/kas": "^0.4.3",
44
+ "@khanacademy/keypad-context": "^1.0.5",
45
+ "@khanacademy/kmath": "^0.1.17",
46
+ "@khanacademy/math-input": "^21.1.7",
47
+ "@khanacademy/perseus-core": "2.0.0",
48
+ "@khanacademy/perseus-linter": "^1.2.5",
49
+ "@khanacademy/pure-markdown": "^0.3.14",
50
+ "@khanacademy/simple-markdown": "^0.13.7",
51
51
  "@types/classnames": "2.2.0",
52
52
  "@use-gesture/react": "^10.2.27",
53
53
  "mafs": "0.19.0",