@khanacademy/perseus-core 0.0.0-PR3087-20251204170037 → 0.0.0-PR3089-20251204204906

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.
package/dist/es/index.js CHANGED
@@ -231,7 +231,7 @@ const parseUserInputMap=(rawValue,ctx)=>{if(!isPlainObject(rawValue)){return ctx
231
231
 
232
232
  function parsePerseusItem(json){if(isRealJSONParse(JSON.parse)){return JSON.parse(json)}throw new Error("Something went wrong.")}function parseAndMigratePerseusItem(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusItem$1);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusArticle);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigrateUserInputMap(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parseUserInputMap);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function throwErrorIfCheatingDetected(){if(!isRealJSONParse(JSON.parse)){throw new Error("Something went wrong.")}}
233
233
 
234
- const libName="@khanacademy/perseus-core";const libVersion="20.2.1";addLibraryVersionToPerseusDebug(libName,libVersion);
234
+ const libName="@khanacademy/perseus-core";const libVersion="20.3.0";addLibraryVersionToPerseusDebug(libName,libVersion);
235
235
 
236
236
  const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
237
237
 
package/dist/index.js CHANGED
@@ -258,7 +258,7 @@ const parseUserInputMap=(rawValue,ctx)=>{if(!isPlainObject(rawValue)){return ctx
258
258
 
259
259
  function parsePerseusItem(json){if(isRealJSONParse(JSON.parse)){return JSON.parse(json)}throw new Error("Something went wrong.")}function parseAndMigratePerseusItem(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusItem$1);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusArticle);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigrateUserInputMap(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parseUserInputMap);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function throwErrorIfCheatingDetected(){if(!isRealJSONParse(JSON.parse)){throw new Error("Something went wrong.")}}
260
260
 
261
- const libName="@khanacademy/perseus-core";const libVersion="20.2.1";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
261
+ const libName="@khanacademy/perseus-core";const libVersion="20.3.0";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
262
262
 
263
263
  const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
264
264
 
@@ -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
  */
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-PR3087-20251204170037",
6
+ "version": "0.0.0-PR3089-20251204204906",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -37,9 +37,9 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "tiny-invariant": "1.3.1",
40
- "@khanacademy/kas": "0.0.0-PR3087-20251204170037",
41
- "@khanacademy/perseus-utils": "0.0.0-PR3087-20251204170037",
42
- "@khanacademy/pure-markdown": "0.0.0-PR3087-20251204170037"
40
+ "@khanacademy/kas": "2.1.6",
41
+ "@khanacademy/perseus-utils": "2.1.4",
42
+ "@khanacademy/pure-markdown": "2.2.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@khanacademy/wonder-stuff-core": "3.0.0",
@@ -1 +0,0 @@
1
- export {};