@khanacademy/perseus 82.2.0 → 83.0.1
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/components.d.ts +0 -2
- package/dist/es/index.css +2 -2
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +78 -89
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +80 -91
- package/dist/index.js.map +1 -1
- package/dist/styles/constants.d.ts +2 -7
- package/dist/widgets/graded-group/graded-group.d.ts +0 -10
- package/dist/widgets/group/group.d.ts +0 -7
- package/dist/widgets/interaction/interaction.d.ts +2 -2
- package/dist/widgets/interactive-graphs/interactive-graph.d.ts +12 -134
- package/dist/widgets/interactive-graphs/locked-figures/utils.d.ts +16 -0
- package/dist/widgets/interactive-graphs/utils/mafs-graph-utils.d.ts +27 -0
- package/dist/widgets/measurer/measurer.d.ts +1 -4
- package/dist/widgets/mock-widgets/mock-widget.d.ts +0 -4
- package/dist/widgets/table/table.d.ts +17 -56
- package/package.json +49 -48
- package/dist/components/info-tip/index.d.ts +0 -19
- package/dist/components/info-tip/info-tip-base.d.ts +0 -6
- package/dist/components/text-list-editor.d.ts +0 -15
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export declare const baseFontFamily = "'Lato', sans-serif";
|
|
2
2
|
export declare const boldFontFamily = "'Lato-Bold', 'Lato', sans-serif";
|
|
3
|
-
export declare const kaGreen = "#71B307";
|
|
4
3
|
export declare const white = "#FFFFFF";
|
|
5
|
-
export declare const gray97 = "#F6F7F7";
|
|
6
|
-
export declare const gray85 = "#D6D8DA";
|
|
7
4
|
export declare const gray76 = "#BABEC2";
|
|
8
5
|
export declare const gray68 = "#888D93";
|
|
9
6
|
export declare const gray17 = "#21242c";
|
|
@@ -17,8 +14,8 @@ export declare const pureMdMax = "1023px";
|
|
|
17
14
|
export declare const pureLgMax = "1279px";
|
|
18
15
|
export declare const phoneMargin = 16;
|
|
19
16
|
export declare const negativePhoneMargin = -16;
|
|
20
|
-
export declare const hintBorderWidth
|
|
21
|
-
export declare const
|
|
17
|
+
export declare const hintBorderWidth: string;
|
|
18
|
+
export declare const hintPaddingInlineStart: string;
|
|
22
19
|
export declare const interactiveSizes: {
|
|
23
20
|
readonly defaultBoxSize: 400;
|
|
24
21
|
readonly defaultBoxSizeSmall: 288;
|
|
@@ -29,7 +26,5 @@ export declare const warningColor = "#f86700";
|
|
|
29
26
|
export declare const warningColorHover = "#df5c00";
|
|
30
27
|
export declare const warningColorActive = "#c75300";
|
|
31
28
|
export declare const publishBlockingErrorColor = "#be2612";
|
|
32
|
-
export declare const radioBorderColor = "#BABEC2";
|
|
33
|
-
export declare const checkedColor = "#71B307";
|
|
34
29
|
export declare const articleMaxWidthInPx = 688;
|
|
35
30
|
export declare const articleMaxWidthTableInPx = 512;
|
|
@@ -16,15 +16,6 @@ type Props = WidgetProps<PerseusGradedGroupWidgetOptions, Empty, TrackingGradedG
|
|
|
16
16
|
onNextQuestion?: () => unknown;
|
|
17
17
|
dependencies: PerseusDependenciesV2;
|
|
18
18
|
};
|
|
19
|
-
type DefaultProps = {
|
|
20
|
-
title: Props["title"];
|
|
21
|
-
content: Props["content"];
|
|
22
|
-
widgets: Props["widgets"];
|
|
23
|
-
images: Props["images"];
|
|
24
|
-
hint: Props["hint"];
|
|
25
|
-
hasHint: Props["hasHint"];
|
|
26
|
-
linterContext: Props["linterContext"];
|
|
27
|
-
};
|
|
28
19
|
type State = {
|
|
29
20
|
status: (typeof GRADING_STATUSES)[keyof typeof GRADING_STATUSES];
|
|
30
21
|
showHint: boolean;
|
|
@@ -34,7 +25,6 @@ type State = {
|
|
|
34
25
|
export declare class GradedGroup extends React.Component<Props, State> implements Widget {
|
|
35
26
|
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
36
27
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
37
|
-
static defaultProps: DefaultProps;
|
|
38
28
|
state: State;
|
|
39
29
|
rendererRef: React.RefObject<Renderer>;
|
|
40
30
|
hintRendererRef: React.RefObject<Renderer>;
|
|
@@ -13,17 +13,10 @@ import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
|
13
13
|
import type { GroupPromptJSON } from "../../widget-ai-utils/group/group-ai-utils";
|
|
14
14
|
import type { PerseusGroupUserInput, PerseusGroupWidgetOptions, PerseusRenderer } from "@khanacademy/perseus-core";
|
|
15
15
|
type Props = WidgetProps<PerseusGroupWidgetOptions, PerseusGroupUserInput>;
|
|
16
|
-
type DefaultProps = {
|
|
17
|
-
content: Props["content"];
|
|
18
|
-
widgets: Props["widgets"];
|
|
19
|
-
images: Props["images"];
|
|
20
|
-
linterContext: Props["linterContext"];
|
|
21
|
-
};
|
|
22
16
|
declare class Group extends React.Component<Props> implements Widget {
|
|
23
17
|
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
24
18
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
25
19
|
rendererRef: Renderer | null | undefined;
|
|
26
|
-
static defaultProps: DefaultProps;
|
|
27
20
|
componentDidMount(): void;
|
|
28
21
|
getPromptJSON(): GroupPromptJSON;
|
|
29
22
|
/**
|
|
@@ -18,9 +18,9 @@ declare class Interaction extends React.Component<Props, State> implements Widge
|
|
|
18
18
|
state: State;
|
|
19
19
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
20
20
|
_setupGraphie: (arg1: any, arg2: any) => void;
|
|
21
|
-
_updatePointLocation: (arg1:
|
|
21
|
+
_updatePointLocation: (arg1: number, arg2: Coord) => void;
|
|
22
22
|
_updateLineLocation: (arg1: any, arg2: Coord) => void;
|
|
23
|
-
_eval: (arg1: any, arg2
|
|
23
|
+
_eval: (arg1: any, arg2?: any) => number;
|
|
24
24
|
_extractVars: (arg1: any) => ReadonlyArray<any>;
|
|
25
25
|
getPromptJSON(): UnsupportedWidgetPromptJSON;
|
|
26
26
|
render(): React.ReactNode;
|
|
@@ -4,134 +4,12 @@ import type { StatefulMafsGraphType } from "./stateful-mafs-graph";
|
|
|
4
4
|
import type { WidgetProps } from "../../types";
|
|
5
5
|
import type { InteractiveGraphPromptJSON } from "../../widget-ai-utils/interactive-graph/interactive-graph-ai-utils";
|
|
6
6
|
import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
|
|
7
|
-
import type { PerseusGraphType, PerseusInteractiveGraphWidgetOptions,
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
* Where the little black axis lines & labels (ticks) should render.
|
|
11
|
-
* Also known as the tick step. default [1, 1]
|
|
12
|
-
*
|
|
13
|
-
* NOTE(kevinb): perseus_data.go defines this as Array<number>
|
|
14
|
-
*/
|
|
15
|
-
step: [number, number];
|
|
16
|
-
/**
|
|
17
|
-
* Where the grid lines on the graph will render. default [1, 1]
|
|
18
|
-
*
|
|
19
|
-
* NOTE(kevinb): perseus_data.go defines this as Array<number>
|
|
20
|
-
*/
|
|
21
|
-
gridStep?: [x: number, y: number];
|
|
22
|
-
/**
|
|
23
|
-
* Where the graph points will lock to when they are dragged. default [0.5, 0.5]
|
|
24
|
-
*
|
|
25
|
-
* NOTE(kevinb): perseus_data.go defines this as Array<number>
|
|
26
|
-
*/
|
|
27
|
-
snapStep?: [x: number, y: number];
|
|
28
|
-
/**
|
|
29
|
-
* An optional image to use in the background
|
|
30
|
-
*/
|
|
31
|
-
backgroundImage?: PerseusImageBackground;
|
|
32
|
-
/**
|
|
33
|
-
* The type of markings to display on the graph.
|
|
34
|
-
* - axes: shows the axes without the gride lines
|
|
35
|
-
* - graph: shows the axes and the grid lines
|
|
36
|
-
* - grid: shows only the grid lines
|
|
37
|
-
* - none: shows no markings
|
|
38
|
-
*/
|
|
39
|
-
markings: MarkingsType;
|
|
40
|
-
/**
|
|
41
|
-
* How to label the X and Y axis. default: ["x", "y"]
|
|
42
|
-
*/
|
|
43
|
-
labels: string[];
|
|
44
|
-
/**
|
|
45
|
-
* Where to put the axis labels on the graph. default: "onAxis"
|
|
46
|
-
*/
|
|
47
|
-
labelLocation: AxisLabelLocation;
|
|
48
|
-
/**
|
|
49
|
-
* Whether to show the Protractor tool overlaid on top of the graph
|
|
50
|
-
*/
|
|
51
|
-
showProtractor: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Whether to show the Ruler tool overlaid on top of the graph.
|
|
54
|
-
* @deprecated - no longer used by the InteractiveGraph widget. The
|
|
55
|
-
* property is kept on this type to prevent its accidental reuse in future
|
|
56
|
-
* features, since it may appear in production data.
|
|
57
|
-
*/
|
|
58
|
-
showRuler?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Whether to show tooltips on the graph
|
|
61
|
-
*/
|
|
62
|
-
showTooltips?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* The unit to show on the ruler. e.g. "mm", "cm", "m", "km", "in", "ft",
|
|
65
|
-
* "yd", "mi".
|
|
66
|
-
* @deprecated - no longer used by the InteractiveGraph widget. The
|
|
67
|
-
* property is kept on this type to prevent its accidental reuse in future
|
|
68
|
-
* features, since it may appear in production data.
|
|
69
|
-
*/
|
|
70
|
-
rulerLabel?: string;
|
|
71
|
-
/**
|
|
72
|
-
* How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16. Must be
|
|
73
|
-
* an integer.
|
|
74
|
-
* @deprecated - no longer used by the InteractiveGraph widget. The
|
|
75
|
-
* property is kept on this type to prevent its accidental reuse in future
|
|
76
|
-
* features, since it may appear in production data.
|
|
77
|
-
*/
|
|
78
|
-
rulerTicks?: number;
|
|
79
|
-
/**
|
|
80
|
-
* The X and Y coordinate ranges for the view of the graph. default: [[-10, 10], [-10, 10]]
|
|
81
|
-
*
|
|
82
|
-
* NOTE(kevinb): perseus_data.go defines this as Array<Array<number>>
|
|
83
|
-
*/
|
|
84
|
-
range: GraphRange;
|
|
85
|
-
/**
|
|
86
|
-
* Whether to show the arrows on the axis.
|
|
87
|
-
*/
|
|
88
|
-
showAxisArrows: ShowAxisArrows;
|
|
89
|
-
/**
|
|
90
|
-
* Whether to show tick marks and tick numbers per axis.
|
|
91
|
-
*/
|
|
92
|
-
showAxisTicks: ShowAxisTicks;
|
|
93
|
-
/**
|
|
94
|
-
* The type of graph
|
|
95
|
-
*/
|
|
96
|
-
graph: PerseusGraphType;
|
|
97
|
-
/**
|
|
98
|
-
* The correct answer for this widget.
|
|
99
|
-
*/
|
|
100
|
-
correct?: PerseusGraphType;
|
|
101
|
-
/**
|
|
102
|
-
* Shapes (points, chords, etc) displayed on the graph that cannot be moved
|
|
103
|
-
* by the user.
|
|
104
|
-
*/
|
|
105
|
-
lockedFigures: LockedFigure[];
|
|
106
|
-
/**
|
|
107
|
-
* Aria label that applies to the entire graph.
|
|
108
|
-
*/
|
|
109
|
-
fullGraphAriaLabel?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Aria description that applies to the entire graph.
|
|
112
|
-
*/
|
|
113
|
-
fullGraphAriaDescription?: string;
|
|
114
|
-
};
|
|
115
|
-
export type Props = WidgetProps<InteractiveGraphProps, PerseusInteractiveGraphUserInput>;
|
|
116
|
-
type DefaultProps = {
|
|
117
|
-
labels: string[];
|
|
118
|
-
labelLocation: Props["labelLocation"];
|
|
119
|
-
range: Props["range"];
|
|
120
|
-
showAxisArrows: Props["showAxisArrows"];
|
|
121
|
-
showAxisTicks: Props["showAxisTicks"];
|
|
122
|
-
step: Props["step"];
|
|
123
|
-
backgroundImage: Props["backgroundImage"];
|
|
124
|
-
markings: Props["markings"];
|
|
125
|
-
showTooltips: Props["showTooltips"];
|
|
126
|
-
showProtractor: Props["showProtractor"];
|
|
127
|
-
userInput: Props["userInput"];
|
|
128
|
-
};
|
|
129
|
-
type State = any;
|
|
130
|
-
declare class InteractiveGraph extends React.Component<Props, State> {
|
|
7
|
+
import type { PerseusGraphType, PerseusInteractiveGraphWidgetOptions, InteractiveGraphPublicWidgetOptions, PerseusInteractiveGraphUserInput } from "@khanacademy/perseus-core";
|
|
8
|
+
export type Props = WidgetProps<PerseusInteractiveGraphWidgetOptions, PerseusInteractiveGraphUserInput>;
|
|
9
|
+
declare class InteractiveGraph extends React.Component<Props> {
|
|
131
10
|
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
132
11
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
133
12
|
mafsRef: React.RefObject<StatefulMafsGraphType>;
|
|
134
|
-
static defaultProps: DefaultProps;
|
|
135
13
|
static getEquationString(props: Props): string;
|
|
136
14
|
getUserInput(): PerseusInteractiveGraphUserInput;
|
|
137
15
|
getPromptJSON(): InteractiveGraphPromptJSON | UnsupportedWidgetPromptJSON;
|
|
@@ -144,20 +22,20 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
144
22
|
step: [number, number];
|
|
145
23
|
gridStep?: [x: number, y: number];
|
|
146
24
|
snapStep?: [x: number, y: number];
|
|
147
|
-
backgroundImage
|
|
148
|
-
markings: MarkingsType;
|
|
25
|
+
backgroundImage: import("@khanacademy/perseus-core").PerseusImageBackground;
|
|
26
|
+
markings: import("@khanacademy/perseus-core").MarkingsType;
|
|
149
27
|
labels: string[];
|
|
150
|
-
labelLocation: AxisLabelLocation;
|
|
28
|
+
labelLocation: import("@khanacademy/perseus-core").AxisLabelLocation;
|
|
29
|
+
showAxisArrows: import("@khanacademy/perseus-core").ShowAxisArrows;
|
|
30
|
+
showAxisTicks: import("@khanacademy/perseus-core").ShowAxisTicks;
|
|
151
31
|
showProtractor: boolean;
|
|
152
32
|
showRuler?: boolean;
|
|
153
|
-
showTooltips
|
|
33
|
+
showTooltips: boolean;
|
|
154
34
|
rulerLabel?: string;
|
|
155
35
|
rulerTicks?: number;
|
|
156
|
-
range: GraphRange;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
correct?: PerseusGraphType;
|
|
160
|
-
lockedFigures: LockedFigure[];
|
|
36
|
+
range: import("@khanacademy/perseus-core").GraphRange;
|
|
37
|
+
correct: PerseusGraphType;
|
|
38
|
+
lockedFigures: import("@khanacademy/perseus-core").LockedFigure[];
|
|
161
39
|
fullGraphAriaLabel?: string;
|
|
162
40
|
fullGraphAriaDescription?: string;
|
|
163
41
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import type { StrokeWeight } from "@khanacademy/perseus-core";
|
|
2
|
+
import type * as React from "react";
|
|
2
3
|
export declare const strokeWeights: Record<StrokeWeight, number>;
|
|
4
|
+
/**
|
|
5
|
+
* A dashed locked figure's `stroke-dasharray`, scaled to the stroke width so the
|
|
6
|
+
* dashes stay visible at every weight. mafs hardcodes `4, 3` regardless of
|
|
7
|
+
* width, making thick lines read as nearly solid; this restores legacy graphie's
|
|
8
|
+
* width-proportional pattern (Raphael's `[4, 3]` × width). Thin yields `4, 3`,
|
|
9
|
+
* unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getDashArrayForWeight(weight: StrokeWeight): string;
|
|
12
|
+
/**
|
|
13
|
+
* Inline `<g>` style that sets `--mafs-line-stroke-dash-style` to the
|
|
14
|
+
* weight-scaled dash pattern; mafs reads that variable for every dashed
|
|
15
|
+
* primitive (Line, Vector, Polygon, Ellipse, Plot) below. `undefined` for solid
|
|
16
|
+
* figures, so no inline style is emitted.
|
|
17
|
+
*/
|
|
18
|
+
export declare function dashedStrokeStyle(isDashed: boolean, weight: StrokeWeight): React.CSSProperties | undefined;
|
|
3
19
|
export declare function clampDomain(domain: [number | null, number | null], graphBounds: [number, number]): [number, number] | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InteractiveGraphAction } from "../reducer/interactive-graph-action";
|
|
2
|
+
import type { InteractiveGraphState } from "../types";
|
|
3
|
+
import type { LockedFigure } from "@khanacademy/perseus-core";
|
|
4
|
+
import type * as React from "react";
|
|
5
|
+
/**
|
|
6
|
+
* A contiguous run of locked figures sharing the same clipping treatment.
|
|
7
|
+
* Points render unclipped (a boundary point would otherwise be sliced in half
|
|
8
|
+
* by the clip); every other figure is clipped to the graph's visible range.
|
|
9
|
+
*/
|
|
10
|
+
export interface LockedFigureClipRun {
|
|
11
|
+
clipped: boolean;
|
|
12
|
+
figures: LockedFigure[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Group locked figures into contiguous runs by clipping treatment, preserving
|
|
16
|
+
* author order. Rendering all points in one pass would push them after every
|
|
17
|
+
* other figure, so the DOM (and screen-reader) order would no longer match the
|
|
18
|
+
* authored order; grouping into ordered runs keeps them interleaved as authored.
|
|
19
|
+
*
|
|
20
|
+
* Label figures are skipped: they render in GraphLockedLabelsLayer, not this
|
|
21
|
+
* layer, so including them would emit empty clip wrappers and split point runs.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getLockedFigureClipRuns(lockedFigures: ReadonlyArray<LockedFigure>): ReadonlyArray<LockedFigureClipRun>;
|
|
24
|
+
export declare function handleFocusEvent(event: React.FocusEvent, state: InteractiveGraphState, dispatch: (action: InteractiveGraphAction) => unknown): void;
|
|
25
|
+
export declare function handleBlurEvent(_event: React.FocusEvent, state: InteractiveGraphState, dispatch: (action: InteractiveGraphAction) => unknown): void;
|
|
26
|
+
export declare function handleKeyboardEvent(event: React.KeyboardEvent, state: InteractiveGraphState, dispatch: (action: InteractiveGraphAction) => unknown): void;
|
|
27
|
+
export declare function describedByIds(...args: Array<string | false | 0 | null | undefined>): string | undefined;
|
|
@@ -2,10 +2,7 @@ import { type PerseusMeasurerWidgetOptions } from "@khanacademy/perseus-core";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
4
4
|
import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
|
|
5
|
-
type Props = WidgetProps<PerseusMeasurerWidgetOptions
|
|
6
|
-
protractorX: number;
|
|
7
|
-
protractorY: number;
|
|
8
|
-
};
|
|
5
|
+
type Props = WidgetProps<PerseusMeasurerWidgetOptions>;
|
|
9
6
|
declare class Measurer extends React.Component<Props> implements Widget {
|
|
10
7
|
isWidget: true;
|
|
11
8
|
ruler: any;
|
|
@@ -5,9 +5,6 @@ import type { MockWidgetPromptJSON } from "../../widget-ai-utils/mock-widget/pro
|
|
|
5
5
|
import type { PerseusMockWidgetUserInput } from "@khanacademy/perseus-score";
|
|
6
6
|
type ExternalProps = WidgetProps<MockWidgetOptions, PerseusMockWidgetUserInput>;
|
|
7
7
|
type Props = ExternalProps;
|
|
8
|
-
type DefaultProps = {
|
|
9
|
-
userInput: Props["userInput"];
|
|
10
|
-
};
|
|
11
8
|
/**
|
|
12
9
|
* This is a Mock Perseus widget, which is used for our various rendering tests
|
|
13
10
|
* both internally and in consuming projects. It is a simple widget that renders
|
|
@@ -21,7 +18,6 @@ type DefaultProps = {
|
|
|
21
18
|
* You can register this widget for your tests by calling `registerWidget("mock-widget", MockWidget);`
|
|
22
19
|
*/
|
|
23
20
|
declare class MockWidgetComponent extends React.Component<Props> implements Widget {
|
|
24
|
-
static defaultProps: DefaultProps;
|
|
25
21
|
inputRef: HTMLElement | null;
|
|
26
22
|
getPromptJSON(): MockWidgetPromptJSON;
|
|
27
23
|
focus: () => boolean;
|
|
@@ -1,49 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
|
-
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FocusPath, Widget } from "../../types";
|
|
5
3
|
import type { PerseusTableWidgetOptions, PerseusTableUserInput } from "@khanacademy/perseus-core";
|
|
6
4
|
type EditorProps = {
|
|
7
|
-
editableHeaders
|
|
5
|
+
editableHeaders?: boolean;
|
|
8
6
|
Editor: any;
|
|
9
|
-
onChange: (
|
|
10
|
-
};
|
|
11
|
-
type Props = WidgetProps<PerseusTableWidgetOptions, PerseusTableUserInput> & EditorProps;
|
|
12
|
-
type DefaultProps = {
|
|
13
|
-
apiOptions: Props["apiOptions"];
|
|
14
|
-
headers: Props["headers"];
|
|
15
|
-
editableHeaders: Props["editableHeaders"];
|
|
16
|
-
rows: Props["rows"];
|
|
17
|
-
columns: Props["columns"];
|
|
18
|
-
linterContext: Props["linterContext"];
|
|
19
|
-
};
|
|
20
|
-
declare class Table extends React.Component<Props> implements Widget {
|
|
21
|
-
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
22
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
23
|
-
headerRefs: Record<string, any>;
|
|
24
|
-
answerRefs: Record<string, any>;
|
|
25
|
-
static defaultProps: DefaultProps;
|
|
26
|
-
_getRows(): number;
|
|
27
|
-
_getColumns(): number;
|
|
28
|
-
_getAnswersClone(): PerseusTableUserInput;
|
|
29
|
-
onValueChange(row: number, column: number, eventOrValue: any): void;
|
|
30
|
-
onHeaderChange(index: number, e: any): void;
|
|
31
|
-
_handleFocus(inputPath: any): void;
|
|
32
|
-
_handleBlur(inputPath: any): void;
|
|
33
|
-
focus(): boolean;
|
|
34
|
-
focusInputPath(path: FocusPath): void;
|
|
35
|
-
blurInputPath(path: FocusPath): void;
|
|
36
|
-
getDOMNodeForPath(path: FocusPath): ReturnType<typeof ReactDOM.findDOMNode>;
|
|
37
|
-
getInputPaths(): string[][];
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated and likely very broken API
|
|
40
|
-
* [LEMS-3185] do not trust serializedState
|
|
41
|
-
*/
|
|
42
|
-
getSerializedState(): {
|
|
43
|
-
answers: PerseusTableUserInput;
|
|
7
|
+
onChange: (value: {
|
|
44
8
|
headers: string[];
|
|
45
|
-
|
|
46
|
-
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function getStartUserInput(options: PerseusTableWidgetOptions): PerseusTableUserInput;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated - do not use in new code.
|
|
14
|
+
*/
|
|
15
|
+
declare function getUserInputFromSerializedState(serializedState: any): PerseusTableUserInput;
|
|
16
|
+
declare const _default: {
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
widget: React.ForwardRefExoticComponent<PerseusTableWidgetOptions & {
|
|
47
20
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
48
21
|
widgetId: string;
|
|
49
22
|
widgetIndex: number;
|
|
@@ -96,22 +69,10 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
96
69
|
reviewMode: boolean;
|
|
97
70
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
98
71
|
handleUserInput: (newUserInput: PerseusTableUserInput, cb?: () => void, silent?: boolean) => void;
|
|
72
|
+
userInput: PerseusTableUserInput;
|
|
99
73
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
100
74
|
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
101
|
-
|
|
102
|
-
onChange: (headers: PerseusTableWidgetOptions["headers"]) => void;
|
|
103
|
-
};
|
|
104
|
-
render(): React.ReactNode;
|
|
105
|
-
}
|
|
106
|
-
declare function getStartUserInput(options: PerseusTableWidgetOptions): PerseusTableUserInput;
|
|
107
|
-
/**
|
|
108
|
-
* @deprecated - do not use in new code.
|
|
109
|
-
*/
|
|
110
|
-
declare function getUserInputFromSerializedState(serializedState: any): PerseusTableUserInput;
|
|
111
|
-
declare const _default: {
|
|
112
|
-
name: string;
|
|
113
|
-
displayName: string;
|
|
114
|
-
widget: typeof Table;
|
|
75
|
+
} & EditorProps & React.RefAttributes<Widget>>;
|
|
115
76
|
hidden: true;
|
|
116
77
|
isLintable: true;
|
|
117
78
|
getStartUserInput: typeof getStartUserInput;
|
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": "83.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -37,45 +37,46 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@dnd-kit/react": "^0.5.0",
|
|
40
41
|
"@use-gesture/react": "^10.2.27",
|
|
41
42
|
"gifuct-js": "^2.1.2",
|
|
42
43
|
"mafs": "0.19.0",
|
|
43
44
|
"tiny-invariant": "1.3.1",
|
|
44
45
|
"uuid": "^10.0.0",
|
|
45
|
-
"@khanacademy/kas": "2.2.
|
|
46
|
-
"@khanacademy/keypad-context": "3.2.
|
|
47
|
-
"@khanacademy/kmath": "2.4.
|
|
48
|
-
"@khanacademy/math-input": "
|
|
49
|
-
"@khanacademy/perseus-core": "34.0.
|
|
50
|
-
"@khanacademy/perseus-linter": "5.1.
|
|
51
|
-
"@khanacademy/perseus-score": "8.12.
|
|
46
|
+
"@khanacademy/kas": "2.2.6",
|
|
47
|
+
"@khanacademy/keypad-context": "3.2.80",
|
|
48
|
+
"@khanacademy/kmath": "2.4.39",
|
|
49
|
+
"@khanacademy/math-input": "27.0.0",
|
|
50
|
+
"@khanacademy/perseus-core": "34.0.2",
|
|
51
|
+
"@khanacademy/perseus-linter": "5.1.20",
|
|
52
|
+
"@khanacademy/perseus-score": "8.12.12",
|
|
52
53
|
"@khanacademy/perseus-utils": "2.1.5",
|
|
53
|
-
"@khanacademy/pure-markdown": "2.3.
|
|
54
|
-
"@khanacademy/simple-markdown": "3.0.
|
|
54
|
+
"@khanacademy/pure-markdown": "2.3.2",
|
|
55
|
+
"@khanacademy/simple-markdown": "3.0.1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@khanacademy/wonder-blocks-announcer": "1.1.1",
|
|
58
|
-
"@khanacademy/wonder-blocks-banner": "5.1.
|
|
59
|
-
"@khanacademy/wonder-blocks-button": "11.7.
|
|
60
|
-
"@khanacademy/wonder-blocks-clickable": "8.2.
|
|
59
|
+
"@khanacademy/wonder-blocks-banner": "5.1.11",
|
|
60
|
+
"@khanacademy/wonder-blocks-button": "11.7.7",
|
|
61
|
+
"@khanacademy/wonder-blocks-clickable": "8.2.9",
|
|
61
62
|
"@khanacademy/wonder-blocks-core": "12.4.4",
|
|
62
63
|
"@khanacademy/wonder-blocks-data": "15.0.3",
|
|
63
|
-
"@khanacademy/wonder-blocks-dropdown": "10.11.
|
|
64
|
-
"@khanacademy/wonder-blocks-form": "7.6.
|
|
65
|
-
"@khanacademy/wonder-blocks-icon": "5.3.
|
|
66
|
-
"@khanacademy/wonder-blocks-icon-button": "11.4.
|
|
67
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.1.
|
|
68
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
69
|
-
"@khanacademy/wonder-blocks-link": "10.3.
|
|
70
|
-
"@khanacademy/wonder-blocks-modal": "8.7.
|
|
71
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
72
|
-
"@khanacademy/wonder-blocks-popover": "6.3.
|
|
73
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.
|
|
74
|
-
"@khanacademy/wonder-blocks-switch": "3.4.
|
|
64
|
+
"@khanacademy/wonder-blocks-dropdown": "10.11.8",
|
|
65
|
+
"@khanacademy/wonder-blocks-form": "7.6.10",
|
|
66
|
+
"@khanacademy/wonder-blocks-icon": "5.3.23",
|
|
67
|
+
"@khanacademy/wonder-blocks-icon-button": "11.4.5",
|
|
68
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.1.9",
|
|
69
|
+
"@khanacademy/wonder-blocks-layout": "3.1.60",
|
|
70
|
+
"@khanacademy/wonder-blocks-link": "10.3.9",
|
|
71
|
+
"@khanacademy/wonder-blocks-modal": "8.7.11",
|
|
72
|
+
"@khanacademy/wonder-blocks-pill": "3.1.73",
|
|
73
|
+
"@khanacademy/wonder-blocks-popover": "6.3.12",
|
|
74
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.60",
|
|
75
|
+
"@khanacademy/wonder-blocks-switch": "3.4.9",
|
|
75
76
|
"@khanacademy/wonder-blocks-timing": "7.1.0",
|
|
76
|
-
"@khanacademy/wonder-blocks-tokens": "17.
|
|
77
|
-
"@khanacademy/wonder-blocks-tooltip": "4.2.
|
|
78
|
-
"@khanacademy/wonder-blocks-typography": "5.0.
|
|
77
|
+
"@khanacademy/wonder-blocks-tokens": "17.3.0",
|
|
78
|
+
"@khanacademy/wonder-blocks-tooltip": "4.2.1",
|
|
79
|
+
"@khanacademy/wonder-blocks-typography": "5.0.3",
|
|
79
80
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
80
81
|
"@phosphor-icons/core": "2.0.2",
|
|
81
82
|
"@popperjs/core": "2.10.2",
|
|
@@ -87,32 +88,32 @@
|
|
|
87
88
|
"react-dom": "18.2.0",
|
|
88
89
|
"react-popper": "^2.2.5",
|
|
89
90
|
"underscore": "1.4.4",
|
|
90
|
-
"perseus-build-settings": "0.9.
|
|
91
|
+
"perseus-build-settings": "0.9.1",
|
|
91
92
|
"raphael": "1.5.4"
|
|
92
93
|
},
|
|
93
94
|
"peerDependencies": {
|
|
94
95
|
"@khanacademy/wonder-blocks-announcer": "^1.1.1",
|
|
95
|
-
"@khanacademy/wonder-blocks-banner": "^5.1.
|
|
96
|
-
"@khanacademy/wonder-blocks-button": "^11.7.
|
|
97
|
-
"@khanacademy/wonder-blocks-clickable": "^8.2.
|
|
96
|
+
"@khanacademy/wonder-blocks-banner": "^5.1.11",
|
|
97
|
+
"@khanacademy/wonder-blocks-button": "^11.7.7",
|
|
98
|
+
"@khanacademy/wonder-blocks-clickable": "^8.2.9",
|
|
98
99
|
"@khanacademy/wonder-blocks-core": "^12.4.4",
|
|
99
100
|
"@khanacademy/wonder-blocks-data": "^15.0.3",
|
|
100
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.11.
|
|
101
|
-
"@khanacademy/wonder-blocks-form": "^7.6.
|
|
102
|
-
"@khanacademy/wonder-blocks-icon": "^5.3.
|
|
103
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.4.
|
|
104
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.1.
|
|
105
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
106
|
-
"@khanacademy/wonder-blocks-link": "^10.3.
|
|
107
|
-
"@khanacademy/wonder-blocks-modal": "^8.7.
|
|
108
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
109
|
-
"@khanacademy/wonder-blocks-popover": "^6.3.
|
|
110
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.
|
|
111
|
-
"@khanacademy/wonder-blocks-switch": "^3.4.
|
|
101
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.11.8",
|
|
102
|
+
"@khanacademy/wonder-blocks-form": "^7.6.10",
|
|
103
|
+
"@khanacademy/wonder-blocks-icon": "^5.3.23",
|
|
104
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.4.5",
|
|
105
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.1.9",
|
|
106
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.60",
|
|
107
|
+
"@khanacademy/wonder-blocks-link": "^10.3.9",
|
|
108
|
+
"@khanacademy/wonder-blocks-modal": "^8.7.11",
|
|
109
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.73",
|
|
110
|
+
"@khanacademy/wonder-blocks-popover": "^6.3.12",
|
|
111
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.60",
|
|
112
|
+
"@khanacademy/wonder-blocks-switch": "^3.4.9",
|
|
112
113
|
"@khanacademy/wonder-blocks-timing": "^7.1.0",
|
|
113
|
-
"@khanacademy/wonder-blocks-tokens": "^17.
|
|
114
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.2.
|
|
115
|
-
"@khanacademy/wonder-blocks-typography": "^5.0.
|
|
114
|
+
"@khanacademy/wonder-blocks-tokens": "^17.3.0",
|
|
115
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.2.1",
|
|
116
|
+
"@khanacademy/wonder-blocks-typography": "^5.0.3",
|
|
116
117
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
117
118
|
"@phosphor-icons/core": "^2.0.2",
|
|
118
119
|
"@popperjs/core": "^2.10.2",
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
},
|
|
128
129
|
"keywords": [],
|
|
129
130
|
"khan": {
|
|
130
|
-
"catalogHash": "
|
|
131
|
+
"catalogHash": "bcf5b2d4681b77c1"
|
|
131
132
|
},
|
|
132
133
|
"scripts": {}
|
|
133
134
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A wrapper around info-tip/info-tip.jsx that can be rendered on the
|
|
3
|
-
* server without causing a checksum mismatch on the client.
|
|
4
|
-
* (RCSS generates classnames with a randomSuffix, which ensures that any
|
|
5
|
-
* two sets of generated classnames will not match.)
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import InfoTipBase from "./info-tip-base";
|
|
9
|
-
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
10
|
-
type Props = PropsFor<typeof InfoTipBase>;
|
|
11
|
-
type State = {
|
|
12
|
-
didMount: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare class InfoTip extends React.Component<Props, State> {
|
|
15
|
-
state: State;
|
|
16
|
-
componentDidMount(): void;
|
|
17
|
-
render(): React.ReactNode;
|
|
18
|
-
}
|
|
19
|
-
export default InfoTip;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare class TextListEditor extends React.Component<any, any> {
|
|
3
|
-
static propTypes: {
|
|
4
|
-
options: any;
|
|
5
|
-
layout: any;
|
|
6
|
-
onChange: any;
|
|
7
|
-
};
|
|
8
|
-
static defaultProps: any;
|
|
9
|
-
state: any;
|
|
10
|
-
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
11
|
-
onChange: (arg1: number, arg2: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
onKeyDown: (arg1: number, arg2: React.KeyboardEvent) => void;
|
|
13
|
-
render(): React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export default TextListEditor;
|