@khanacademy/perseus-core 0.0.0-PR3112-20251211005801 → 0.0.0-PR3112-20251217214834

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.
@@ -12,72 +12,10 @@ export declare function generateIGQuadraticGraph(options?: Partial<Omit<PerseusG
12
12
  export declare function generateIGRayGraph(options?: Partial<Omit<PerseusGraphTypeRay, "type">>): PerseusGraphTypeRay;
13
13
  export declare function generateIGSegmentGraph(options?: Partial<Omit<PerseusGraphTypeSegment, "type">>): PerseusGraphTypeSegment;
14
14
  export declare function generateIGSinusoidGraph(options?: Partial<Omit<PerseusGraphTypeSinusoid, "type">>): PerseusGraphTypeSinusoid;
15
- export declare function generateIGLockedPoint(options?: Partial<Omit<LockedPointType, "type">>): {
16
- ariaLabel?: string;
17
- labels: LockedLabelType[];
18
- color: import("../..").LockedFigureColor;
19
- coord: import("../..").Coord;
20
- filled: boolean;
21
- type: "point";
22
- };
23
- export declare function generateIGLockedLine(options?: Partial<Omit<LockedLineType, "type">>): {
24
- ariaLabel?: string;
25
- labels: LockedLabelType[];
26
- points: [point1: LockedPointType, point2: LockedPointType];
27
- color: import("../..").LockedFigureColor;
28
- kind: "line" | "ray" | "segment";
29
- lineStyle: import("../..").LockedLineStyle;
30
- showPoint1: boolean;
31
- showPoint2: boolean;
32
- weight: import("../..").StrokeWeight;
33
- type: "line";
34
- };
35
- export declare function generateIGLockedVector(options?: Partial<Omit<LockedVectorType, "type">>): {
36
- ariaLabel?: string;
37
- labels: LockedLabelType[];
38
- points: [tail: import("../..").Coord, tip: import("../..").Coord];
39
- color: import("../..").LockedFigureColor;
40
- weight: import("../..").StrokeWeight;
41
- type: "vector";
42
- };
43
- export declare function generateIGLockedEllipse(options?: Partial<Omit<LockedEllipseType, "type">>): {
44
- angle: number;
45
- ariaLabel?: string;
46
- labels: LockedLabelType[];
47
- color: import("../..").LockedFigureColor;
48
- center: import("../..").Coord;
49
- radius: [x: number, y: number];
50
- weight: import("../..").StrokeWeight;
51
- fillStyle: import("../..").LockedFigureFillType;
52
- strokeStyle: import("../..").LockedLineStyle;
53
- type: "ellipse";
54
- };
55
- export declare function generateIGLockedPolygon(options?: Partial<Omit<LockedPolygonType, "type">>): {
56
- ariaLabel?: string;
57
- labels: LockedLabelType[];
58
- points: import("../..").Coord[];
59
- color: import("../..").LockedFigureColor;
60
- weight: import("../..").StrokeWeight;
61
- fillStyle: import("../..").LockedFigureFillType;
62
- strokeStyle: import("../..").LockedLineStyle;
63
- showVertices: boolean;
64
- type: "polygon";
65
- };
66
- export declare function generateIGLockedFunction(options?: Partial<Omit<LockedFunctionType, "type">>): {
67
- ariaLabel?: string;
68
- labels: LockedLabelType[];
69
- color: import("../..").LockedFigureColor;
70
- weight: import("../..").StrokeWeight;
71
- strokeStyle: import("../..").LockedLineStyle;
72
- equation: string;
73
- directionalAxis: "x" | "y";
74
- domain: [min: number, max: number];
75
- type: "function";
76
- };
77
- export declare function generateIGLockedLabel(options?: Partial<Omit<LockedLabelType, "type">>): {
78
- size: "small" | "medium" | "large";
79
- text: string;
80
- color: import("../..").LockedFigureColor;
81
- coord: import("../..").Coord;
82
- type: "label";
83
- };
15
+ export declare function generateIGLockedPoint(options?: Partial<Omit<LockedPointType, "type">>): LockedPointType;
16
+ export declare function generateIGLockedLine(options?: Partial<Omit<LockedLineType, "type">>): LockedLineType;
17
+ export declare function generateIGLockedVector(options?: Partial<Omit<LockedVectorType, "type">>): LockedVectorType;
18
+ export declare function generateIGLockedEllipse(options?: Partial<Omit<LockedEllipseType, "type">>): LockedEllipseType;
19
+ export declare function generateIGLockedPolygon(options?: Partial<Omit<LockedPolygonType, "type">>): LockedPolygonType;
20
+ export declare function generateIGLockedFunction(options?: Partial<Omit<LockedFunctionType, "type">>): LockedFunctionType;
21
+ export declare function generateIGLockedLabel(options?: Partial<Omit<LockedLabelType, "type">>): LockedLabelType;
@@ -0,0 +1,3 @@
1
+ import type { PerseusLabelImageWidgetOptions, LabelImageWidget } from "../../data-schema";
2
+ export declare function generateLabelImageOptions(options?: Partial<PerseusLabelImageWidgetOptions>): PerseusLabelImageWidgetOptions;
3
+ export declare function generateLabelImageWidget(labelImageWidgetProperties?: Partial<Omit<LabelImageWidget, "type">>): LabelImageWidget;
@@ -28,7 +28,7 @@
28
28
  * } & Perseus<Widget>ValidationData;
