@khanacademy/perseus-core 23.0.2 → 23.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.
Files changed (37) hide show
  1. package/dist/data-schema.d.ts +1 -0
  2. package/dist/es/index.item-splitting.js +1 -1
  3. package/dist/es/index.item-splitting.js.map +1 -1
  4. package/dist/es/index.js +5 -5
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/feature-flags.d.ts +1 -1
  7. package/dist/index.d.ts +19 -19
  8. package/dist/index.item-splitting.js +1 -1
  9. package/dist/index.item-splitting.js.map +1 -1
  10. package/dist/index.js +5 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/parse-perseus-json/perseus-parsers/image-widget.d.ts +1 -0
  13. package/dist/parse-perseus-json/perseus-parsers/interactive-graph-widget.d.ts +0 -1
  14. package/dist/parse-perseus-json/perseus-parsers/widget-id-components.d.ts +0 -15
  15. package/dist/widgets/categorizer/categorizer-util.d.ts +1 -2
  16. package/dist/widgets/cs-program/cs-program-util.d.ts +1 -1
  17. package/dist/widgets/dropdown/dropdown-util.d.ts +1 -2
  18. package/dist/widgets/expression/expression-util.d.ts +1 -2
  19. package/dist/widgets/free-response/free-response-util.d.ts +2 -2
  20. package/dist/widgets/grapher/grapher-util.d.ts +1 -1
  21. package/dist/widgets/group/group-util.d.ts +2 -2
  22. package/dist/widgets/iframe/iframe-util.d.ts +1 -1
  23. package/dist/widgets/image/index.d.ts +1 -1
  24. package/dist/widgets/input-number/input-number-util.d.ts +2 -2
  25. package/dist/widgets/interactive-graph/interactive-graph-util.d.ts +1 -1
  26. package/dist/widgets/label-image/label-image-util.d.ts +1 -1
  27. package/dist/widgets/logic-export.types.d.ts +20 -20
  28. package/dist/widgets/matcher/matcher-util.d.ts +1 -2
  29. package/dist/widgets/matrix/matrix-util.d.ts +1 -1
  30. package/dist/widgets/number-line/number-line-util.d.ts +1 -1
  31. package/dist/widgets/numeric-input/numeric-input-util.d.ts +2 -2
  32. package/dist/widgets/orderer/orderer-util.d.ts +1 -2
  33. package/dist/widgets/plotter/plotter-util.d.ts +1 -2
  34. package/dist/widgets/radio/radio-util.d.ts +2 -2
  35. package/dist/widgets/sorter/sorter-util.d.ts +1 -2
  36. package/dist/widgets/table/table-util.d.ts +1 -1
  37. package/package.json +2 -2
@@ -13,6 +13,7 @@ export declare const parseImageWidget: import("../parser-types").Parser<import("
13
13
  bottom: number | undefined;
14
14
  scale: number | undefined;
15
15
  }>;
16
+ scale: number | undefined;
16
17
  static: boolean | undefined;
17
18
  labels: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
18
19
  content: string;
@@ -58,7 +58,6 @@ export declare const parsePerseusGraphType: import("../parser-types").Parser<imp
58
58
  coords: [number, number][] | null | undefined;
59
59
  startCoords: [number, number][] | undefined;
60
60
  }>>;
61
- export declare const parseStrokeWeight: import("../parser-types").Parser<"thin" | "medium" | "thick">;
62
61
  export declare const parseLockedFunctionDomain: import("../parser-types").Parser<[number, number]>;
63
62
  export declare const parseInteractiveGraphWidget: import("../parser-types").Parser<import("../..").WidgetOptions<"interactive-graph", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
64
63
  step: [number, number];
@@ -1,19 +1,4 @@
1
1
  import type { Parser } from "../parser-types";
2
- /**
3
- * Parses a string representation of a non-negative integer.
4
- *
5
- * This parser is used for the numeric part of widget IDs (e.g., the "1" in "radio 1").
6
- * It accepts string representations of non-negative integers, including "0".
7
- *
8
- * Note: The article renderer allows widget IDs with 0 (at least for image widgets),
9
- * but if widget IDs in an exercise contain 0, the exercise renderer may have issues.
10
- * We allow 0 here for compatibility with articles.
11
- *
12
- * @param rawValue - The raw value to parse, expected to be a string
13
- * @param ctx - The parse context for error reporting
14
- * @returns A ParseResult containing either the parsed number or an error
15
- */
16
- export declare const parseStringToNonNegativeInt: Parser<number>;
17
2
  /**
18
3
  * Parses widget ID components into a [type, number] tuple.
19
4
  *
@@ -13,5 +13,4 @@ export type CategorizerPublicWidgetOptions = {
13
13
  * Given a PerseusCategorizerWidgetOptions object, return a new object with only
14
14
  * the public options that should be exposed to the client.
15
15
  */
