@khanacademy/perseus 85.0.0 → 85.1.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.
@@ -1,10 +1,15 @@
1
1
  import WrappedDrawing from "./wrapped-drawing";
2
2
  import type { Coord } from "./types";
3
3
  import type { VisibleShape } from "./wrapped-drawing";
4
+ export declare const wrappedEllipseShadow: string;
4
5
  declare class WrappedEllipse extends WrappedDrawing {
5
6
  initialPoint: Coord;
6
7
  wrapper: HTMLDivElement;
7
8
  visibleShape: VisibleShape;
8
9
  constructor(graphie: any, center: Coord, radii: [number, number], options: any);
10
+ /**
11
+ * Turns the ellipse's drop shadow on or off.
12
+ */
13
+ setShadow(shadow: boolean): void;
9
14
  }
10
15
  export default WrappedEllipse;
@@ -1,13 +1,11 @@
1
1
  import * as React from "react";
2
- import type { PerseusDependenciesV2, WidgetProps } from "../../types";
2
+ import type { Widget, WidgetProps } from "../../types";
3
3
  import type { PerseusExplanationWidgetOptions } from "@khanacademy/perseus-core";
4
- type Props = WidgetProps<PerseusExplanationWidgetOptions> & {
5
- dependencies: PerseusDependenciesV2;
6
- };
4
+ type Props = WidgetProps<PerseusExplanationWidgetOptions>;
7
5
  declare const _default: {
8
6
  name: string;
9
7
  displayName: string;
10
- widget: React.ForwardRefExoticComponent<Omit<Props, "dependencies"> & React.RefAttributes<any>>;
8
+ widget: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
11
9
  isLintable: true;
12
10
  };
13
11
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { Widget, WidgetProps } from "../../types";
3
- import type { PerseusExpressionRubric, PerseusExpressionUserInput, PerseusExpressionWidgetOptions } from "@khanacademy/perseus-core";
3
+ import type { PerseusExpressionWidgetOptions, PerseusExpressionUserInput } from "@khanacademy/perseus-core";
4
4
  type Props = WidgetProps<PerseusExpressionWidgetOptions, PerseusExpressionUserInput>;
5
5
  export declare const Expression: React.ForwardRefExoticComponent<Props & React.RefAttributes<Widget>>;
6
6
  /**
@@ -9,7 +9,7 @@ export declare const Expression: React.ForwardRefExoticComponent<Props & React.R
9
9
  */
10
10
  declare function getUserInputFromSerializedState(serializedState: any): PerseusExpressionUserInput;
11
11
  declare function getStartUserInput(): PerseusExpressionUserInput;
12
- declare function getOneCorrectAnswerFromRubric(rubric: PerseusExpressionRubric): string | null | undefined;
12
+ declare function getOneCorrectAnswerFromRubric(rubric: PerseusExpressionWidgetOptions): string | null | undefined;
13
13
  declare function getCorrectUserInput(options: PerseusExpressionWidgetOptions): PerseusExpressionUserInput;
