@khanacademy/perseus-core 23.0.0 → 23.0.2

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.
@@ -0,0 +1,132 @@
1
+ declare const _default: {
2
+ question: {
3
+ content: string;
4
+ images: {};
5
+ widgets: {
6
+ "label-image 1": {
7
+ type: string;
8
+ alignment: string;
9
+ static: boolean;
10
+ graded: boolean;
11
+ options: {
12
+ static: boolean;
13
+ choices: string[];
14
+ imageAlt: string;
15
+ imageUrl: string;
16
+ imageWidth: number;
17
+ imageHeight: number;
18
+ markers: {
19
+ answers: string[];
20
+ label: string;
21
+ x: number;
22
+ y: number;
23
+ }[];
24
+ multipleAnswers: boolean;
25
+ hideChoicesFromInstructions: boolean;
26
+ };
27
+ version: {
28
+ major: number;
29
+ minor: number;
30
+ };
31
+ };
32
+ "numeric-input 1": {
33
+ type: string;
34
+ alignment: string;
35
+ static: boolean;
36
+ graded: boolean;
37
+ options: {
38
+ static: boolean;
39
+ answers: {
40
+ value: number;
41
+ status: string;
42
+ message: string;
43
+ simplify: string;
44
+ strict: boolean;
45
+ maxError: null;
46
+ }[];
47
+ size: string;
48
+ coefficient: boolean;
49
+ labelText: string;
50
+ rightAlign: boolean;
51
+ multipleNumberInput: boolean;
52
+ };
53
+ version: {
54
+ major: number;
55
+ minor: number;
56
+ };
57
+ };
58
+ };
59
+ };
60
+ answerArea: {
61
+ calculator: boolean;
62
+ financialCalculatorMonthlyPayment: boolean;
63
+ financialCalculatorTotalAmount: boolean;
64
+ financialCalculatorTimeToPayOff: boolean;
65
+ periodicTable: boolean;
66
+ periodicTableWithKey: boolean;
67
+ };
68
+ hints: ({
69
+ replace: boolean;
70
+ content: string;
71
+ images: {
72
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/41b6249a8c169358946e888698e1543b6db098f5"?: undefined;
73
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/6b3c9a4e7ac918eb2839873a1ef9007a60544802"?: undefined;
74
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/f9db1a770082515682709ce20934597a24dc7f1f"?: undefined;
75
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/78bef08c55fc5a7fac6f512fc845d09f478a97c9"?: undefined;
76
+ };
77
+ widgets: {};
78
+ } | {
79
+ replace: boolean;
80
+ content: string;
81
+ images: {
82
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/41b6249a8c169358946e888698e1543b6db098f5": {
83
+ width: number;
84
+ height: number;
85
+ };
86
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/6b3c9a4e7ac918eb2839873a1ef9007a60544802"?: undefined;
87
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/f9db1a770082515682709ce20934597a24dc7f1f"?: undefined;
88
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/78bef08c55fc5a7fac6f512fc845d09f478a97c9"?: undefined;
89
+ };
90
+ widgets: {};
91
+ } | {
92
+ replace: boolean;
93
+ content: string;
94
+ images: {
95
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/6b3c9a4e7ac918eb2839873a1ef9007a60544802": {
96
+ width: number;
97
+ height: number;
98
+ };
99
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/41b6249a8c169358946e888698e1543b6db098f5"?: undefined;
100
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/f9db1a770082515682709ce20934597a24dc7f1f"?: undefined;
101
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/78bef08c55fc5a7fac6f512fc845d09f478a97c9"?: undefined;
102
+ };
103
+ widgets: {};
104
+ } | {
105
+ replace: boolean;
106
+ content: string;
107
+ images: {
108
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/f9db1a770082515682709ce20934597a24dc7f1f": {
109
+ width: number;
110
+ height: number;
111
+ };
112
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/41b6249a8c169358946e888698e1543b6db098f5"?: undefined;
113
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/6b3c9a4e7ac918eb2839873a1ef9007a60544802"?: undefined;
114
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/78bef08c55fc5a7fac6f512fc845d09f478a97c9"?: undefined;
115
+ };
116
+ widgets: {};
117
+ } | {
118
+ replace: boolean;
119
+ content: string;
120
+ images: {
121
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/78bef08c55fc5a7fac6f512fc845d09f478a97c9": {
122
+ width: number;
123
+ height: number;
124
+ };
125
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/41b6249a8c169358946e888698e1543b6db098f5"?: undefined;
126
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/6b3c9a4e7ac918eb2839873a1ef9007a60544802"?: undefined;
127
+ "web+graphie://ka-perseus-graphie.s3.amazonaws.com/f9db1a770082515682709ce20934597a24dc7f1f"?: undefined;
128
+ };
129
+ widgets: {};
130
+ })[];
131
+ };
132
+ export default _default;
@@ -2,8 +2,7 @@
2
2
  * Traverses a {content, widgets, images} renderer props object,
3
3
  * such as `itemData.question`
4
4
  *
5
- * This traversal is deep and handles some widget prop upgrades
6
- * (TODO(aria): Handle minor prop upgrades :) )
5
+ * This traversal is deep.
7
6
  *
8
7
  * This is the right way to traverse itemData.
9
8
  *
package/dist/types.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- type State = any;
2
1
  export interface RendererInterface {
3
2
  /**
4
3
  * @deprecated - do not use in new code.
5
4
  */
6
- getSerializedState(): State;
5
+ getSerializedState(): any;
7
6
  blur(): void;
8
7
  focus(): boolean | null | undefined;
9
8
  props: any;
@@ -23,4 +22,3 @@ export type Alignment = "default" | "block" | "inline-block" | "inline" | "wrap-
23
22
  export type RecursiveReadonly<T> = {
24
23
  readonly [K in keyof T]: RecursiveReadonly<T[K]>;
25
24
  };
26
- export {};
@@ -1,8 +1,8 @@
1
- import { type KeypadConfiguration } from "../../keypad";
1
+ import { type KeypadKey } from "../../keypad";
2
2
  import type { PerseusExpressionWidgetOptions } from "../../data-schema";
3
3
  /**
4
4
  * Scrape the answer forms for any variables or contants (like Pi)
5
5
  * that need to be included as keys on the keypad.
6
6
  */
7
- declare function deriveExtraKeys(widgetOptions: PerseusExpressionWidgetOptions): KeypadConfiguration["extraKeys"];
7
+ declare function deriveExtraKeys(widgetOptions: PerseusExpressionWidgetOptions): KeypadKey[];
8
8
  export default deriveExtraKeys;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Shared Perseus infrastructure",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "23.0.0",
6
+ "version": "23.0.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -39,7 +39,7 @@
39
39
  "tiny-invariant": "1.3.1",
40
40
  "@khanacademy/kas": "2.1.7",
41
41
  "@khanacademy/perseus-utils": "2.1.4",
42
- "@khanacademy/pure-markdown": "2.2.5"
42
+ "@khanacademy/pure-markdown": "2.2.6"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@khanacademy/wonder-stuff-core": "3.0.0",