@khanacademy/perseus 67.1.0 → 67.1.2
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 +3 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/widgets/number-line/number-line.d.ts +21 -81
- package/package.json +41 -41
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
-
import type { FocusPath, Widget, WidgetProps
|
|
3
|
+
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
4
4
|
import type { NumberLinePromptJSON } from "../../widget-ai-utils/number-line/number-line-ai-utils";
|
|
5
5
|
import type { PerseusNumberLineUserInput, PerseusNumberLineWidgetOptions, NumberLinePublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
7
6
|
/**
|
|
8
7
|
* The type of `this.props` inside the NumberLine widget.
|
|
9
8
|
*/
|
|
@@ -33,10 +32,6 @@ type DefaultProps = {
|
|
|
33
32
|
showTooltips: Props["showTooltips"];
|
|
34
33
|
apiOptions: Props["apiOptions"];
|
|
35
34
|
};
|
|
36
|
-
/**
|
|
37
|
-
* The props returned by the `transform` and `staticTransform` functions.
|
|
38
|
-
*/
|
|
39
|
-
type RenderProps = Omit<PropsFor<typeof NumberLine>, keyof UniversalWidgetProps>;
|
|
40
35
|
type State = {
|
|
41
36
|
numDivisionsEmpty: boolean;
|
|
42
37
|
};
|
|
@@ -45,6 +40,18 @@ declare class NumberLine extends React.Component<Props, State> implements Widget
|
|
|
45
40
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
46
41
|
static defaultProps: DefaultProps;
|
|
47
42
|
state: any;
|
|
43
|
+
/**
|
|
44
|
+
* isTickCtrl seems like it can be null
|
|
45
|
+
* but default props only work with undefined,
|
|
46
|
+
* so this handles both null/undefined
|
|
47
|
+
*/
|
|
48
|
+
getIsTickCtrl(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* snapDivisions seems like it can be null
|
|
51
|
+
* but default props only work with undefined,
|
|
52
|
+
* so this handles both null/undefined
|
|
53
|
+
*/
|
|
54
|
+
getSnapDivisions(): number;
|
|
48
55
|
isValid: () => boolean;
|
|
49
56
|
onNumDivisionsChange: (arg1: number, arg2: any) => void;
|
|
50
57
|
_handleTickCtrlFocus: () => void;
|
|
@@ -69,88 +76,23 @@ declare class NumberLine extends React.Component<Props, State> implements Widget
|
|
|
69
76
|
* [LEMS-3185] do not trust serializedState/restoreSerializedState
|
|
70
77
|
*/
|
|
71
78
|
getSerializedState(): {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
rel: string;
|
|
79
|
+
alignment: string | null | undefined;
|
|
80
|
+
static: boolean | null | undefined;
|
|
75
81
|
range: number[];
|
|
76
|
-
labelRange:
|
|
82
|
+
labelRange: (number | null)[];
|
|
77
83
|
labelStyle: string;
|
|
78
84
|
labelTicks: boolean;
|
|
79
85
|
divisionRange: number[];
|
|
80
86
|
snapDivisions: number;
|
|
81
|
-
isTickCtrl: boolean;
|
|
82
87
|
isInequality: boolean;
|
|
83
|
-
showTooltips
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
static: boolean | null | undefined;
|
|
89
|
-
problemNum: number | null | undefined;
|
|
90
|
-
apiOptions: Readonly<Readonly<{
|
|
91
|
-
isArticle?: boolean;
|
|
92
|
-
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
93
|
-
GroupMetadataEditor?: React.ComponentType<any>;
|
|
94
|
-
showAlignmentOptions?: boolean;
|
|
95
|
-
readOnly?: boolean;
|
|
96
|
-
answerableCallback?: (arg1: boolean) => unknown;
|
|
97
|
-
getAnotherHint?: () => unknown;
|
|
98
|
-
interactionCallback?: (widgetData: {
|
|
99
|
-
[widgetId: string]: any;
|
|
100
|
-
}) => void;
|
|
101
|
-
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
102
|
-
imagePlaceholder?: React.ReactNode;
|
|
103
|
-
widgetPlaceholder?: React.ReactNode;
|
|
104
|
-
baseElements?: {
|
|
105
|
-
Link: React.ComponentType<any>;
|
|
106
|
-
};
|
|
107
|
-
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
108
|
-
trackInteraction?: (args: {
|
|
109
|
-
type: string;
|
|
110
|
-
id: string;
|
|
111
|
-
correct?: boolean;
|
|
112
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
113
|
-
visible: number;
|
|
114
|
-
}>) => void;
|
|
115
|
-
customKeypad?: boolean;
|
|
116
|
-
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
117
|
-
isMobile?: boolean;
|
|
118
|
-
isMobileApp?: boolean;
|
|
119
|
-
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
120
|
-
hintProgressColor?: string;
|
|
121
|
-
canScrollPage?: boolean;
|
|
122
|
-
editorChangeDelay?: number;
|
|
123
|
-
flags?: Record<"new-radio-widget", boolean>;
|
|
124
|
-
}> & {
|
|
125
|
-
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
126
|
-
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
127
|
-
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
128
|
-
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
129
|
-
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
130
|
-
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
131
|
-
isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
|
|
132
|
-
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
133
|
-
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
134
|
-
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
135
|
-
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
136
|
-
}>;
|
|
137
|
-
keypadElement?: any;
|
|
138
|
-
questionCompleted?: boolean;
|
|
139
|
-
onFocus: (blurPath: FocusPath) => void;
|
|
140
|
-
onBlur: (blurPath: FocusPath) => void;
|
|
141
|
-
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
142
|
-
reviewMode: boolean;
|
|
143
|
-
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
144
|
-
onChange: import("../..").ChangeHandler;
|
|
145
|
-
handleUserInput: (newUserInput: PerseusNumberLineUserInput, cb?: () => void, silent?: boolean) => void;
|
|
146
|
-
isLastUsedWidget: boolean;
|
|
147
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
148
|
-
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
88
|
+
showTooltips: boolean | undefined;
|
|
89
|
+
isTickCtrl: boolean;
|
|
90
|
+
numDivisions: number;
|
|
91
|
+
numLinePosition: number;
|
|
92
|
+
rel: string;
|
|
149
93
|
};
|
|
150
94
|
render(): React.ReactNode;
|
|
151
95
|
}
|
|
152
|
-
declare function transform(editorProps: NumberLinePublicWidgetOptions): RenderProps;
|
|
153
|
-
declare function staticTransform(editorProps: PerseusNumberLineWidgetOptions): RenderProps;
|
|
154
96
|
/**
|
|
155
97
|
* @deprecated and likely a very broken API
|
|
156
98
|
* [LEMS-3185] do not trust serializedState/restoreSerializedState
|
|
@@ -162,8 +104,6 @@ declare const _default: {
|
|
|
162
104
|
name: string;
|
|
163
105
|
displayName: string;
|
|
164
106
|
widget: typeof NumberLine;
|
|
165
|
-
transform: typeof transform;
|
|
166
|
-
staticTransform: typeof staticTransform;
|
|
167
107
|
getCorrectUserInput: typeof getCorrectUserInput;
|
|
168
108
|
getStartUserInput: typeof getStartUserInput;
|
|
169
109
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
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": "67.1.
|
|
6
|
+
"version": "67.1.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,37 +41,37 @@
|
|
|
41
41
|
"mafs": "0.19.0",
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
|
+
"@khanacademy/keypad-context": "3.2.1",
|
|
44
45
|
"@khanacademy/kas": "2.1.0",
|
|
45
|
-
"@khanacademy/
|
|
46
|
-
"@khanacademy/
|
|
47
|
-
"@khanacademy/
|
|
48
|
-
"@khanacademy/perseus-
|
|
49
|
-
"@khanacademy/perseus-
|
|
50
|
-
"@khanacademy/perseus-score": "7.7.0",
|
|
46
|
+
"@khanacademy/kmath": "2.2.1",
|
|
47
|
+
"@khanacademy/math-input": "26.2.1",
|
|
48
|
+
"@khanacademy/perseus-core": "18.9.1",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.3.1",
|
|
50
|
+
"@khanacademy/perseus-score": "7.7.1",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.1.0",
|
|
52
52
|
"@khanacademy/pure-markdown": "2.2.0",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@khanacademy/wonder-blocks-banner": "4.3.
|
|
57
|
-
"@khanacademy/wonder-blocks-button": "11.0.
|
|
58
|
-
"@khanacademy/wonder-blocks-clickable": "7.1.
|
|
56
|
+
"@khanacademy/wonder-blocks-banner": "4.3.3",
|
|
57
|
+
"@khanacademy/wonder-blocks-button": "11.0.4",
|
|
58
|
+
"@khanacademy/wonder-blocks-clickable": "7.1.24",
|
|
59
59
|
"@khanacademy/wonder-blocks-core": "12.4.0",
|
|
60
60
|
"@khanacademy/wonder-blocks-data": "14.1.5",
|
|
61
|
-
"@khanacademy/wonder-blocks-dropdown": "10.3.
|
|
62
|
-
"@khanacademy/wonder-blocks-form": "7.3.
|
|
63
|
-
"@khanacademy/wonder-blocks-icon-button": "10.4.
|
|
64
|
-
"@khanacademy/wonder-blocks-icon": "5.2.
|
|
65
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.0.
|
|
66
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
67
|
-
"@khanacademy/wonder-blocks-link": "9.2.
|
|
68
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
69
|
-
"@khanacademy/wonder-blocks-popover": "6.1.
|
|
70
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.
|
|
71
|
-
"@khanacademy/wonder-blocks-switch": "3.3.
|
|
72
|
-
"@khanacademy/wonder-blocks-tokens": "12.2.
|
|
73
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
74
|
-
"@khanacademy/wonder-blocks-typography": "4.2.
|
|
61
|
+
"@khanacademy/wonder-blocks-dropdown": "10.3.8",
|
|
62
|
+
"@khanacademy/wonder-blocks-form": "7.3.6",
|
|
63
|
+
"@khanacademy/wonder-blocks-icon-button": "10.4.1",
|
|
64
|
+
"@khanacademy/wonder-blocks-icon": "5.2.18",
|
|
65
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.0.4",
|
|
66
|
+
"@khanacademy/wonder-blocks-layout": "3.1.35",
|
|
67
|
+
"@khanacademy/wonder-blocks-link": "9.2.2",
|
|
68
|
+
"@khanacademy/wonder-blocks-pill": "3.1.39",
|
|
69
|
+
"@khanacademy/wonder-blocks-popover": "6.1.29",
|
|
70
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.35",
|
|
71
|
+
"@khanacademy/wonder-blocks-switch": "3.3.17",
|
|
72
|
+
"@khanacademy/wonder-blocks-tokens": "12.2.1",
|
|
73
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.43",
|
|
74
|
+
"@khanacademy/wonder-blocks-typography": "4.2.20",
|
|
75
75
|
"@khanacademy/wonder-stuff-core": "1.5.5",
|
|
76
76
|
"@phosphor-icons/core": "2.0.2",
|
|
77
77
|
"@popperjs/core": "2.10.2",
|
|
@@ -90,25 +90,25 @@
|
|
|
90
90
|
"raphael": "1.5.4"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@khanacademy/wonder-blocks-banner": "^4.3.
|
|
94
|
-
"@khanacademy/wonder-blocks-button": "^11.0.
|
|
95
|
-
"@khanacademy/wonder-blocks-clickable": "^7.1.
|
|
93
|
+
"@khanacademy/wonder-blocks-banner": "^4.3.3",
|
|
94
|
+
"@khanacademy/wonder-blocks-button": "^11.0.4",
|
|
95
|
+
"@khanacademy/wonder-blocks-clickable": "^7.1.24",
|
|
96
96
|
"@khanacademy/wonder-blocks-core": "^12.4.0",
|
|
97
97
|
"@khanacademy/wonder-blocks-data": "^14.1.5",
|
|
98
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.3.
|
|
99
|
-
"@khanacademy/wonder-blocks-form": "^7.3.
|
|
100
|
-
"@khanacademy/wonder-blocks-icon": "^5.2.
|
|
101
|
-
"@khanacademy/wonder-blocks-icon-button": "^10.4.
|
|
102
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.0.
|
|
103
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
104
|
-
"@khanacademy/wonder-blocks-link": "^9.2.
|
|
105
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
106
|
-
"@khanacademy/wonder-blocks-popover": "^6.1.
|
|
107
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.
|
|
108
|
-
"@khanacademy/wonder-blocks-switch": "^3.3.
|
|
109
|
-
"@khanacademy/wonder-blocks-tokens": "^12.2.
|
|
110
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
111
|
-
"@khanacademy/wonder-blocks-typography": "^4.2.
|
|
98
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.3.8",
|
|
99
|
+
"@khanacademy/wonder-blocks-form": "^7.3.6",
|
|
100
|
+
"@khanacademy/wonder-blocks-icon": "^5.2.18",
|
|
101
|
+
"@khanacademy/wonder-blocks-icon-button": "^10.4.1",
|
|
102
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.0.4",
|
|
103
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.35",
|
|
104
|
+
"@khanacademy/wonder-blocks-link": "^9.2.2",
|
|
105
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.39",
|
|
106
|
+
"@khanacademy/wonder-blocks-popover": "^6.1.29",
|
|
107
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.35",
|
|
108
|
+
"@khanacademy/wonder-blocks-switch": "^3.3.17",
|
|
109
|
+
"@khanacademy/wonder-blocks-tokens": "^12.2.1",
|
|
110
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.43",
|
|
111
|
+
"@khanacademy/wonder-blocks-typography": "^4.2.20",
|
|
112
112
|
"@khanacademy/wonder-stuff-core": "^1.5.5",
|
|
113
113
|
"@phosphor-icons/core": "^2.0.2",
|
|
114
114
|
"@popperjs/core": "^2.10.2",
|