@khanacademy/perseus-core 40.1.0 → 41.0.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.
@@ -17,6 +17,7 @@ export declare const parseLabelImageWidget: import("../parser-types").Parser<imp
17
17
  }>[];
18
18
  hideChoicesFromInstructions: boolean;
19
19
  multipleAnswers: boolean;
20
+ preferredPopoverDirection: "UP" | "RIGHT" | "DOWN" | "LEFT" | "NONE" | undefined;
20
21
  }>;
21
22
  key: number | null | undefined;
22
23
  version: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
@@ -0,0 +1,45 @@
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
+ preferredPopoverDirection: string;
27
+ };
28
+ version: {
29
+ major: number;
30
+ minor: number;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ hints: never[];
36
+ answerArea: {
37
+ calculator: boolean;
38
+ financialCalculatorMonthlyPayment: boolean;
39
+ financialCalculatorTotalAmount: boolean;
40
+ financialCalculatorTimeToPayOff: boolean;
41
+ periodicTable: boolean;
42
+ periodicTableWithKey: boolean;
43
+ };
44
+ };
45
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import type { PerseusDefinitionWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const definitionWidgetLogic: WidgetLogic;
3
+ declare const definitionWidgetLogic: WidgetLogic<PerseusDefinitionWidgetOptions>;
3
4
  export default definitionWidgetLogic;
@@ -1,3 +1,3 @@
1
1
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const deprecatedStandinWidgetLogic: WidgetLogic;
2
+ declare const deprecatedStandinWidgetLogic: WidgetLogic<object>;
3
3
  export default deprecatedStandinWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusExplanationWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const explanationWidgetLogic: WidgetLogic;
3
+ declare const explanationWidgetLogic: WidgetLogic<PerseusExplanationWidgetOptions>;
3
4
  export default explanationWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusGradedGroupWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const gradedGroupWidgetLogic: WidgetLogic;
3
+ declare const gradedGroupWidgetLogic: WidgetLogic<PerseusGradedGroupWidgetOptions>;
3
4
  export default gradedGroupWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusGradedGroupSetWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const gradedGroupSetWidgetLogic: WidgetLogic;
3
+ declare const gradedGroupSetWidgetLogic: WidgetLogic<PerseusGradedGroupSetWidgetOptions>;
3
4
  export default gradedGroupSetWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusInteractionWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const interactionWidgetLogic: WidgetLogic;
3
+ declare const interactionWidgetLogic: WidgetLogic<PerseusInteractionWidgetOptions>;
3
4
  export default interactionWidgetLogic;
@@ -30,7 +30,7 @@ export type WidgetOptionsUpgradeMap = {
30
30
  * so reliant on a set group of widgets
31
31
  */
32
32
  export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getFillInTheBlankPublicWidgetOptions | typeof getFreeResponsePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getGroupPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getInputNumberPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getMatcherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getPlotterPublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getTablePublicWidgetOptions;
33
- export type WidgetLogic<TWidgetOptions = never, TPublicWidgetOptions = never> = {
33
+ export type WidgetLogic<TWidgetOptions, TPublicWidgetOptions = never> = {
34
34
  name: string;
35
35
  /**
36
36
  * The widget version. Any time the _major_ version changes, the widget
@@ -42,7 +42,7 @@ export type WidgetLogic<TWidgetOptions = never, TPublicWidgetOptions = never> =
42
42
  * This key defaults to `{major: 0, minor: 0}` if not provided.
43
43
  */
44
44
  version?: Version;
45
- defaultWidgetOptions?: any;
45
+ defaultWidgetOptions: TWidgetOptions;
46
46
  supportedAlignments?: ReadonlyArray<Alignment>;
47
47
  defaultAlignment?: Alignment;
48
48
  accessible?: boolean | ((options: TWidgetOptions) => boolean);
@@ -1,3 +1,4 @@
1
+ import type { PerseusMeasurerWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const measurerWidgetLogic: WidgetLogic;
3
+ declare const measurerWidgetLogic: WidgetLogic<PerseusMeasurerWidgetOptions>;
3
4
  export default measurerWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusPhetSimulationWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const phetSimulationWidgetLogic: WidgetLogic;
3
+ declare const phetSimulationWidgetLogic: WidgetLogic<PerseusPhetSimulationWidgetOptions>;
3
4
  export default phetSimulationWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusPythonProgramWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const pythonProgramWidgetLogic: WidgetLogic;
3
+ declare const pythonProgramWidgetLogic: WidgetLogic<PerseusPythonProgramWidgetOptions>;
3
4
  export default pythonProgramWidgetLogic;
@@ -1,3 +1,4 @@
1
+ import type { PerseusVideoWidgetOptions } from "../../data-schema";
1
2
  import type { WidgetLogic } from "../logic-export.types";
2
- declare const videoWidgetLogic: WidgetLogic;
3
+ declare const videoWidgetLogic: WidgetLogic<PerseusVideoWidgetOptions>;
3
4
  export default videoWidgetLogic;
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": "40.1.0",
6
+ "version": "41.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },