@khanacademy/perseus-core 5.1.0 → 5.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.
- package/dist/data-schema.d.ts +8 -0
- package/dist/es/index.js +6 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/split-perseus-item.d.ts +4 -0
- package/package.json +1 -1
package/dist/data-schema.d.ts
CHANGED
|
@@ -323,6 +323,7 @@ export type PerseusImageBackground = {
|
|
|
323
323
|
* - none: shows no markings
|
|
324
324
|
*/
|
|
325
325
|
export type MarkingsType = "axes" | "graph" | "grid" | "none";
|
|
326
|
+
export type AxisLabelLocation = "onAxis" | "alongEdge";
|
|
326
327
|
export type PerseusCategorizerWidgetOptions = {
|
|
327
328
|
items: ReadonlyArray<string>;
|
|
328
329
|
categories: ReadonlyArray<string>;
|
|
@@ -476,6 +477,13 @@ export type PerseusInteractiveGraphWidgetOptions = {
|
|
|
476
477
|
*/
|
|
477
478
|
markings: MarkingsType;
|
|
478
479
|
labels?: ReadonlyArray<string>;
|
|
480
|
+
/**
|
|
481
|
+
* Specifies the location of the labels on the graph. default: "onAxis".
|
|
482
|
+
* - "onAxis": Labels are positioned on the axis at the right (x) and top (y) of the graph.
|
|
483
|
+
* - "alongEdge": Labels are centered along the bottom (x) and left (y) edges of the graph.
|
|
484
|
+
* The y label is rotated. Typically used when the range min is near 0 with longer labels.
|
|
485
|
+
*/
|
|
486
|
+
labelLocation?: AxisLabelLocation;
|
|
479
487
|
showProtractor: boolean;
|
|
480
488
|
/**
|
|
481
489
|
* Whether to show the Ruler tool overlayed on top of the graph.
|
package/dist/es/index.js
CHANGED
|
@@ -1022,7 +1022,7 @@ function parseWidgetWithVersion(parseVersion, parseType, parseOptions) {
|
|
|
1022
1022
|
graded: optional(boolean),
|
|
1023
1023
|
alignment: optional(string),
|
|
1024
1024
|
options: parseOptions,
|
|
1025
|
-
key: optional(number),
|
|
1025
|
+
key: optional(nullable(number)),
|
|
1026
1026
|
version: parseVersion
|
|
1027
1027
|
});
|
|
1028
1028
|
}
|
|
@@ -2844,7 +2844,7 @@ const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
|
|
|
2844
2844
|
|
|
2845
2845
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
2846
2846
|
const libName = "@khanacademy/perseus-core";
|
|
2847
|
-
const libVersion = "5.
|
|
2847
|
+
const libVersion = "5.2.0";
|
|
2848
2848
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
2849
2849
|
|
|
2850
2850
|
/**
|
|
@@ -4024,6 +4024,10 @@ function getUpgradedWidgetOptions(oldWidgetOptions) {
|
|
|
4024
4024
|
});
|
|
4025
4025
|
}
|
|
4026
4026
|
|
|
4027
|
+
/**
|
|
4028
|
+
* Upgrades widget options and removes answerful data for all the widgets in a
|
|
4029
|
+
* Perseus item.
|
|
4030
|
+
*/
|
|
4027
4031
|
function splitPerseusItem(originalItem) {
|
|
4028
4032
|
var _item$widgets;
|
|
4029
4033
|
const item = _.clone(originalItem);
|