@khanacademy/perseus 71.0.0 → 71.1.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.
@@ -59,7 +59,6 @@ type State = {
59
59
  translationLintErrors: ReadonlyArray<string>;
60
60
  widgetInfo: Readonly<PerseusWidgetsMap>;
61
61
  jiptContent: any;
62
- lastUsedWidgetId: string | null | undefined;
63
62
  };
64
63
  type DefaultProps = Required<Pick<Props, "alwaysUpdate" | "content" | "findExternalWidgets" | "highlightedWidgets" | "images" | "linterContext" | "onInteractWithWidget" | "onRender" | "questionCompleted" | "showSolutions" | "reviewMode" | "widgets">>;
65
64
  /**
package/dist/types.d.ts CHANGED
@@ -399,7 +399,6 @@ export type UniversalWidgetProps<TUserInput = Empty, TrackingExtraArgs = Empty>
399
399
  showSolutions?: ShowSolutions;
400
400
  handleUserInput: (newUserInput: TUserInput, cb?: () => void, silent?: boolean) => void;
401
401
  userInput: TUserInput;
402
- isLastUsedWidget: boolean;
403
402
  linterContext: LinterContextProps;
404
403
  containerSizeClass: SizeClass;
405
404
  };
@@ -78,4 +78,13 @@ declare const KhanColors: {
78
78
  readonly INTERACTIVE: string;
79
79
  readonly DYNAMIC: string;
80
80
  };
81
+ /**
82
+ * Traverses the DOM ancestry of the given element until it finds an element with a
83
+ * non-transparent background color, returning that color. If no such element is found,
84
+ * returns the default background color.
85
+ *
86
+ * @param elementToInspect the HTMLElement to start inspecting.
87
+ * @returns a string representing the background color, or a CSS variable for the default background color.
88
+ */
89
+ export declare const getBackgroundColor: (elementToInspect: HTMLElement) => string;
81
90
  export default KhanColors;
@@ -122,7 +122,6 @@ export declare class Expression extends React.Component<Props> implements Widget
122
122
  reviewMode: boolean;
123
123
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
124
124
  handleUserInput: (newUserInput: string, cb?: () => void, silent?: boolean) => void;