14
14
  declare const _default: {
15
15
  name: string;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { FunctionTypeMappingKeys } from "@khanacademy/perseus-core";
3
+ interface Props {
4
+ type: FunctionTypeMappingKeys;
5
+ label: string;
6
+ }
7
+ export default function FunctionTypeIcon({ type, label }: Props): React.JSX.Element;
8
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { PerseusStrings } from "../../strings";
2
- import type { PerseusNumericInputAnswerForm, PerseusNumericInputRubric, PerseusNumericInputUserInput, PerseusNumericInputWidgetOptions } from "@khanacademy/perseus-core";
2
+ import type { PerseusNumericInputAnswerForm, PerseusNumericInputWidgetOptions, PerseusNumericInputUserInput } from "@khanacademy/perseus-core";
3
3
  /**
4
4
  * Generates the specific set of examples for the current question.
5
5
  * This string is shown as examples to the user in a tooltip.
@@ -33,4 +33,4 @@ export declare function findCommonFractions(value: number): {
33
33
  denom: number;
34
34
  } | undefined;
35
35
  export declare function getCorrectUserInput(options: PerseusNumericInputWidgetOptions): PerseusNumericInputUserInput;
36
- export declare function getOneCorrectAnswerFromRubric(rubric: PerseusNumericInputRubric): string | null | undefined;
36
+ export declare function getOneCorrectAnswerFromRubric(rubric: PerseusNumericInputWidgetOptions): string | null | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { WidgetProps, ChoiceState, Widget } from "../../types";
3
3
  import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
4
- import type { PerseusRadioChoice, PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-core";
4
+ import type { PerseusRadioChoice, PerseusRadioWidgetOptions, PerseusRadioUserInput } from "@khanacademy/perseus-core";
5
5
  /**
6
6
  * Represents a single choice in the RadioComponent
7
7
  */
@@ -35,7 +35,7 @@ export interface RadioChoiceWithMetadata extends PerseusRadioChoice {
35
35
  originalIndex: number;
36
36
  correct?: boolean;
37
37
  }
38
- type Props = WidgetProps<RadioProps, PerseusRadioUserInput, PerseusRadioRubric>;
38
+ type Props = WidgetProps<RadioProps, PerseusRadioUserInput, PerseusRadioWidgetOptions>;
39
39
  declare class Radio extends React.Component<Props> implements Widget {
40
40
  radioRef: React.RefObject<RadioWidgetHandle>;
41
41
  /**
@@ -1 +1,73 @@
1
- export { default } from "./sorter";
1
+ import type { SorterPublicWidgetOptions, PerseusSorterUserInput } from "@khanacademy/perseus-core";
2
+ declare function getStartUserInput(options: SorterPublicWidgetOptions, problemNum: number): PerseusSorterUserInput;
3
+ /**
4
+ * @deprecated and likely a very broken API
5
+ * [LEMS-3185] do not trust serializedState
6
+ */
7
+ declare function getUserInputFromSerializedState(serializedState: any): PerseusSorterUserInput;
8
+ declare const _default: {
9
+ name: string;
10
+ displayName: string;
11
+ widget: import("react").ForwardRefExoticComponent<{
12
+ options: import("@khanacademy/perseus-core").PerseusSorterWidgetOptions;
13
+ trackInteraction: (extraData?: Empty | undefined) => void;
14
+ widgetId: string;
15
+ widgetIndex: number;
16
+ alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
17
+ static: boolean | null | undefined;
18
+ graded?: boolean | null;
19
+ problemNum: number | null | undefined;
20
+ apiOptions: Readonly<Readonly<{
21
+ isArticle?: boolean;
22
+ onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
23
+ showAlignmentOptions?: boolean;
24
+ readOnly?: boolean;
25
+ editingDisabled?: boolean;
26
+ answerableCallback?: (arg1: boolean) => unknown;
27
+ getAnotherHint?: () => unknown;
28
+ interactionCallback?: (widgetData: {
29
+ [widgetId: string]: any;
30
+ }) => void;
31
+ imagePlaceholder?: React.ReactNode;
32
+ widgetPlaceholder?: React.ReactNode;
33
+ baseElements?: {
34
+ Link: React.ComponentType<any>;
35
+ };
36
+ trackInteraction?: (args: {
37
+ type: string;
38
+ id: string;
39
+ correct?: boolean;
40
+ } & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
41
+ visible: number;
42
+ }>) => void;
43
+ customKeypad?: boolean;
44
+ isMobile?: boolean;
45
+ isMobileApp?: boolean;
46
+ hintProgressColor?: string;
47
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
48
+ }> & {
49
+ baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
50
+ isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
51
+ isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
52
+ isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
53
+ editingDisabled: NonNullable<import("../..").APIOptions["editingDisabled"]>;
54
+ onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
55
+ readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
56
+ showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
57
+ }>;
58
+ keypadElement?: any;
59
+ onFocus: (blurPath: import("../..").FocusPath) => void;
60
+ onBlur: (blurPath: import("../..").FocusPath) => void;
61
+ findWidgets: import("../../types").FindWidgetsFunction;
62
+ reviewMode: boolean;
63
+ showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
64
+ handleUserInput: (newUserInput: PerseusSorterUserInput, cb?: () => void, silent?: boolean) => void;
65
+ userInput: PerseusSorterUserInput;
66
+ linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
67
+ containerSizeClass: import("../../util/sizing-utils").SizeClass;
68
+ } & import("react").RefAttributes<import("./sorter").SorterHandle>>;
69
+ isLintable: true;
70
+ getStartUserInput: typeof getStartUserInput;
71
+ getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
72
+ };
73
+ export default _default;
@@ -1,21 +1,16 @@
1
1
  import * as React from "react";
2
- import type { PerseusDependenciesV2, WidgetProps } from "../../types";
3
- import type { PerseusSorterWidgetOptions, PerseusSorterUserInput, SorterPublicWidgetOptions } from "@khanacademy/perseus-core";
4
- type Props = WidgetProps<PerseusSorterWidgetOptions, PerseusSorterUserInput> & {
5
- dependencies: PerseusDependenciesV2;
6
- };
7
- declare function getStartUserInput(options: SorterPublicWidgetOptions, problemNum: number): PerseusSorterUserInput;
8
- /**
9
- * @deprecated and likely a very broken API
10
- * [LEMS-3185] do not trust serializedState
11
- */
12
- declare function getUserInputFromSerializedState(serializedState: any): PerseusSorterUserInput;
13
- declare const _default: {
14
- name: string;
15
- displayName: string;
16
- widget: React.ForwardRefExoticComponent<Omit<Props, "dependencies"> & React.RefAttributes<any>>;
17
- isLintable: true;
18
- getStartUserInput: typeof getStartUserInput;
19
- getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
20
- };
21
- export default _default;
2
+ import type { SortableOption } from "../../components/sortable";
3
+ import type { Widget, WidgetProps } from "../../types";
4
+ import type { PerseusSorterWidgetOptions, PerseusSorterUserInput } from "@khanacademy/perseus-core";
5
+ type Props = WidgetProps<PerseusSorterWidgetOptions, PerseusSorterUserInput>;
6
+ export interface SorterHandle extends Widget {
7
+ /**
8
+ * Programatic API for moving options. This is used by testing.
9
+ *
10
+ * @deprecated prefer user interaction testing over backdoor
11
+ * state manipulation
12
+ */
13
+ moveOptionToIndex: (option: SortableOption, index: number) => void;
14
+ }
15
+ declare const Sorter: React.ForwardRefExoticComponent<Props & React.RefAttributes<SorterHandle>>;
16
+ export default Sorter;
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": "85.0.0",
6
+ "version": "85.1.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -45,12 +45,12 @@
45
45
  "uuid": "^10.0.0",
46
46
  "jquery": "^2.1.1",
47
47
  "@khanacademy/kas": "2.2.6",
48
- "@khanacademy/keypad-context": "3.2.85",
49
- "@khanacademy/kmath": "2.4.44",
50
- "@khanacademy/math-input": "27.0.5",
51
- "@khanacademy/perseus-core": "37.0.0",
52
- "@khanacademy/perseus-linter": "5.1.25",
53
- "@khanacademy/perseus-score": "8.12.17",
48
+ "@khanacademy/keypad-context": "3.2.87",
49
+ "@khanacademy/kmath": "2.4.46",
50
+ "@khanacademy/math-input": "27.0.8",
51
+ "@khanacademy/perseus-core": "38.0.1",
52
+ "@khanacademy/perseus-linter": "5.2.0",
53
+ "@khanacademy/perseus-score": "8.12.19",
54
54
  "@khanacademy/perseus-utils": "2.1.5",
55
55
  "@khanacademy/pure-markdown": "2.3.2",
56
56
  "@khanacademy/simple-markdown": "3.0.1"