16
- declare function getCategorizerPublicWidgetOptions(options: PerseusCategorizerWidgetOptions): CategorizerPublicWidgetOptions;
17
- export default getCategorizerPublicWidgetOptions;
16
+ export declare function getCategorizerPublicWidgetOptions(options: PerseusCategorizerWidgetOptions): CategorizerPublicWidgetOptions;
@@ -1,2 +1,2 @@
1
1
  import type { PerseusCSProgramWidgetOptions } from "../../data-schema";
2
- export default function getCSProgramPublicWidgetOptions(options: PerseusCSProgramWidgetOptions): PerseusCSProgramWidgetOptions;
2
+ export declare function getCSProgramPublicWidgetOptions(options: PerseusCSProgramWidgetOptions): PerseusCSProgramWidgetOptions;
@@ -16,5 +16,4 @@ export type DropdownPublicWidgetOptions = {
16
16
  * Given a PerseusDropdownWidgetOptions object, return a new object with only
17
17
  * the public options that should be exposed to the client.
18
18
  */
19
- declare function getDropdownPublicWidgetOptions(options: PerseusDropdownWidgetOptions): DropdownPublicWidgetOptions;
20
- export default getDropdownPublicWidgetOptions;
19
+ export declare function getDropdownPublicWidgetOptions(options: PerseusDropdownWidgetOptions): DropdownPublicWidgetOptions;
@@ -16,5 +16,4 @@ export type ExpressionPublicWidgetOptions = {
16
16
  * Given a PerseusExpressionWidgetOptions object, return a new object with only
17
17
  * the public options that should be exposed to the client.
18
18
  */
19
- declare function getExpressionPublicWidgetOptions(options: PerseusExpressionWidgetOptions): ExpressionPublicWidgetOptions;
20
- export default getExpressionPublicWidgetOptions;
19
+ export declare function getExpressionPublicWidgetOptions(options: PerseusExpressionWidgetOptions): ExpressionPublicWidgetOptions;
@@ -13,5 +13,5 @@ type FreeResponsePublicWidgetOptions = {
13
13
  * Given a FreeResponsePublicWidgetOptions object, return a new object with only
14
14
  * the public options that should be exposed to the client.
15
15
  */
16
- declare function getFreeResponsePublicWidgetOptions(options: PerseusFreeResponseWidgetOptions): FreeResponsePublicWidgetOptions;
17
- export default getFreeResponsePublicWidgetOptions;
16
+ export declare function getFreeResponsePublicWidgetOptions(options: PerseusFreeResponseWidgetOptions): FreeResponsePublicWidgetOptions;
17
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { PerseusGrapherWidgetOptions } from "../../data-schema";
2
2
  export type GrapherPublicWidgetOptions = Pick<PerseusGrapherWidgetOptions, "availableTypes" | "graph">;
3
- export default function getGrapherPublicWidgetOptions(options: PerseusGrapherWidgetOptions): GrapherPublicWidgetOptions;
3
+ export declare function getGrapherPublicWidgetOptions(options: PerseusGrapherWidgetOptions): GrapherPublicWidgetOptions;
@@ -8,5 +8,5 @@ type GroupPublicWidgetOptions = PerseusRenderer;
8
8
  * Given a PerseusGroupWidgetOptions object, return a new object with only
9
9
  * the public options that should be exposed to the client.
10
10
  */
11
- declare function getGroupPublicWidgetOptions(options: PerseusGroupWidgetOptions): GroupPublicWidgetOptions;
12
- export default getGroupPublicWidgetOptions;
11
+ export declare function getGroupPublicWidgetOptions(options: PerseusGroupWidgetOptions): GroupPublicWidgetOptions;
12
+ export {};
@@ -1,2 +1,2 @@
1
1
  import type { PerseusIFrameWidgetOptions } from "../../data-schema";
2
- export default function getIFramePublicWidgetOptions(options: PerseusIFrameWidgetOptions): PerseusIFrameWidgetOptions;
2
+ export declare function getIFramePublicWidgetOptions(options: PerseusIFrameWidgetOptions): PerseusIFrameWidgetOptions;
@@ -1,5 +1,5 @@
1
1
  import type { PerseusImageWidgetOptions } from "../../data-schema";
2
2
  import type { WidgetLogic } from "../logic-export.types";
3
- export type ImageDefaultWidgetOptions = Pick<PerseusImageWidgetOptions, "title" | "range" | "box" | "backgroundImage" | "labels" | "alt" | "caption">;
3
+ export type ImageDefaultWidgetOptions = Pick<PerseusImageWidgetOptions, "title" | "range" | "box" | "backgroundImage" | "scale" | "labels" | "alt" | "caption">;
4
4
  declare const imageWidgetLogic: WidgetLogic;
5
5
  export default imageWidgetLogic;
@@ -8,5 +8,5 @@ type InputNumberPublicWidgetOptions = Pick<PerseusInputNumberWidgetOptions, "ans
8
8
  * Given a PerseusInputNumberWidgetOptions object, return a new object with only
9
9
  * the public options that should be exposed to the client.
10
10
  */
11
- declare function getInputNumberPublicWidgetOptions(options: PerseusInputNumberWidgetOptions): InputNumberPublicWidgetOptions;
12
- export default getInputNumberPublicWidgetOptions;
11
+ export declare function getInputNumberPublicWidgetOptions(options: PerseusInputNumberWidgetOptions): InputNumberPublicWidgetOptions;
12
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { PerseusInteractiveGraphWidgetOptions } from "../../data-schema";
2
2
  export type InteractiveGraphPublicWidgetOptions = Pick<PerseusInteractiveGraphWidgetOptions, "step" | "gridStep" | "snapStep" | "backgroundImage" | "markings" | "labels" | "showProtractor" | "showRuler" | "showTooltips" | "rulerLabel" | "rulerTicks" | "range" | "graph" | "lockedFigures" | "fullGraphAriaLabel" | "fullGraphAriaDescription">;
3
- export default function getInteractiveGraphPublicWidgetOptions(options: PerseusInteractiveGraphWidgetOptions): InteractiveGraphPublicWidgetOptions;
3
+ export declare function getInteractiveGraphPublicWidgetOptions(options: PerseusInteractiveGraphWidgetOptions): InteractiveGraphPublicWidgetOptions;
@@ -15,5 +15,5 @@ export type LabelImagePublicWidgetOptions = {
15
15
  static: PerseusLabelImageWidgetOptions["static"];
16
16
  };
17
17
  export type LabelImageMarkerPublicData = Pick<PerseusLabelImageMarker, "x" | "y" | "label">;
18
- export default function getLabelImagePublicWidgetOptions(options: PerseusLabelImageWidgetOptions): LabelImagePublicWidgetOptions;
18
+ export declare function getLabelImagePublicWidgetOptions(options: PerseusLabelImageWidgetOptions): LabelImagePublicWidgetOptions;
19
19
  export declare function isLabelImageAccessible(options: PerseusWidgetOptions): boolean;
@@ -1,23 +1,23 @@
1
- import type getCategorizerPublicWidgetOptions from "./categorizer/categorizer-util";
2
- import type getCSProgramPublicWidgetOptions from "./cs-program/cs-program-util";
3
- import type getDropdownPublicWidgetOptions from "./dropdown/dropdown-util";
4
- import type getExpressionPublicWidgetOptions from "./expression/expression-util";
5
- import type getFreeResponsePublicWidgetOptions from "./free-response/free-response-util";
6
- import type getGrapherPublicWidgetOptions from "./grapher/grapher-util";
7
- import type getGroupPublicWidgetOptions from "./group/group-util";
8
- import type getIFramePublicWidgetOptions from "./iframe/iframe-util";
9
- import type getInputNumberPublicWidgetOptions from "./input-number/input-number-util";
10
- import type getInteractiveGraphPublicWidgetOptions from "./interactive-graph/interactive-graph-util";
11
- import type getLabelImagePublicWidgetOptions from "./label-image/label-image-util";
12
- import type getMatcherPublicWidgetOptions from "./matcher/matcher-util";
13
- import type getMatrixPublicWidgetOptions from "./matrix/matrix-util";
14
- import type getNumberLinePublicWidgetOptions from "./number-line/number-line-util";
15
- import type getNumericInputPublicWidgetOptions from "./numeric-input/numeric-input-util";
16
- import type getOrdererPublicWidgetOptions from "./orderer/orderer-util";
17
- import type getPlotterPublicWidgetOptions from "./plotter/plotter-util";
18
- import type getRadioPublicWidgetOptions from "./radio/radio-util";
19
- import type getSorterPublicWidgetOptions from "./sorter/sorter-util";
20
- import type getTablePublicWidgetOptions from "./table/table-util";
1
+ import type { getCategorizerPublicWidgetOptions } from "./categorizer/categorizer-util";
2
+ import type { getCSProgramPublicWidgetOptions } from "./cs-program/cs-program-util";
3
+ import type { getDropdownPublicWidgetOptions } from "./dropdown/dropdown-util";
4
+ import type { getExpressionPublicWidgetOptions } from "./expression/expression-util";
5
+ import type { getFreeResponsePublicWidgetOptions } from "./free-response/free-response-util";
6
+ import type { getGrapherPublicWidgetOptions } from "./grapher/grapher-util";
7
+ import type { getGroupPublicWidgetOptions } from "./group/group-util";
8
+ import type { getIFramePublicWidgetOptions } from "./iframe/iframe-util";
9
+ import type { getInputNumberPublicWidgetOptions } from "./input-number/input-number-util";
10
+ import type { getInteractiveGraphPublicWidgetOptions } from "./interactive-graph/interactive-graph-util";
11
+ import type { getLabelImagePublicWidgetOptions } from "./label-image/label-image-util";
12
+ import type { getMatcherPublicWidgetOptions } from "./matcher/matcher-util";
13
+ import type { getMatrixPublicWidgetOptions } from "./matrix/matrix-util";
14
+ import type { getNumberLinePublicWidgetOptions } from "./number-line/number-line-util";
15
+ import type { getNumericInputPublicWidgetOptions } from "./numeric-input/numeric-input-util";
16
+ import type { getOrdererPublicWidgetOptions } from "./orderer/orderer-util";
17
+ import type { getPlotterPublicWidgetOptions } from "./plotter/plotter-util";
18
+ import type { getRadioPublicWidgetOptions } from "./radio/radio-util";
19
+ import type { getSorterPublicWidgetOptions } from "./sorter/sorter-util";
20
+ import type { getTablePublicWidgetOptions } from "./table/table-util";
21
21
  import type { PerseusWidgetOptions, Version } from "../data-schema";
22
22
  import type { Alignment } from "../types";
23
23
  export type WidgetOptionsUpgradeMap = {
@@ -16,5 +16,4 @@ export type MatcherPublicWidgetOptions = {
16
16
  * Given a PerseusMatcherWidgetOptions object, return a new object with only
17
17
  * the public options that should be exposed to the client.
18
18
  */
19
- declare function getMatcherPublicWidgetOptions(options: PerseusMatcherWidgetOptions): MatcherPublicWidgetOptions;
20
- export default getMatcherPublicWidgetOptions;
19
+ export declare function getMatcherPublicWidgetOptions(options: PerseusMatcherWidgetOptions): MatcherPublicWidgetOptions;
@@ -1,3 +1,3 @@
1
1
  import type { PerseusMatrixWidgetOptions } from "../../data-schema";
2
2
  export type MatrixPublicWidgetOptions = Pick<PerseusMatrixWidgetOptions, "prefix" | "suffix" | "cursorPosition" | "matrixBoardSize" | "static">;
3
- export default function getMatrixPublicWidgetOptions(options: PerseusMatrixWidgetOptions): MatrixPublicWidgetOptions;
3
+ export declare function getMatrixPublicWidgetOptions(options: PerseusMatrixWidgetOptions): MatrixPublicWidgetOptions;
@@ -1,3 +1,3 @@
1
1
  import type { PerseusNumberLineWidgetOptions } from "../../data-schema";
2
2
  export type NumberLinePublicWidgetOptions = Pick<PerseusNumberLineWidgetOptions, "range" | "labelRange" | "labelStyle" | "labelTicks" | "isTickCtrl" | "isInequality" | "divisionRange" | "numDivisions" | "snapDivisions" | "tickStep" | "initialX" | "showTooltips" | "static">;
3
- export default function getNumberLinePublicWidgetOptions(options: PerseusNumberLineWidgetOptions): NumberLinePublicWidgetOptions;
3
+ export declare function getNumberLinePublicWidgetOptions(options: PerseusNumberLineWidgetOptions): NumberLinePublicWidgetOptions;
@@ -16,5 +16,5 @@ type NumericInputPublicWidgetOptions = {
16
16
  * Given a PerseusNumericInputWidgetOptions object, return a new object with only
17
17
  * the public options that should be exposed to the client.
18
18
  */
19
- declare function getNumericInputPublicWidgetOptions(options: PerseusNumericInputWidgetOptions): NumericInputPublicWidgetOptions;
20
- export default getNumericInputPublicWidgetOptions;
19
+ export declare function getNumericInputPublicWidgetOptions(options: PerseusNumericInputWidgetOptions): NumericInputPublicWidgetOptions;
20
+ export {};
@@ -8,5 +8,4 @@ export type OrdererPublicWidgetOptions = Pick<PerseusOrdererWidgetOptions, "opti
8
8
  * Given a PerseusOrdererWidgetOptions object, return a new object with only
9
9
  * the public options that should be exposed to the client.
10
10
  */
11
- declare function getOrdererPublicWidgetOptions(fullOptions: PerseusOrdererWidgetOptions): OrdererPublicWidgetOptions;
12
- export default getOrdererPublicWidgetOptions;
11
+ export declare function getOrdererPublicWidgetOptions(fullOptions: PerseusOrdererWidgetOptions): OrdererPublicWidgetOptions;
@@ -8,5 +8,4 @@ export type PlotterPublicWidgetOptions = Omit<PerseusPlotterWidgetOptions, "corr
8
8
  * Given a PerseusPlotterWidgetOptions object, return a new object with only
9
9
  * the public options that should be exposed to the client.
10
10
  */
11
- declare function getPlotterPublicWidgetOptions(options: PerseusPlotterWidgetOptions): PlotterPublicWidgetOptions;
12
- export default getPlotterPublicWidgetOptions;
11
+ export declare function getPlotterPublicWidgetOptions(options: PerseusPlotterWidgetOptions): PlotterPublicWidgetOptions;
@@ -29,5 +29,5 @@ export declare function usesNumCorrect(multipleSelect: PerseusRadioWidgetOptions
29
29
  * Given a PerseusRadioWidgetOptions object, return a new object with only
30
30
  * the public options that should be exposed to the client.
31
31
  */
32
- declare function getRadioPublicWidgetOptions(options: PerseusRadioWidgetOptions): RadioPublicWidgetOptions;
33
- export default getRadioPublicWidgetOptions;
32
+ export declare function getRadioPublicWidgetOptions(options: PerseusRadioWidgetOptions): RadioPublicWidgetOptions;
33
+ export {};
@@ -12,6 +12,5 @@ export type SorterPublicWidgetOptions = {
12
12
  * Given a PerseusSorterWidgetOptions object, return a new object with only
13
13
  * the public options that should be exposed to the client.
14
14
  */
15
- declare function getSorterPublicWidgetOptions(options: PerseusSorterWidgetOptions): SorterPublicWidgetOptions;
15
+ export declare function getSorterPublicWidgetOptions(options: PerseusSorterWidgetOptions): SorterPublicWidgetOptions;
16
16
  export declare function shuffleSorter(options: Pick<SorterPublicWidgetOptions, "correct">, problemNum: number): string[];
17
- export default getSorterPublicWidgetOptions;
@@ -1,4 +1,4 @@
1
1
  import type { PerseusTableWidgetOptions } from "../../data-schema";
2
2
  type TablePublicWidgetOptions = Pick<PerseusTableWidgetOptions, "headers" | "rows" | "columns">;
3
- export default function getTablePublicWidgetOptions(options: PerseusTableWidgetOptions): TablePublicWidgetOptions;
3
+ export declare function getTablePublicWidgetOptions(options: PerseusTableWidgetOptions): TablePublicWidgetOptions;
4
4
  export {};
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": "23.0.2",
6
+ "version": "23.2.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -37,7 +37,7 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "tiny-invariant": "1.3.1",
40
- "@khanacademy/kas": "2.1.7",
40
+ "@khanacademy/kas": "2.1.8",
41
41
  "@khanacademy/perseus-utils": "2.1.4",
42
42
  "@khanacademy/pure-markdown": "2.2.6"
43
43
  },