@khanacademy/perseus-core 17.0.0 → 18.1.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.
@@ -1,5 +1,6 @@
1
1
  import type { Result } from "./result";
2
2
  import type { PerseusItem, PerseusArticle } from "../data-schema";
3
+ import type { UserInputMap } from "../validation.types";
3
4
  /**
4
5
  * Helper to parse PerseusItem JSON
5
6
  * Why not just use JSON.parse? We want:
@@ -44,3 +45,14 @@ export declare function parseAndMigratePerseusItem(data: unknown): Result<Perseu
44
45
  * @throws SyntaxError if the argument is not well-formed JSON.
45
46
  */
46
47
  export declare function parseAndMigratePerseusArticle(data: unknown): Result<PerseusArticle, ParseFailureDetail>;
48
+ /**
49
+ * Parses a UserInputMap from a plain object or JSON string, migrates old
50
+ * formats to the latest schema, and runtime-typechecks the result.
51
+ *
52
+ * @returns a {@link Result} of the parsed UserInputMap. If the result is a
53
+ * failure, it will contain an error message describing where in the tree
54
+ * parsing failed.
55
+ * @throws SyntaxError if the argument is a string that is not well-formed
56
+ * JSON.
57
+ */
58
+ export declare function parseAndMigrateUserInputMap(data: unknown): Result<UserInputMap, ParseFailureDetail>;
@@ -255,6 +255,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
255
255
  lineStyle: "solid" | "dashed";
256
256
  showPoint1: boolean;
257
257
  showPoint2: boolean;
258
+ weight: "thin" | "medium" | "thick";
258
259
  labels: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
259
260
  type: "label";
260
261
  coord: [number, number];
@@ -267,6 +268,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
267
268
  type: "vector";
268
269
  points: [[number, number], [number, number]];
269
270
  color: "blue" | "green" | "grayH" | "purple" | "pink" | "orange" | "red";
271
+ weight: "thin" | "medium" | "thick";
270
272
  labels: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
271
273
  type: "label";
272
274
  coord: [number, number];
@@ -283,6 +285,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
283
285
  color: "blue" | "green" | "grayH" | "purple" | "pink" | "orange" | "red";
284
286
  fillStyle: "none" | "solid" | "white" | "translucent";
285
287
  strokeStyle: "solid" | "dashed";
288
+ weight: "thin" | "medium" | "thick";
286
289
  labels: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
287
290
  type: "label";
288
291
  coord: [number, number];
@@ -311,6 +314,7 @@ export declare const parseInteractiveGraphWidget: import("../parser-types").Pars
311
314
  type: "function";
312
315
  color: "blue" | "green" | "grayH" | "purple" | "pink" | "orange" | "red";
313
316
  strokeStyle: "solid" | "dashed";
317
+ weight: "thin" | "medium" | "thick";
314
318
  equation: string;
315
319
  directionalAxis: "x" | "y";
316
320
  domain: [number, number];
@@ -0,0 +1,3 @@
1
+ import type { WidgetLogic } from "../logic-export.types";
2
+ declare const deprecatedStandinWidgetLogic: WidgetLogic;
3
+ export default deprecatedStandinWidgetLogic;
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": "17.0.0",
6
+ "version": "18.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },