@khanacademy/perseus-core 3.5.0 → 3.7.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.
@@ -1,4 +1,4 @@
1
- export type VirtualKeypadVersion = "MATH_INPUT_KEYPAD_V2" | "REACT_NATIVE_KEYPAD";
1
+ type VirtualKeypadVersion = "MATH_INPUT_KEYPAD_V2" | "REACT_NATIVE_KEYPAD";
2
2
  /**
3
3
  * A type union of all the events that any package in the Perseus ecosystem can
4
4
  * send.
@@ -15,8 +15,20 @@ export type PerseusAnalyticsEvent = {
15
15
  } | {
16
16
  type: "perseus:widget-rendering-error";
17
17
  payload: {
18
+ widgetSubType: string;
18
19
  widgetType: string;
19
20
  widgetId: string;
21
+ message: string;
22
+ userAgent: string;
23
+ };
24
+ } | {
25
+ type: "perseus:widget-rendering-error:ti";
26
+ payload: {
27
+ widgetSubType: string;
28
+ widgetType: string;
29
+ widgetId: string;
30
+ message: string;
31
+ userAgent: string;
20
32
  };
21
33
  } | {
22
34
  type: "perseus:interactive-graph-widget:rendered";
@@ -25,6 +37,13 @@ export type PerseusAnalyticsEvent = {
25
37
  widgetType: string;
26
38
  widgetId: string;
27
39
  };
40
+ } | {
41
+ type: "perseus:widget:rendered:ti";
42
+ payload: {
43
+ widgetSubType: string;
44
+ widgetType: string;
45
+ widgetId: string;
46
+ };
28
47
  } | {
29
48
  type: "perseus:label-image:toggle-answers-hidden";
30
49
  payload: null;
@@ -34,6 +53,15 @@ export type PerseusAnalyticsEvent = {
34
53
  } | {
35
54
  type: "perseus:label-image:choiced-interacted-with";
36
55
  payload: null;
56
+ } | {
57
+ type: "perseus:label-image:toggle-answers-hidden:ti";
58
+ payload: null;
59
+ } | {
60
+ type: "perseus:label-image:marker-interacted-with:ti";
61
+ payload: null;
62
+ } | {
63
+ type: "perseus:label-image:choiced-interacted-with:ti";
64
+ payload: null;
37
65
  } | {
38
66
  type: "math-input:keypad-closed";
39
67
  payload: {
@@ -47,3 +75,4 @@ export type PerseusAnalyticsEvent = {
47
75
  };
48
76
  /** A function that is called when Perseus emits an analytics event. */
49
77
  export type AnalyticsEventHandlerFn = (event: PerseusAnalyticsEvent) => Promise<void>;
78
+ export {};
@@ -226,7 +226,14 @@ export type PerseusRenderer = {
226
226
  * field.
227
227
  */
228
228
  widgets: PerseusWidgetsMap;
229
- metadata?: ReadonlyArray<string>;
229
+ /**
230
+ * Formerly used in the PerseusGradedGroup widget. A list of "tags" that
231
+ * are keys that represent other content in the system. Not rendered to
232
+ * the user. NOTE: perseus_data.go says this is required even though it
233
+ * isn't necessary.
234
+ * @deprecated
235
+ */
236
+ metadata?: any;
230
237
  /**
231
238
  * A dictionary of {[imageUrl]: PerseusImageDetail}.
232
239
  */
@@ -258,7 +265,7 @@ export type WidgetOptions<Type extends string, Options> = {
258
265
  graded?: boolean;
259
266
  alignment?: string;
260
267
  options: Options;
261
- key?: number;
268
+ key?: number | null;
262
269
  version?: Version;
263
270
  };
264
271
  export type CategorizerWidget = WidgetOptions<'categorizer', PerseusCategorizerWidgetOptions>;
@@ -304,7 +311,7 @@ export type PerseusImageBackground = {
304
311
  height?: number;
305
312
  top?: number;
306
313
  left?: number;
307
- scale?: number | string;
314
+ scale?: number;
308
315
  bottom?: number;
309
316
  };
310
317
  /**
@@ -560,7 +567,7 @@ export type LockedFunctionType = {
560
567
  strokeStyle: LockedLineStyle;
561
568
  equation: string;
562
569
  directionalAxis: "x" | "y";
563
- domain?: Interval;
570
+ domain?: [min: number | null, max: number | null];
564
571
  labels?: LockedLabelType[];
565
572
  ariaLabel?: string;
566
573
  };