125
- isLastUsedWidget: boolean;
126
125
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
127
126
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
128
127
  analytics?: {
@@ -155,7 +154,7 @@ declare const _default: {
155
154
  times: NonNullable<ExternalProps["times"]>;
156
155
  visibleLabel: PerseusExpressionWidgetOptions["visibleLabel"];
157
156
  ariaLabel: PerseusExpressionWidgetOptions["ariaLabel"];
158
- }, "static" | "ariaLabel" | "extraKeys" | "buttonsVisible" | "trackInteraction" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "keypadElement" | "isLastUsedWidget" | "handleUserInput" | "showSolutions" | "reviewMode" | "widgetIndex" | keyof import("../..").PerseusDependenciesV2 | "alignment" | "visibleLabel" | "answerForms"> & {
157
+ }, "static" | "ariaLabel" | "extraKeys" | "buttonsVisible" | "trackInteraction" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "keypadElement" | "handleUserInput" | "showSolutions" | "reviewMode" | "widgetIndex" | keyof import("../..").PerseusDependenciesV2 | "alignment" | "visibleLabel" | "answerForms"> & {
159
158
  buttonSets?: import("@khanacademy/perseus-core").LegacyButtonSets | undefined;
160
159
  onFocus?: ((blurPath: import("../..").FocusPath) => void) | undefined;
161
160
  onBlur?: ((blurPath: import("../..").FocusPath) => void) | undefined;
@@ -113,7 +113,6 @@ declare class Grapher extends React.Component<Props> implements Widget {
113
113
  reviewMode: boolean;
114
114
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
115
115
  handleUserInput: (newUserInput: import("@khanacademy/perseus-core").GrapherAnswerTypes, cb?: () => void, silent?: boolean) => void;
116
- isLastUsedWidget: boolean;
117
116
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
118
117
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
119
118
  };
@@ -22,6 +22,7 @@ type Props = {
22
22
  sequenceNumber?: number;
23
23
  onBlur?: (event: React.FocusEvent) => unknown;
24
24
  onClick?: () => unknown;
25
+ onDragEnd?: () => unknown;
25
26
  onFocus?: (event: React.FocusEvent) => unknown;
26
27
  onMove?: (newPoint: vec.Vector2) => unknown;
27
28
  };
@@ -22,6 +22,7 @@ type Params = {
22
22
  */
23
23
  sequenceNumber?: number;
24
24
  onMove?: ((newPoint: vec.Vector2) => unknown) | undefined;
25
+ onDragEnd?: (() => unknown) | undefined;
25
26
  onClick?: (() => unknown) | undefined;
26
27
  onFocus?: ((event: React.FocusEvent) => unknown) | undefined;
27
28
  onBlur?: ((event: React.FocusEvent) => unknown) | undefined;
@@ -20,6 +20,7 @@ import type { RefObject } from "react";
20
20
  export type Params = {
21
21
  gestureTarget: RefObject<Element>;
22
22
  onMove: (point: vec.Vector2) => unknown;
23
+ onDragEnd?: () => unknown;
23
24
  point: vec.Vector2;
24
25
  constrainKeyboardMovement: KeyboardMovementConstraint;
25
26
  };
@@ -214,7 +214,6 @@ declare class InteractiveGraph extends React.Component<Props, State> {
214
214
  reviewMode: boolean;
215
215
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
216
216
  handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
217
- isLastUsedWidget: boolean;
218
217
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
219
218
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
220
219
  };
@@ -97,7 +97,6 @@ declare class MockWidgetComponent extends React.Component<Props> implements Widg
97
97
  reviewMode: boolean;
98
98
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
99
99
  handleUserInput: (newUserInput: PerseusMockWidgetUserInput, cb?: () => void, silent?: boolean) => void;
100
- isLastUsedWidget: boolean;
101
100
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
102
101
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
103
102
  };
@@ -104,7 +104,6 @@ export declare class NumericInput extends React.Component<NumericInputProps> imp
104
104
  reviewMode: boolean;
105
105
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
106
106
  handleUserInput: (newUserInput: PerseusNumericInputUserInput, cb?: () => void, silent?: boolean) => void;
107
- isLastUsedWidget: boolean;
108
107
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
109
108
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
110
109
  answerForms: ReadonlyArray<PerseusNumericInputAnswerForm>;
@@ -151,7 +151,6 @@ export declare class Plotter extends React.Component<Props, State> implements Wi
151
151
  reviewMode: boolean;
152
152
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
153
153
  handleUserInput: (newUserInput: PerseusPlotterUserInput, cb?: () => void, silent?: boolean) => void;
154
- isLastUsedWidget: boolean;
155
154
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
156
155
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
157
156
  };
@@ -28,7 +28,6 @@ type Props = {
28
28
  reviewMode: boolean;
29
29
  onChange: (checkedChoiceIds: ReadonlyArray<string>) => void;
30
30
  registerFocusFunction?: (arg1: FocusFunction) => void;
31
- isLastUsedWidget?: boolean;
32
31
  };
33
- declare const BaseRadio: ({ apiOptions, reviewMode, choices, editMode, multipleSelect, labelWrap, countChoices, numCorrect, isLastUsedWidget, onChange, registerFocusFunction, }: Props) => React.ReactElement;
32
+ declare const BaseRadio: ({ apiOptions, reviewMode, choices, editMode, multipleSelect, labelWrap, countChoices, numCorrect, onChange, registerFocusFunction, }: Props) => React.ReactElement;
34
33
  export default BaseRadio;
@@ -98,7 +98,6 @@ declare class Radio extends RadioOld {
98
98
  findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
99
99
  reviewMode: boolean;
100
100
  handleUserInput: (newUserInput: PerseusRadioUserInput, cb?: () => void, silent?: boolean) => void;
101
- isLastUsedWidget: boolean;
102
101
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
103
102
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
104
103
  };
@@ -105,7 +105,6 @@ declare class Table extends React.Component<Props> implements Widget {
105
105
  reviewMode: boolean;
106
106
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
107
107
  handleUserInput: (newUserInput: PerseusTableUserInput, cb?: () => void, silent?: boolean) => void;
108
- isLastUsedWidget: boolean;
109
108
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
110
109
  containerSizeClass: import("../../util/sizing-utils").SizeClass;
111
110
  Editor: any;
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": "71.0.0",
6
+ "version": "71.1.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -42,12 +42,12 @@
42
42
  "tiny-invariant": "1.3.1",
43
43
  "uuid": "^10.0.0",
44
44
  "@khanacademy/kas": "2.1.2",
45
- "@khanacademy/keypad-context": "3.2.9",
46
- "@khanacademy/kmath": "2.2.9",
47
- "@khanacademy/math-input": "26.2.9",
48
- "@khanacademy/perseus-core": "19.4.0",
49
- "@khanacademy/perseus-linter": "4.3.10",
50
- "@khanacademy/perseus-score": "7.7.9",
45
+ "@khanacademy/keypad-context": "3.2.10",
46
+ "@khanacademy/kmath": "2.2.10",
47
+ "@khanacademy/math-input": "26.2.11",
48
+ "@khanacademy/perseus-core": "19.5.0",
49
+ "@khanacademy/perseus-linter": "4.4.0",
50
+ "@khanacademy/perseus-score": "7.7.10",
51
51
  "@khanacademy/perseus-utils": "2.1.0",
52
52
  "@khanacademy/pure-markdown": "2.2.0",
53
53
  "@khanacademy/simple-markdown": "2.1.0"
@@ -71,6 +71,7 @@
71
71
  "@khanacademy/wonder-blocks-popover": "6.1.34",
72
72
  "@khanacademy/wonder-blocks-progress-spinner": "3.1.37",
73
73
  "@khanacademy/wonder-blocks-switch": "3.3.19",
74
+ "@khanacademy/wonder-blocks-timing": "7.0.2",
74
75
  "@khanacademy/wonder-blocks-tokens": "14.0.0",
75
76
  "@khanacademy/wonder-blocks-tooltip": "4.1.48",
76
77
  "@khanacademy/wonder-blocks-typography": "4.2.22",
@@ -88,8 +89,8 @@
88
89
  "react-dom": "18.2.0",
89
90
  "react-popper": "^2.2.5",
90
91
  "underscore": "1.4.4",
91
- "raphael": "1.5.4",
92
- "perseus-build-settings": "0.9.0"
92
+ "perseus-build-settings": "0.9.0",
93
+ "raphael": "1.5.4"
93
94
  },
94
95
  "peerDependencies": {
95
96
  "@khanacademy/wonder-blocks-announcer": "^1.0.3",
@@ -110,6 +111,7 @@
110
111
  "@khanacademy/wonder-blocks-popover": "^6.1.34",
111
112
  "@khanacademy/wonder-blocks-progress-spinner": "^3.1.37",
112
113
  "@khanacademy/wonder-blocks-switch": "^3.3.19",
114
+ "@khanacademy/wonder-blocks-timing": "^7.0.2",
113
115
  "@khanacademy/wonder-blocks-tokens": "^14.0.0",
114
116
  "@khanacademy/wonder-blocks-tooltip": "^4.1.48",
115
117
  "@khanacademy/wonder-blocks-typography": "^4.2.22",