@khanacademy/perseus-core 0.0.0-PR2969-20251024182057 → 0.0.0-PR2969-20251028001807
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.item-splitting.js.map +1 -1
- package/dist/es/index.js +145 -144
- package/dist/es/index.js.map +1 -1
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +145 -144
- package/dist/index.js.map +1 -1
- package/dist/widgets/core-widget-registry.d.ts +1 -0
- package/dist/widgets/logic-export.types.d.ts +6 -1
- package/dist/widgets/radio/radio-util.d.ts +2 -1
- package/package.json +4 -4
|
@@ -4,6 +4,7 @@ import type { Alignment } from "../types";
|
|
|
4
4
|
export declare function registerWidget(type: string, logic: WidgetLogic): void;
|
|
5
5
|
export declare function isWidgetRegistered(type: string): boolean;
|
|
6
6
|
export declare function getCurrentVersion(type: string): import("..").Version;
|
|
7
|
+
export declare function getSaveWarningsFnForWidget(type: string): import("./logic-export.types").SaveWarningsFunction;
|
|
7
8
|
export declare const getPublicWidgetOptionsFunction: (type: string) => PublicWidgetOptionsFunction;
|
|
8
9
|
export declare function getDefaultWidgetOptions(type: string): any;
|
|
9
10
|
export declare function isAccessible(type: string, widgetOptions: PerseusWidgetOptions): boolean;
|
|
@@ -18,7 +18,7 @@ import type getPlotterPublicWidgetOptions from "./plotter/plotter-util";
|
|
|
18
18
|
import type getRadioPublicWidgetOptions from "./radio/radio-util";
|
|
19
19
|
import type getSorterPublicWidgetOptions from "./sorter/sorter-util";
|
|
20
20
|
import type getTablePublicWidgetOptions from "./table/table-util";
|
|
21
|
-
import type { PerseusWidgetOptions, Version } from "../data-schema";
|
|
21
|
+
import type { PerseusWidget, PerseusWidgetOptions, Version } from "../data-schema";
|
|
22
22
|
import type { Alignment } from "../types";
|
|
23
23
|
export type WidgetOptionsUpgradeMap = {
|
|
24
24
|
[targetMajorVersion: string]: (arg1: any) => any;
|
|
@@ -30,6 +30,7 @@ export type WidgetOptionsUpgradeMap = {
|
|
|
30
30
|
* so reliant on a set group of widgets
|
|
31
31
|
*/
|
|
32
32
|
export type PublicWidgetOptionsFunction = typeof getCategorizerPublicWidgetOptions | typeof getCSProgramPublicWidgetOptions | typeof getDropdownPublicWidgetOptions | typeof getExpressionPublicWidgetOptions | typeof getFreeResponsePublicWidgetOptions | typeof getGrapherPublicWidgetOptions | typeof getGroupPublicWidgetOptions | typeof getIFramePublicWidgetOptions | typeof getInputNumberPublicWidgetOptions | typeof getInteractiveGraphPublicWidgetOptions | typeof getLabelImagePublicWidgetOptions | typeof getMatcherPublicWidgetOptions | typeof getMatrixPublicWidgetOptions | typeof getNumberLinePublicWidgetOptions | typeof getNumericInputPublicWidgetOptions | typeof getOrdererPublicWidgetOptions | typeof getPlotterPublicWidgetOptions | typeof getRadioPublicWidgetOptions | typeof getSorterPublicWidgetOptions | typeof getTablePublicWidgetOptions;
|
|
33
|
+
export type SaveWarningsFunction = (widget: PerseusWidget) => Array<string>;
|
|
33
34
|
export type WidgetLogic = {
|
|
34
35
|
name: string;
|
|
35
36
|
version?: Version;
|
|
@@ -43,4 +44,8 @@ export type WidgetLogic = {
|
|
|
43
44
|
* be shared with the client.
|
|
44
45
|
*/
|
|
45
46
|
getPublicWidgetOptions?: PublicWidgetOptionsFunction;
|
|
47
|
+
/**
|
|
48
|
+
* A function that provides the save warnings for the widget.
|
|
49
|
+
*/
|
|
50
|
+
getSaveWarnings?: SaveWarningsFunction;
|
|
46
51
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PerseusRadioChoice, PerseusRadioWidgetOptions } from "../../data-schema";
|
|
1
|
+
import type { PerseusRadioChoice, PerseusRadioWidgetOptions, PerseusWidget } from "../../data-schema";
|
|
2
2
|
/**
|
|
3
3
|
* For details on the individual options, see the
|
|
4
4
|
* PerseusRadioWidgetOptions type.
|
|
@@ -16,6 +16,7 @@ export type RadioPublicWidgetOptions = {
|
|
|
16
16
|
* Only the options from each Radio choice that should be exposed to the client.
|
|
17
17
|
*/
|
|
18
18
|
type RadioChoicePublicData = Pick<PerseusRadioChoice, "id" | "content" | "isNoneOfTheAbove">;
|
|
19
|
+
export declare function getSaveWarningsForRadioWidget(widget: PerseusWidget): Array<string>;
|
|
19
20
|
/**
|
|
20
21
|
* Shared functionality to determine if numCorrect is used, because:
|
|
21
22
|
*
|
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-PR2969-
|
|
6
|
+
"version": "0.0.0-PR2969-20251028001807",
|
|
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": "
|
|
41
|
-
"@khanacademy/perseus-utils": "
|
|
42
|
-
"@khanacademy/pure-markdown": "
|
|
40
|
+
"@khanacademy/kas": "2.1.3",
|
|
41
|
+
"@khanacademy/perseus-utils": "2.1.1",
|
|
42
|
+
"@khanacademy/pure-markdown": "2.2.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@khanacademy/wonder-stuff-core": "1.5.5",
|