29
29
  * ```
30
30
  */
31
- import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType, MakeWidgetMap, PerseusFreeResponseWidgetScoringCriterion } from "./data-schema";
31
+ import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType, MakeWidgetMap, PerseusFreeResponseWidgetScoringCriterion, PerseusRenderer } from "./data-schema";
32
32
  import type { ErrorCode } from "./error-codes";
33
33
  import type { Relationship } from "./types";
34
34
  export type WidgetValidatorFunction = (userInput: UserInput | undefined, validationData: ValidationData, locale: string) => ValidationResult;
@@ -72,9 +72,7 @@ export type PerseusExpressionRubric = {
72
72
  };
73
73
  export type PerseusExpressionUserInput = string;
74
74
  export type PerseusGroupRubric = PerseusGroupWidgetOptions;
75
- export type PerseusGroupValidationData = {
76
- widgets: ValidationDataMap;
77
- };
75
+ export type PerseusGroupValidationData = PerseusRenderer;
78
76
  export type PerseusGroupUserInput = UserInputMap;
79
77
  export type PerseusGradedGroupRubric = PerseusGradedGroupWidgetOptions;
80
78
  export type PerseusGradedGroupSetRubric = PerseusGradedGroupSetWidgetOptions;
@@ -267,24 +265,6 @@ export interface ValidationDataTypes {
267
265
  group: PerseusGroupValidationData;
268
266
  plotter: PerseusPlotterValidationData;
269
267
  }
270
- /**
271
- * A map of validation data, keyed by `widgetId`. This data is used to check if
272
- * a question is answerable. This data represents the minimal intersection of
273
- * data that's available in the client (widget options) and server (scoring
274
- * data) and is represented by a group of types known as "validation data".
275
- *
276
- * NOTE: The value in this map is intentionally a subset of WidgetOptions<T>.
277
- * By using the same shape (minus any unneeded data), we are able to pass a
278
- * `PerseusWidgetsMap` or ` into any function that accepts a
279
- * `ValidationDataMap` without any mutation of data.
280
- */
281
- export type ValidationDataMap = {
282
- [Property in keyof ValidationDataTypes as `${Property} ${number}`]: {
283
- type: Property;
284
- static?: boolean;
285
- options: ValidationDataTypes[Property];
286
- };
287
- };
288
268
  /**
289
269
  * A union type of all the different widget validation data types that exist.
290
270
  */
@@ -1,4 +1,4 @@
1
- import type { PerseusLabelImageMarker, PerseusLabelImageWidgetOptions } from "../../data-schema";
1
+ import type { PerseusLabelImageMarker, PerseusLabelImageWidgetOptions, PerseusWidgetOptions } from "../../data-schema";
2
2
  /**
3
3
  * For details on the individual options, see the
4
4
  * PerseusLabelImageWidgetOptions type
@@ -16,3 +16,4 @@ export type LabelImagePublicWidgetOptions = {
16
16
  };
17
17
  export type LabelImageMarkerPublicData = Pick<PerseusLabelImageMarker, "x" | "y" | "label">;
18
18
  export default function getLabelImagePublicWidgetOptions(options: PerseusLabelImageWidgetOptions): LabelImagePublicWidgetOptions;
19
+ export declare function isLabelImageAccessible(options: PerseusWidgetOptions): boolean;
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": "0.0.0-PR3112-20251211005801",
6
+ "version": "0.0.0-PR3112-20251217214834",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -1 +0,0 @@
1
- export {};