@khanacademy/perseus 66.2.0 → 66.2.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.
@@ -124,7 +124,7 @@ export declare class ServerItemRenderer extends React.Component<Props, State> im
124
124
  setAssetStatus: (assetKey: string, status: boolean) => void;
125
125
  render(): React.ReactNode;
126
126
  }
127
- declare const ref: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps & OwnProps & HOCProps, keyof OwnProps> & {
127
+ declare const _default: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps & OwnProps & HOCProps, keyof OwnProps> & {
128
128
  apiOptions?: Readonly<{
129
129
  isArticle?: boolean;
130
130
  onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
@@ -164,4 +164,4 @@ declare const ref: React.ForwardRefExoticComponent<Omit<Pick<SharedRendererProps
164
164
  linterContext?: PerseusLinter.LinterContextProps | undefined;
165
165
  onRendered?: ((isRendered: boolean) => void) | undefined;
166
166
  } & {}, "onRendered"> & React.RefAttributes<ServerItemRenderer>>;
167
- export default ref;
167
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import type { PerseusWidgetsMap, UserInputMap } from "@khanacademy/perseus-core";
2
2
  export type InitializeUserInputCallback = (widgetOptions: PerseusWidgetsMap, problemNum: number) => void;
3
3
  export type RestoreUserInputFromSerializedStateCallback = (serializedState: unknown, widgetOptions: PerseusWidgetsMap) => void;
4
- export type HandleUserInputCallback = (widgetId: string, userInput: UserInputMap[keyof UserInputMap]) => void;
4
+ export type HandleUserInputCallback = (widgetId: string, userInput: UserInputMap[keyof UserInputMap], widgetsEmpty: boolean) => void;
5
5
  type FunctionChildParams = {
6
6
  userInput: UserInputMap;
7
7
  handleUserInput: HandleUserInputCallback;
@@ -14,7 +14,7 @@ type FunctionChildParams = {
14
14
  type Props = {
15
15
  widgets: PerseusWidgetsMap;
16
16
  problemNum: number;
17
- handleUserInput?: (userInput: UserInputMap) => void;
17
+ handleUserInput?: (userInput: UserInputMap, widgetsEmpty: boolean) => void;
18
18
  children: (payload: FunctionChildParams) => JSX.Element | null;
19
19
  };
20
20
  /**
@@ -1,4 +1,4 @@
1
- import type interactiveGraph from "../../widgets/interactive-graph";
1
+ import type interactiveGraph from "../../widgets/interactive-graphs/interactive-graph";
2
2
  import type { UnsupportedWidgetPromptJSON } from "../unsupported-widget";
3
3
  import type { PerseusGraphType } from "@khanacademy/perseus-core";
4
4
  import type React from "react";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { PerseusI18nContext } from "../../components/i18n-context";
3
3
  import type { APIOptions } from "../../types";
4
- export type ANSWER_BAR_STATES = "HIDDEN" | "ACTIVE" | "INACTIVE" | "INCORRECT" | "CORRECT";
4
+ export type ANSWER_BAR_STATES = "ACTIVE" | "INACTIVE" | "INCORRECT" | "CORRECT";
5
5
  type Props = {
6
6
  answerBarState: ANSWER_BAR_STATES;
7
7
  apiOptions: APIOptions;
@@ -4,7 +4,7 @@ import Renderer from "../../renderer";
4
4
  import type { ANSWER_BAR_STATES } from "./graded-group-answer-bar";
5
5
  import type { FocusPath, TrackingGradedGroupExtraArguments, Widget, WidgetProps } from "../../types";
6
6
  import type { GradedGroupPromptJSON } from "../../widget-ai-utils/graded-group/graded-group-ai-utils";
7
- import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
7
+ import type { PerseusGradedGroupWidgetOptions, UserInputMap } from "@khanacademy/perseus-core";
8
8
  declare const GRADING_STATUSES: {
9
9
  readonly ungraded: "ungraded";
10
10
  readonly correct: "correct";
@@ -40,7 +40,7 @@ export declare class GradedGroup extends React.Component<Props, State> implement
40
40
  hintRendererRef: React.RefObject<Renderer>;
41
41
  shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
42
42
  change: (...args: ReadonlyArray<unknown>) => any;
43
- _handleUserInput(): void;
43
+ _handleUserInput(_userInput: UserInputMap, widgetsEmpty: boolean): void;
44
44
  _checkAnswer: () => void;
45
45
  getInputPaths: () => ReadonlyArray<FocusPath>;
46
46
  getPromptJSON(): GradedGroupPromptJSON;
@@ -1,10 +1,10 @@
1
1
  import * as React from "react";
2
- import type { StatefulMafsGraphType } from "./interactive-graphs/stateful-mafs-graph";
3
- import type { QuadraticGraphState } from "./interactive-graphs/types";
4
- import type { Coord } from "../interactive2/types";
5
- import type { WidgetProps } from "../types";
6
- import type { InteractiveGraphPromptJSON } from "../widget-ai-utils/interactive-graph/interactive-graph-ai-utils";
7
- import type { UnsupportedWidgetPromptJSON } from "../widget-ai-utils/unsupported-widget";
2
+ import type { StatefulMafsGraphType } from "./stateful-mafs-graph";
3
+ import type { QuadraticGraphState } from "./types";
4
+ import type { Coord } from "../../interactive2/types";
5
+ import type { WidgetProps } from "../../types";
6
+ import type { InteractiveGraphPromptJSON } from "../../widget-ai-utils/interactive-graph/interactive-graph-ai-utils";
7
+ import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
8
8
  import type { QuadraticCoefficient, SineCoefficient, Range } from "@khanacademy/kmath";
9
9
  import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions, GraphRange, InteractiveGraphPublicWidgetOptions, LockedFigure, PerseusImageBackground, MarkingsType, PerseusInteractiveGraphUserInput, AxisLabelLocation } from "@khanacademy/perseus-core";
10
10
  type RenderProps = {
@@ -155,7 +155,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
155
155
  problemNum: number | null | undefined;
156
156
  apiOptions: Readonly<Readonly<{
157
157
  isArticle?: boolean;
158
- onFocusChange?: (newFocusPath: import("..").FocusPath, oldFocusPath: import("..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
158
+ onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
159
159
  GroupMetadataEditor?: React.ComponentType<any>;
160
160
  showAlignmentOptions?: boolean;
161
161
  readOnly?: boolean;
@@ -170,12 +170,12 @@ declare class InteractiveGraph extends React.Component<Props, State> {
170
170
  baseElements?: {
171
171
  Link: React.ComponentType<any>;
172
172
  };
173
- imagePreloader?: (dimensions: import("../types").Dimensions) => React.ReactNode;
173
+ imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
174
174
  trackInteraction?: (args: {
175
175
  type: string;
176
176
  id: string;
177
177
  correct?: boolean;
178
- } & Partial<import("../types").TrackingGradedGroupExtraArguments> & Partial<{
178
+ } & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
179
179
  visible: number;
180
180
  }>) => void;
181
181
  customKeypad?: boolean;
@@ -189,30 +189,30 @@ declare class InteractiveGraph extends React.Component<Props, State> {
189
189
  flags?: Record<"new-radio-widget", boolean>;
190
190
  onWidgetStartProps?: (widgets: import("@khanacademy/perseus-core").PerseusWidgetsMap) => void;
191
191
  }> & {
192
- baseElements: NonNullable<import("..").APIOptions["baseElements"]>;
193
- canScrollPage: NonNullable<import("..").APIOptions["canScrollPage"]>;
194
- editorChangeDelay: NonNullable<import("..").APIOptions["editorChangeDelay"]>;
195
- groupAnnotator: NonNullable<import("..").APIOptions["groupAnnotator"]>;
196
- isArticle: NonNullable<import("..").APIOptions["isArticle"]>;
197
- isMobile: NonNullable<import("..").APIOptions["isMobile"]>;
198
- isMobileApp: NonNullable<import("..").APIOptions["isMobileApp"]>;
199
- onFocusChange: NonNullable<import("..").APIOptions["onFocusChange"]>;
200
- readOnly: NonNullable<import("..").APIOptions["readOnly"]>;
201
- setDrawingAreaAvailable: NonNullable<import("..").APIOptions["setDrawingAreaAvailable"]>;
202
- showAlignmentOptions: NonNullable<import("..").APIOptions["showAlignmentOptions"]>;
192
+ baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
193
+ canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
194
+ editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
195
+ groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
196
+ isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
197
+ isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
198
+ isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
199
+ onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
200
+ readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
201
+ setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
202
+ showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
203
203
  }>;
204
204
  keypadElement?: any;
205
205
  questionCompleted?: boolean;
206
- onFocus: (blurPath: import("..").FocusPath) => void;
207
- onBlur: (blurPath: import("..").FocusPath) => void;
208
- findWidgets: (criterion: import("../types").FilterCriterion) => ReadonlyArray<import("../types").Widget>;
206
+ onFocus: (blurPath: import("../..").FocusPath) => void;
207
+ onBlur: (blurPath: import("../..").FocusPath) => void;
208
+ findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
209
209
  reviewMode: boolean;
210
210
  showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
211
- onChange: import("..").ChangeHandler;
211
+ onChange: import("../..").ChangeHandler;
212
212
  handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
213
213
  isLastUsedWidget: boolean;
214
214
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
215
- containerSizeClass: import("../util/sizing-utils").SizeClass;
215
+ containerSizeClass: import("../../util/sizing-utils").SizeClass;
216
216
  };
217
217
  render(): React.JSX.Element;
218
218
  /**
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": "66.2.0",
6
+ "version": "66.2.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -44,34 +44,34 @@
44
44
  "@khanacademy/kas": "2.1.0",
45
45
  "@khanacademy/keypad-context": "3.1.1",
46
46
  "@khanacademy/kmath": "2.1.1",
47
- "@khanacademy/math-input": "26.1.1",
47
+ "@khanacademy/math-input": "26.1.2",
48
48
  "@khanacademy/perseus-core": "18.4.0",
49
49
  "@khanacademy/perseus-linter": "4.2.1",
50
- "@khanacademy/perseus-score": "7.3.0",
51
- "@khanacademy/perseus-utils": "2.1.0",
50
+ "@khanacademy/perseus-score": "7.4.0",
52
51
  "@khanacademy/pure-markdown": "2.2.0",
52
+ "@khanacademy/perseus-utils": "2.1.0",
53
53
  "@khanacademy/simple-markdown": "2.1.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@khanacademy/wonder-blocks-banner": "4.2.10",
57
- "@khanacademy/wonder-blocks-button": "10.2.14",
58
- "@khanacademy/wonder-blocks-clickable": "7.1.18",
56
+ "@khanacademy/wonder-blocks-banner": "4.2.11",
57
+ "@khanacademy/wonder-blocks-button": "10.2.15",
58
+ "@khanacademy/wonder-blocks-clickable": "7.1.19",
59
59
  "@khanacademy/wonder-blocks-core": "12.3.0",
60
60
  "@khanacademy/wonder-blocks-data": "14.1.4",
61
- "@khanacademy/wonder-blocks-dropdown": "10.2.8",
62
- "@khanacademy/wonder-blocks-form": "7.2.5",
63
- "@khanacademy/wonder-blocks-icon-button": "10.3.13",
64
- "@khanacademy/wonder-blocks-icon": "5.2.12",
65
- "@khanacademy/wonder-blocks-labeled-field": "3.2.1",
66
- "@khanacademy/wonder-blocks-layout": "3.1.29",
67
- "@khanacademy/wonder-blocks-link": "9.1.18",
68
- "@khanacademy/wonder-blocks-pill": "3.1.33",
69
- "@khanacademy/wonder-blocks-popover": "6.1.21",
70
- "@khanacademy/wonder-blocks-progress-spinner": "3.1.29",
71
- "@khanacademy/wonder-blocks-switch": "3.3.11",
72
- "@khanacademy/wonder-blocks-tokens": "12.0.0",
73
- "@khanacademy/wonder-blocks-tooltip": "4.1.35",
74
- "@khanacademy/wonder-blocks-typography": "4.2.14",
61
+ "@khanacademy/wonder-blocks-dropdown": "10.3.0",
62
+ "@khanacademy/wonder-blocks-form": "7.3.1",
63
+ "@khanacademy/wonder-blocks-icon-button": "10.3.14",
64
+ "@khanacademy/wonder-blocks-icon": "5.2.13",
65
+ "@khanacademy/wonder-blocks-labeled-field": "3.2.2",
66
+ "@khanacademy/wonder-blocks-layout": "3.1.30",
67
+ "@khanacademy/wonder-blocks-link": "9.1.19",
68
+ "@khanacademy/wonder-blocks-pill": "3.1.34",
69
+ "@khanacademy/wonder-blocks-popover": "6.1.22",
70
+ "@khanacademy/wonder-blocks-progress-spinner": "3.1.30",
71
+ "@khanacademy/wonder-blocks-switch": "3.3.12",
72
+ "@khanacademy/wonder-blocks-tokens": "12.0.1",
73
+ "@khanacademy/wonder-blocks-tooltip": "4.1.36",
74
+ "@khanacademy/wonder-blocks-typography": "4.2.15",
75
75
  "@khanacademy/wonder-stuff-core": "1.5.5",
76
76
  "@phosphor-icons/core": "2.0.2",
77
77
  "@popperjs/core": "2.10.2",
@@ -90,25 +90,25 @@
90
90
  "raphael": "1.5.4"
91
91
  },
92
92
  "peerDependencies": {
93
- "@khanacademy/wonder-blocks-banner": "^4.2.10",
94
- "@khanacademy/wonder-blocks-button": "^10.2.14",
95
- "@khanacademy/wonder-blocks-clickable": "^7.1.18",
93
+ "@khanacademy/wonder-blocks-banner": "^4.2.11",
94
+ "@khanacademy/wonder-blocks-button": "^10.2.15",
95
+ "@khanacademy/wonder-blocks-clickable": "^7.1.19",
96
96
  "@khanacademy/wonder-blocks-core": "^12.3.0",
97
97
  "@khanacademy/wonder-blocks-data": "^14.1.4",
98
- "@khanacademy/wonder-blocks-dropdown": "^10.2.8",
99
- "@khanacademy/wonder-blocks-form": "^7.2.5",
100
- "@khanacademy/wonder-blocks-icon": "^5.2.12",
101
- "@khanacademy/wonder-blocks-icon-button": "^10.3.13",
102
- "@khanacademy/wonder-blocks-labeled-field": "^3.2.1",
103
- "@khanacademy/wonder-blocks-layout": "^3.1.29",
104
- "@khanacademy/wonder-blocks-link": "^9.1.18",
105
- "@khanacademy/wonder-blocks-pill": "^3.1.33",
106
- "@khanacademy/wonder-blocks-popover": "^6.1.21",
107
- "@khanacademy/wonder-blocks-progress-spinner": "^3.1.29",
108
- "@khanacademy/wonder-blocks-switch": "^3.3.11",
109
- "@khanacademy/wonder-blocks-tokens": "^12.0.0",
110
- "@khanacademy/wonder-blocks-tooltip": "^4.1.35",
111
- "@khanacademy/wonder-blocks-typography": "^4.2.14",
98
+ "@khanacademy/wonder-blocks-dropdown": "^10.3.0",
99
+ "@khanacademy/wonder-blocks-form": "^7.3.1",
100
+ "@khanacademy/wonder-blocks-icon": "^5.2.13",
101
+ "@khanacademy/wonder-blocks-icon-button": "^10.3.14",
102
+ "@khanacademy/wonder-blocks-labeled-field": "^3.2.2",
103
+ "@khanacademy/wonder-blocks-layout": "^3.1.30",
104
+ "@khanacademy/wonder-blocks-link": "^9.1.19",
105
+ "@khanacademy/wonder-blocks-pill": "^3.1.34",
106
+ "@khanacademy/wonder-blocks-popover": "^6.1.22",
107
+ "@khanacademy/wonder-blocks-progress-spinner": "^3.1.30",
108
+ "@khanacademy/wonder-blocks-switch": "^3.3.12",
109
+ "@khanacademy/wonder-blocks-tokens": "^12.0.1",
110
+ "@khanacademy/wonder-blocks-tooltip": "^4.1.36",
111
+ "@khanacademy/wonder-blocks-typography": "^4.2.15",
112
112
  "@khanacademy/wonder-stuff-core": "^1.5.5",
113
113
  "@phosphor-icons/core": "^2.0.2",
114
114
  "@popperjs/core": "^2.10.2",