@khanacademy/perseus-core 39.1.0 → 39.2.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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Parses one tile in a Drag And Drop widget's choice bank. Shared across the
3
+ * widget family, like `PerseusAnswerTile`.
4
+ */
5
+ export declare const parseAnswerTile: import("../parser-types").Parser<import("../general-purpose-parsers/object-types").OptionalizeProperties<{
6
+ id: string;
7
+ content: string;
8
+ label: string;
9
+ imageHeight: number | undefined;
10
+ }>>;
@@ -0,0 +1,24 @@
1
+ import type { Parser } from "../parser-types";
2
+ export declare const parseFillInTheBlankWidget: Parser<import("../general-purpose-parsers/object-types").OptionalizeProperties<{
3
+ type: "fill-in-the-blank";
4
+ static: boolean | undefined;
5
+ graded: boolean | undefined;
6
+ alignment: "default" | "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
7
+ options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
8
+ content: string;
9
+ widgets: import("../..").MakeWidgetMap<import("../..").PerseusWidgetTypes>;
10
+ tiles: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
11
+ id: string;
12
+ content: string;
13
+ label: string;
14
+ imageHeight: number | undefined;
15
+ }>[];
16
+ maxUsesPerTile: number | "unlimited";
17
+ randomize: boolean;
18
+ }>;
19
+ key: number | null | undefined;
20
+ version: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
21
+ major: number;
22
+ minor: number;
23
+ }> | undefined;
24
+ }>>;
@@ -0,0 +1,4 @@
1
+ import type { FillInTheBlankWidget, PerseusAnswerTile, PerseusFillInTheBlankWidgetOptions } from "../../data-schema";
2
+ export declare function generateAnswerTile(tile?: Partial<PerseusAnswerTile>): PerseusAnswerTile;
3
+ export declare function generateFillInTheBlankOptions(options?: Partial<PerseusFillInTheBlankWidgetOptions>): PerseusFillInTheBlankWidgetOptions;
4
+ export declare function generateFillInTheBlankWidget(fillInTheBlankWidgetProperties?: Partial<Omit<FillInTheBlankWidget, "type">>): FillInTheBlankWidget;
@@ -1,7 +1,11 @@
1
- import type { PerseusRenderer } from "../data-schema";
1
+ import type { PerseusRenderer, PerseusWidgetsMap } from "../data-schema";
2
2
  /**
3
3
  * Return a copy of a PerseusRenderer with rubric data removed (ie answers)
4
4
  *
5
5
  * @param original - the original, full PerseusRenderer (which includes the rubric - aka answer data)
6
6
  */
7
7
  export default function splitPerseusRenderer(original: PerseusRenderer): PerseusRenderer;
8
+ /**
9
+ * Return a copy of a widgets map with rubric data removed (ie answers).
10
+ */
11
+ export declare function splitWidgetsMap(widgets: PerseusWidgetsMap): PerseusWidgetsMap;
@@ -0,0 +1,7 @@
1
+ import type { PerseusFillInTheBlankWidgetOptions } from "../../data-schema";
2
+ export type FillInTheBlankPublicWidgetOptions = PerseusFillInTheBlankWidgetOptions;
3
+ /**
4
+ * Given a PerseusFillInTheBlankWidgetOptions object, return a new object with
5
+ * only the public options that should be exposed to the client.
6
+ */
7
+ export declare function getFillInTheBlankPublicWidgetOptions(options: PerseusFillInTheBlankWidgetOptions): FillInTheBlankPublicWidgetOptions;
@@ -0,0 +1,5 @@
1
+ import type { FillInTheBlankPublicWidgetOptions } from "./fill-in-the-blank-util";
2
+ import type { PerseusFillInTheBlankWidgetOptions } from "../../data-schema";
3
+ import type { WidgetLogic } from "../logic-export.types";
4
+ declare const fillInTheBlankWidgetLogic: WidgetLogic<PerseusFillInTheBlankWidgetOptions, FillInTheBlankPublicWidgetOptions>;
5
+ export default fillInTheBlankWidgetLogic;
@@ -2,6 +2,7 @@ import type { getCategorizerPublicWidgetOptions } from "./categorizer/categorize
2
2
  import type { getCSProgramPublicWidgetOptions } from "./cs-program/cs-program-util";
3
3
  import type { getDropdownPublicWidgetOptions } from "./dropdown/dropdown-util";
4
4
  import type { getExpressionPublicWidgetOptions } from "./expression/expression-util";
5
+ import type { getFillInTheBlankPublicWidgetOptions } from "./fill-in-the-blank/fill-in-the-blank-util";
5
6
  import type { getFreeResponsePublicWidgetOptions } from "./free-response/free-response-util";
6
7
  import type { getGrapherPublicWidgetOptions } from "./grapher/grapher-util";
7
8
  import type { getGroupPublicWidgetOptions } from "./group/group-util";
@@ -28,7 +29,7 @@ export type WidgetOptionsUpgradeMap = {
28
29
  * TODO(LEMS-2870): figure out how to make this generic so we don't need to be
29
30
  * so reliant on a set group of widgets
30
31
  */
31
- export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | 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;
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;
32
33
  export type WidgetLogic<TWidgetOptions = never, TPublicWidgetOptions = never> = {
33
34
  name: string;
34
35
  /**
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": "39.1.0",
6
+ "version": "39.2.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },