@khanacademy/perseus 64.0.0 → 65.0.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/es/index.js +20 -28
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +19 -29
- package/dist/index.js.map +1 -1
- package/dist/renderability.d.ts +0 -9
- package/dist/types.d.ts +0 -2
- package/dist/util.d.ts +7 -7
- package/dist/widgets/definition/definition.d.ts +0 -1
- package/dist/widgets/dropdown/dropdown.d.ts +0 -1
- package/dist/widgets/explanation/explanation.d.ts +0 -1
- package/dist/widgets/expression/expression.d.ts +4 -5
- package/dist/widgets/graded-group/graded-group.d.ts +0 -1
- package/dist/widgets/graded-group-set/graded-group-set.d.ts +0 -1
- package/dist/widgets/group/group.d.ts +0 -1
- package/dist/widgets/image/image.d.ts +0 -1
- package/dist/widgets/interactive-graph.d.ts +0 -1
- package/dist/widgets/label-image/label-image.d.ts +0 -1
- package/dist/widgets/numeric-input/numeric-input.class.d.ts +0 -1
- package/dist/widgets/radio/radio.d.ts +0 -1
- package/dist/widgets/table/table.d.ts +0 -1
- package/dist/widgets.d.ts +0 -2
- package/package.json +7 -7
- package/dist/a11y.d.ts +0 -5
- package/dist/traversal.d.ts +0 -15
- package/dist/util.graphie.d.ts +0 -6
package/dist/renderability.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculates whether a perseus item is renderable by a specific
|
|
3
|
-
* perseus-item-data version.
|
|
4
|
-
*
|
|
5
|
-
* This is done inside of the perseus repo so that it can traverse
|
|
6
|
-
* widget-specific data that might need to do a sub-traversal.
|
|
7
|
-
* This supports widgets that contain renderers, such as the
|
|
8
|
-
* group or sequence widgets.
|
|
9
|
-
*/
|
|
10
1
|
export declare const isItemRenderableByVersion: (itemData: any, rendererContentVersion: any) => boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -349,7 +349,6 @@ export type WidgetExports<T extends React.ComponentType<any> & Widget = React.Co
|
|
|
349
349
|
displayName: string;
|
|
350
350
|
getWidget?: () => T;
|
|
351
351
|
widget: T;
|
|
352
|
-
accessible?: boolean | ((props: any) => boolean);
|
|
353
352
|
/** Supresses widget from showing up in the dropdown in the content editor */
|
|
354
353
|
hidden?: boolean;
|
|
355
354
|
/**
|
|
@@ -363,7 +362,6 @@ export type WidgetExports<T extends React.ComponentType<any> & Widget = React.Co
|
|
|
363
362
|
version?: Version;
|
|
364
363
|
isLintable?: boolean;
|
|
365
364
|
tracking?: Tracking;
|
|
366
|
-
traverseChildWidgets?: any;
|
|
367
365
|
/**
|
|
368
366
|
* Transforms the widget options to the props used to render the widget.
|
|
369
367
|
*/
|
package/dist/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getRealImageUrl, getBaseUrl, getSvgUrl, getDataUrl, getImageSizeModern, isLabeledSVG } from "@khanacademy/perseus-core";
|
|
2
2
|
import type { Range } from "@khanacademy/perseus-core";
|
|
3
3
|
import type * as React from "react";
|
|
4
4
|
type WordPosition = {
|
|
@@ -188,12 +188,12 @@ declare const Util: {
|
|
|
188
188
|
readonly supportsPassiveEvents: () => boolean;
|
|
189
189
|
readonly captureScratchpadTouchStart: typeof captureScratchpadTouchStart;
|
|
190
190
|
readonly getImageSize: typeof getImageSize;
|
|
191
|
-
readonly getImageSizeModern: typeof
|
|
192
|
-
readonly getRealImageUrl: typeof
|
|
193
|
-
readonly isLabeledSVG: typeof
|
|
194
|
-
readonly getBaseUrl: typeof
|
|
195
|
-
readonly getSvgUrl: typeof
|
|
196
|
-
readonly getDataUrl: typeof
|
|
191
|
+
readonly getImageSizeModern: typeof getImageSizeModern;
|
|
192
|
+
readonly getRealImageUrl: typeof getRealImageUrl;
|
|
193
|
+
readonly isLabeledSVG: typeof isLabeledSVG;
|
|
194
|
+
readonly getBaseUrl: typeof getBaseUrl;
|
|
195
|
+
readonly getSvgUrl: typeof getSvgUrl;
|
|
196
|
+
readonly getDataUrl: typeof getDataUrl;
|
|
197
197
|
readonly textarea: {
|
|
198
198
|
readonly getWordBeforeCursor: typeof getWordBeforeCursor;
|
|
199
199
|
readonly moveCursor: typeof moveCursor;
|
|
@@ -73,7 +73,6 @@ export declare class Expression extends React.Component<Props, ExpressionState>
|
|
|
73
73
|
declare const _default: {
|
|
74
74
|
name: string;
|
|
75
75
|
displayName: string;
|
|
76
|
-
accessible: true;
|
|
77
76
|
widget: React.ForwardRefExoticComponent<Omit<Pick<RenderProps & import("../../types").UniversalWidgetProps<Empty, Empty> & Partial<import("../..").PerseusDependenciesV2> & {
|
|
78
77
|
apiOptions: NonNullable<ExternalProps["apiOptions"]>;
|
|
79
78
|
buttonSets: NonNullable<ExternalProps["buttonSets"]>;
|
|
@@ -85,8 +84,11 @@ declare const _default: {
|
|
|
85
84
|
visibleLabel: PerseusExpressionWidgetOptions["visibleLabel"];
|
|
86
85
|
ariaLabel: PerseusExpressionWidgetOptions["ariaLabel"];
|
|
87
86
|
value: string;
|
|
88
|
-
}, "static" | "
|
|
87
|
+
}, "static" | "onChange" | "ariaLabel" | "buttonsVisible" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "keypadElement" | "reviewMode" | keyof import("../..").PerseusDependenciesV2 | "reviewModeRubric" | "alignment" | "isLastUsedWidget" | "visibleLabel" | "keypadConfiguration"> & {
|
|
89
88
|
value?: string | undefined;
|
|
89
|
+
buttonSets?: import("@khanacademy/perseus-core").LegacyButtonSets | undefined;
|
|
90
|
+
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
91
|
+
onBlur?: ((blurPath: FocusPath) => void) | undefined;
|
|
90
92
|
apiOptions?: Readonly<Readonly<{
|
|
91
93
|
isArticle?: boolean;
|
|
92
94
|
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
@@ -135,10 +137,7 @@ declare const _default: {
|
|
|
135
137
|
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
136
138
|
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
137
139
|
}> | undefined;
|
|
138
|
-
onBlur?: ((blurPath: FocusPath) => void) | undefined;
|
|
139
|
-
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
140
140
|
linterContext?: import("@khanacademy/perseus-linter").LinterContextProps | undefined;
|
|
141
|
-
buttonSets?: import("@khanacademy/perseus-core").LegacyButtonSets | undefined;
|
|
142
141
|
functions?: string[] | undefined;
|
|
143
142
|
times?: boolean | undefined;
|
|
144
143
|
} & {}, keyof import("../..").PerseusDependenciesV2> & React.RefAttributes<Expression>>;
|
|
@@ -38,7 +38,6 @@ declare class ImageWidget extends React.Component<Props> implements Widget {
|
|
|
38
38
|
}
|
|
39
39
|
declare const _default: {
|
|
40
40
|
name: string;
|
|
41
|
-
accessible: (widgetOptions: PerseusImageWidgetOptions) => boolean;
|
|
42
41
|
displayName: string;
|
|
43
42
|
widget: typeof ImageWidget;
|
|
44
43
|
isLintable: true;
|
|
@@ -93,7 +93,6 @@ declare const _default: {
|
|
|
93
93
|
} & import("../../types").UniversalWidgetProps<Empty, Empty> & Partial<import("../..").PerseusDependenciesV2> & {
|
|
94
94
|
preferredPopoverDirection?: PreferredPopoverDirection;
|
|
95
95
|
}, keyof import("../..").PerseusDependenciesV2> & React.RefAttributes<LabelImage>>;
|
|
96
|
-
accessible: true;
|
|
97
96
|
isLintable: true;
|
|
98
97
|
};
|
|
99
98
|
export default _default;
|
|
@@ -56,7 +56,6 @@ export declare class NumericInput extends React.Component<NumericInputProps> imp
|
|
|
56
56
|
declare const _default: {
|
|
57
57
|
name: string;
|
|
58
58
|
displayName: string;
|
|
59
|
-
accessible: true;
|
|
60
59
|
widget: typeof NumericInput;
|
|
61
60
|
transform: (widgetOptions: PerseusNumericInputWidgetOptions) => RenderProps;
|
|
62
61
|
isLintable: true;
|
|
@@ -5,7 +5,6 @@ import type { PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
name: string;
|
|
7
7
|
displayName: string;
|
|
8
|
-
accessible: true;
|
|
9
8
|
widget: typeof Radio;
|
|
10
9
|
transform: (widgetOptions: PerseusRadioWidgetOptions, strings: PerseusStrings, problemNum?: number | null) => RenderProps;
|
|
11
10
|
staticTransform: (widgetOptions: PerseusRadioWidgetOptions, strings: PerseusStrings, problemNum?: number | null) => RenderProps;
|
package/dist/widgets.d.ts
CHANGED
|
@@ -35,10 +35,8 @@ export declare const getVersionVector: () => {
|
|
|
35
35
|
[key: string]: Version;
|
|
36
36
|
};
|
|
37
37
|
export declare const getPublicWidgets: () => Record<string, WidgetExports>;
|
|
38
|
-
export declare const isAccessible: (widgetInfo: PerseusWidget) => boolean;
|
|
39
38
|
export declare const getAllWidgetTypes: () => ReadonlyArray<string>;
|
|
40
39
|
export declare const getRendererPropsForWidgetInfo: (widgetInfo: PerseusWidget, strings: PerseusStrings, problemNum?: number) => PerseusWidget;
|
|
41
|
-
export declare const traverseChildWidgets: (widgetInfo: PerseusWidget, traverseRenderer: any) => PerseusWidget;
|
|
42
40
|
/**
|
|
43
41
|
* Handling for static mode for widgets that support it.
|
|
44
42
|
*/
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "65.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
44
|
"@khanacademy/kas": "2.0.5",
|
|
45
|
-
"@khanacademy/keypad-context": "3.0.
|
|
46
|
-
"@khanacademy/kmath": "2.0.
|
|
47
|
-
"@khanacademy/math-input": "26.0.
|
|
48
|
-
"@khanacademy/perseus-core": "
|
|
49
|
-
"@khanacademy/perseus-linter": "
|
|
50
|
-
"@khanacademy/perseus-score": "7.0
|
|
45
|
+
"@khanacademy/keypad-context": "3.0.13",
|
|
46
|
+
"@khanacademy/kmath": "2.0.13",
|
|
47
|
+
"@khanacademy/math-input": "26.0.2",
|
|
48
|
+
"@khanacademy/perseus-core": "14.0.0",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.0.0",
|
|
50
|
+
"@khanacademy/perseus-score": "7.1.0",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.0.4",
|
|
52
52
|
"@khanacademy/pure-markdown": "2.0.5",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.0.5"
|
package/dist/a11y.d.ts
DELETED
package/dist/traversal.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Traverses a {content, widgets, images} renderer props object,
|
|
3
|
-
* such as `itemData.question`
|
|
4
|
-
*
|
|
5
|
-
* This traversal is deep and handles some widget prop upgrades
|
|
6
|
-
* (TODO(aria): Handle minor prop upgrades :) )
|
|
7
|
-
*
|
|
8
|
-
* This is the right way to traverse itemData.
|
|
9
|
-
*
|
|
10
|
-
* NOTE: We should not expose this on the perseus API yet. Instead,
|
|
11
|
-
* build the traversal method you want inside perseus, and use this
|
|
12
|
-
* from that. We might eventually expose this, but I'd like to be
|
|
13
|
-
* more confident in the interface provided first.
|
|
14
|
-
*/
|
|
15
|
-
export declare const traverse: (rendererOptions: any, contentCallback?: ((arg1: any) => any) | null, widgetCallback?: ((widgetInfo: any, widgetId: string) => any) | null, optionsCallback?: (arg1: any) => void) => any;
|
package/dist/util.graphie.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function getRealImageUrl(graphieUrl: string): string;
|
|
2
|
-
export declare function isLabeledSVG(graphieUrl: string): boolean;
|
|
3
|
-
export declare function getBaseUrl(graphieUrl: string): string;
|
|
4
|
-
export declare function getSvgUrl(graphieUrl: string): string;
|
|
5
|
-
export declare function getDataUrl(graphieUrl: string): string;
|
|
6
|
-
export declare function getImageSizeModern(url: string): Promise<[number, number]>;
|