@khanacademy/perseus 34.1.0 → 35.1.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/es/index.js +1109 -974
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +8 -2
- package/dist/es/strings.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1032 -905
- package/dist/index.js.map +1 -1
- package/dist/mixins/widget-prop-denylist.d.ts +0 -1
- package/dist/perseus-api.d.ts +5 -5
- package/dist/perseus-types.d.ts +13 -19
- package/dist/renderer.d.ts +4 -4
- package/dist/server-item-renderer.d.ts +5 -9
- package/dist/strings.d.ts +3 -0
- package/dist/strings.js +8 -2
- package/dist/strings.js.map +1 -1
- package/dist/types.d.ts +3 -6
- package/dist/validation.types.d.ts +114 -0
- package/dist/widgets/categorizer/categorizer-validator.d.ts +2 -2
- package/dist/widgets/categorizer/categorizer.d.ts +6 -6
- package/dist/widgets/cs-program/cs-program-validator.d.ts +3 -0
- package/dist/widgets/cs-program/cs-program.d.ts +5 -10
- package/dist/widgets/definition/definition.d.ts +3 -4
- package/dist/widgets/dropdown/dropdown-validator.d.ts +2 -2
- package/dist/widgets/dropdown/dropdown.d.ts +5 -5
- package/dist/widgets/explanation/explanation.d.ts +3 -2
- package/dist/widgets/expression/expression-validator.d.ts +2 -2
- package/dist/widgets/expression/expression.d.ts +46 -28
- package/dist/widgets/expression/expression.types.d.ts +0 -1
- package/dist/widgets/graded-group/graded-group.d.ts +2 -2
- package/dist/widgets/graded-group-set/graded-group-set.d.ts +2 -2
- package/dist/widgets/grapher/grapher-validator.d.ts +4 -0
- package/dist/widgets/grapher/grapher.d.ts +6 -7
- package/dist/widgets/grapher/util.d.ts +0 -2
- package/dist/widgets/group/group.d.ts +3 -2
- package/dist/widgets/iframe/iframe-validator.d.ts +3 -0
- package/dist/widgets/iframe/iframe.d.ts +7 -11
- package/dist/widgets/image/image.d.ts +3 -4
- package/dist/widgets/input-number/input-number-validator.d.ts +3 -3
- package/dist/widgets/input-number/input-number.d.ts +7 -10
- package/dist/widgets/interaction/interaction.d.ts +3 -3
- package/dist/widgets/interactive-graph.d.ts +11 -14
- package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graph-locked-layer.d.ts +2 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +15 -2
- package/dist/widgets/interactive-graphs/interactive-graph-validator.d.ts +4 -0
- package/dist/widgets/interactive-graphs/locked-figures/locked-ellipse.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-function.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-line.d.ts +2 -0
- package/dist/widgets/interactive-graphs/locked-figures/locked-point.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-polygon.d.ts +5 -1
- package/dist/widgets/interactive-graphs/locked-figures/locked-vector.d.ts +5 -1
- package/dist/widgets/interactive-graphs/mafs-state-to-interactive-graph.d.ts +3 -0
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +5 -2
- package/dist/widgets/label-image/label-image-validator.d.ts +10 -0
- package/dist/widgets/label-image/label-image.d.ts +15 -10
- package/dist/widgets/label-image/types.d.ts +0 -4
- package/dist/widgets/matcher/matcher-validator.d.ts +4 -0
- package/dist/widgets/matcher/matcher.d.ts +6 -5
- package/dist/widgets/matrix/matrix-validator.d.ts +5 -0
- package/dist/widgets/matrix/matrix.d.ts +6 -5
- package/dist/widgets/molecule/molecule.d.ts +2 -1
- package/dist/widgets/number-line/number-line-validator.d.ts +4 -0
- package/dist/widgets/number-line/number-line.d.ts +7 -4
- package/dist/widgets/numeric-input/numeric-input-validator.d.ts +2 -2
- package/dist/widgets/numeric-input/numeric-input.d.ts +7 -7
- package/dist/widgets/orderer/orderer.d.ts +4 -4
- package/dist/widgets/passage/passage.d.ts +3 -4
- package/dist/widgets/passage-ref/passage-ref.d.ts +3 -11
- package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +2 -1
- package/dist/widgets/phet-simulation/phet-simulation.d.ts +2 -2
- package/dist/widgets/plotter/plotter-validator.d.ts +4 -0
- package/dist/widgets/plotter/plotter.d.ts +6 -5
- package/dist/widgets/radio/radio-component.d.ts +6 -13
- package/dist/widgets/radio/radio-validator.d.ts +5 -0
- package/dist/widgets/sorter/sorter-validator.d.ts +4 -0
- package/dist/widgets/sorter/sorter.d.ts +7 -9
- package/dist/widgets/table/table-validator.d.ts +5 -0
- package/dist/widgets/table/table.d.ts +6 -5
- package/dist/widgets/video/video.d.ts +2 -2
- package/package.json +1 -1
- package/dist/widgets/categorizer/categorizer.types.d.ts +0 -5
- package/dist/widgets/dropdown/dropdown.types.d.ts +0 -5
- package/dist/widgets/input-number/input-number.types.d.ts +0 -2
- package/dist/widgets/numeric-input/numeric-input.types.d.ts +0 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { PerseusOrdererWidgetOptions } from "../../perseus-types";
|
|
3
3
|
import type { WidgetProps } from "../../types";
|
|
4
|
+
import type { PerseusOrdererRubric, PerseusOrdererUserInput } from "../../validation.types";
|
|
4
5
|
type Position = {
|
|
5
6
|
left: number;
|
|
6
7
|
top: number;
|
|
7
8
|
};
|
|
8
|
-
type Rubric = PerseusOrdererWidgetOptions;
|
|
9
9
|
type RenderProps = PerseusOrdererWidgetOptions & {
|
|
10
10
|
current: any;
|
|
11
11
|
};
|
|
12
|
-
export type OrdererProps = WidgetProps<RenderProps,
|
|
12
|
+
export type OrdererProps = WidgetProps<RenderProps, PerseusOrdererRubric>;
|
|
13
13
|
type OrdererDefaultProps = {
|
|
14
14
|
current: OrdererProps["current"];
|
|
15
15
|
options: OrdererProps["options"];
|
|
@@ -43,8 +43,8 @@ declare class Orderer extends React.Component<OrdererProps, OrdererState> {
|
|
|
43
43
|
findCorrectIndex: (arg1: any, arg2: any) => any;
|
|
44
44
|
isCardInBank: (arg1: any) => boolean;
|
|
45
45
|
setListValues: (arg1: ReadonlyArray<string>) => void;
|
|
46
|
-
getUserInput
|
|
47
|
-
simpleValidate
|
|
46
|
+
getUserInput(): PerseusOrdererUserInput;
|
|
47
|
+
simpleValidate(rubric: PerseusOrdererRubric): any;
|
|
48
48
|
render(): React.ReactNode;
|
|
49
49
|
}
|
|
50
50
|
declare const _default: Readonly<{
|
|
@@ -5,14 +5,13 @@ import type { SerializedHighlightSet } from "../../components/highlighting/types
|
|
|
5
5
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
6
6
|
import type { PerseusPassageWidgetOptions, PerseusWidget } from "../../perseus-types";
|
|
7
7
|
import type { WidgetProps } from "../../types";
|
|
8
|
+
import type { PerseusPassageRubric, PerseusPassageUserInput } from "../../validation.types";
|
|
8
9
|
import type { SingleASTNode } from "@khanacademy/simple-markdown";
|
|
9
10
|
export declare class LineHeightMeasurer extends React.Component<Record<any, any>> {
|
|
10
11
|
_line: HTMLDivElement | null | undefined;
|
|
11
12
|
measureLineHeight(): number;
|
|
12
13
|
render(): React.ReactNode;
|
|
13
14
|
}
|
|
14
|
-
type UserInput = null;
|
|
15
|
-
type Rubric = PerseusPassageWidgetOptions;
|
|
16
15
|
type RenderProps = {
|
|
17
16
|
passageTitle: PerseusPassageWidgetOptions["passageTitle"];
|
|
18
17
|
passageText: PerseusPassageWidgetOptions["passageText"];
|
|
@@ -20,7 +19,7 @@ type RenderProps = {
|
|
|
20
19
|
showLineNumbers: PerseusPassageWidgetOptions["showLineNumbers"];
|
|
21
20
|
};
|
|
22
21
|
type FindWidgetsCallback = (id: string, widgetInfo: PerseusWidget) => boolean;
|
|
23
|
-
type PassageProps = ChangeableProps & WidgetProps<RenderProps,
|
|
22
|
+
type PassageProps = ChangeableProps & WidgetProps<RenderProps, PerseusPassageRubric> & {
|
|
24
23
|
findWidgets: (arg1: FindWidgetsCallback) => ReadonlyArray<Passage>;
|
|
25
24
|
highlights: SerializedHighlightSet;
|
|
26
25
|
};
|
|
@@ -94,7 +93,7 @@ export declare class Passage extends React.Component<PassageProps, PassageState>
|
|
|
94
93
|
*
|
|
95
94
|
* These are misc widget functions used for the widget API
|
|
96
95
|
*/
|
|
97
|
-
getUserInput():
|
|
96
|
+
getUserInput(): PerseusPassageUserInput;
|
|
98
97
|
simpleValidate(): import("../../types").PerseusScore;
|
|
99
98
|
/**
|
|
100
99
|
* Rendering
|
|
@@ -2,21 +2,13 @@ import * as React from "react";
|
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import type { PerseusPassageRefWidgetOptions } from "../../perseus-types";
|
|
4
4
|
import type { ChangeFn, WidgetProps } from "../../types";
|
|
5
|
-
import type {
|
|
6
|
-
type UserInput = RenderProps & {
|
|
7
|
-
static: boolean | null | undefined;
|
|
8
|
-
reviewModeRubric: Rubric;
|
|
9
|
-
linterContext: LinterContextProps;
|
|
10
|
-
isLastUsedWidget: boolean;
|
|
11
|
-
alignment: string | null | undefined;
|
|
12
|
-
};
|
|
5
|
+
import type { PerseusPassageRefRubric, PerseusPassageRefUserInput } from "../../validation.types";
|
|
13
6
|
type RenderProps = {
|
|
14
7
|
passageNumber: PerseusPassageRefWidgetOptions["passageNumber"];
|
|
15
8
|
referenceNumber: PerseusPassageRefWidgetOptions["referenceNumber"];
|
|
16
9
|
summaryText: PerseusPassageRefWidgetOptions["summaryText"];
|
|
17
10
|
};
|
|
18
|
-
type
|
|
19
|
-
type Props = WidgetProps<RenderProps, Rubric>;
|
|
11
|
+
type Props = WidgetProps<RenderProps, PerseusPassageRefRubric>;
|
|
20
12
|
type DefaultProps = {
|
|
21
13
|
passageNumber: Props["passageNumber"];
|
|
22
14
|
referenceNumber: Props["referenceNumber"];
|
|
@@ -42,7 +34,7 @@ declare class PassageRef extends React.Component<Props, State> {
|
|
|
42
34
|
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
43
35
|
componentDidUpdate(): void;
|
|
44
36
|
componentWillUnmount(): void;
|
|
45
|
-
getUserInput
|
|
37
|
+
getUserInput(): PerseusPassageRefUserInput;
|
|
46
38
|
change: ChangeFn;
|
|
47
39
|
_deferredUpdateRange: () => void;
|
|
48
40
|
_updateRange: () => void;
|
|
@@ -3,6 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
|
|
|
3
3
|
import * as Changeable from "../../mixins/changeable";
|
|
4
4
|
import type { PerseusPassageRefTargetWidgetOptions } from "../../perseus-types";
|
|
5
5
|
import type { APIOptions } from "../../types";
|
|
6
|
+
import type { PerseusPassageRefTargetUserInput } from "../../validation.types";
|
|
6
7
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
7
8
|
type Props = Changeable.ChangeableProps & {
|
|
8
9
|
apiOptions: APIOptions;
|
|
@@ -21,7 +22,7 @@ declare class PassageRefTarget extends React.Component<Props> {
|
|
|
21
22
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
22
23
|
static defaultProps: DefaultProps;
|
|
23
24
|
static validate(): import("../../types").PerseusScore;
|
|
24
|
-
getUserInput
|
|
25
|
+
getUserInput(): PerseusPassageRefTargetUserInput;
|
|
25
26
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
26
27
|
simpleValidate(): import("../../types").PerseusScore;
|
|
27
28
|
render(): React.ReactNode;
|
|
@@ -6,9 +6,9 @@ import * as React from "react";
|
|
|
6
6
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
7
7
|
import type { PerseusPhetSimulationWidgetOptions } from "../../perseus-types";
|
|
8
8
|
import type { WidgetProps } from "../../types";
|
|
9
|
+
import type { PerseusPhetSimulationUserInput } from "../../validation.types";
|
|
9
10
|
type RenderProps = PerseusPhetSimulationWidgetOptions;
|
|
10
11
|
type Props = WidgetProps<RenderProps, PerseusPhetSimulationWidgetOptions>;
|
|
11
|
-
type UserInput = null;
|
|
12
12
|
type State = {
|
|
13
13
|
banner: {
|
|
14
14
|
message: string;
|
|
@@ -28,7 +28,7 @@ export declare class PhetSimulation extends React.Component<Props, State> {
|
|
|
28
28
|
constructor(props: any);
|
|
29
29
|
componentDidMount(): Promise<void>;
|
|
30
30
|
componentDidUpdate(prevProps: any): Promise<void>;
|
|
31
|
-
getUserInput():
|
|
31
|
+
getUserInput(): PerseusPhetSimulationUserInput;
|
|
32
32
|
getPhetCompatibleLocale: (arg1: string) => string;
|
|
33
33
|
displayLoadFailure: () => void;
|
|
34
34
|
updateSimState(urlString: string): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusPlotterRubric, PerseusPlotterUserInput } from "../../validation.types";
|
|
3
|
+
declare function plotterValidator(userInput: PerseusPlotterUserInput, rubric: PerseusPlotterRubric): PerseusScore;
|
|
4
|
+
export default plotterValidator;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import type { PerseusPlotterWidgetOptions } from "../../perseus-types";
|
|
4
|
-
import type { WidgetProps } from "../../types";
|
|
5
|
-
type
|
|
4
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
5
|
+
import type { PerseusPlotterRubric, PerseusPlotterUserInput } from "../../validation.types";
|
|
6
6
|
type RenderProps = PerseusPlotterWidgetOptions;
|
|
7
|
-
type Props = WidgetProps<RenderProps,
|
|
7
|
+
type Props = WidgetProps<RenderProps, PerseusPlotterRubric> & {
|
|
8
8
|
labelInterval: NonNullable<PerseusPlotterWidgetOptions["labelInterval"]>;
|
|
9
9
|
picSize: NonNullable<PerseusPlotterWidgetOptions["picSize"]>;
|
|
10
10
|
};
|
|
@@ -38,6 +38,7 @@ export declare class Plotter extends React.Component<Props, State> {
|
|
|
38
38
|
graphie: any;
|
|
39
39
|
static defaultProps: DefaultProps;
|
|
40
40
|
state: State;
|
|
41
|
+
static validate(userInput: PerseusPlotterUserInput, rubric: PerseusPlotterRubric): PerseusScore;
|
|
41
42
|
componentDidMount(): void;
|
|
42
43
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
43
44
|
componentDidUpdate(prevProps: Props, prevState: State): void;
|
|
@@ -67,8 +68,8 @@ export declare class Plotter extends React.Component<Props, State> {
|
|
|
67
68
|
setPicHeight: (arg1: number, arg2: number) => void;
|
|
68
69
|
changeAndTrack: (arg1: any) => void;
|
|
69
70
|
drawPicHeights: (arg1: any, arg2: any) => void;
|
|
70
|
-
getUserInput
|
|
71
|
-
simpleValidate
|
|
71
|
+
getUserInput(): PerseusPlotterUserInput;
|
|
72
|
+
simpleValidate(rubric: PerseusPlotterRubric): PerseusScore;
|
|
72
73
|
render(): React.ReactNode;
|
|
73
74
|
}
|
|
74
75
|
declare const _default: Readonly<{
|
|
@@ -4,6 +4,7 @@ import type { FocusFunction } from "./base-radio";
|
|
|
4
4
|
import type { PerseusRadioChoice, PerseusRadioWidgetOptions, ShowSolutions } from "../../perseus-types";
|
|
5
5
|
import type { PerseusStrings } from "../../strings";
|
|
6
6
|
import type { PerseusScore, WidgetProps, ChoiceState } from "../../types";
|
|
7
|
+
import type { PerseusRadioRubric, PerseusRadioUserInput } from "../../validation.types";
|
|
7
8
|
export type RenderProps = {
|
|
8
9
|
numCorrect: number;
|
|
9
10
|
hasNoneOfTheAbove?: boolean;
|
|
@@ -16,15 +17,7 @@ export type RenderProps = {
|
|
|
16
17
|
choiceStates?: ReadonlyArray<ChoiceState>;
|
|
17
18
|
values?: ReadonlyArray<boolean>;
|
|
18
19
|
};
|
|
19
|
-
type
|
|
20
|
-
countChoices?: boolean;
|
|
21
|
-
choicesSelected: ReadonlyArray<boolean>;
|
|
22
|
-
numCorrect?: number;
|
|
23
|
-
noneOfTheAboveIndex?: number | null | undefined;
|
|
24
|
-
noneOfTheAboveSelected?: boolean;
|
|
25
|
-
};
|
|
26
|
-
type Rubric = PerseusRadioWidgetOptions;
|
|
27
|
-
type Props = WidgetProps<RenderProps, Rubric>;
|
|
20
|
+
type Props = WidgetProps<RenderProps, PerseusRadioRubric>;
|
|
28
21
|
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
29
22
|
export type RadioChoiceWithMetadata = PerseusRadioChoice & {
|
|
30
23
|
originalIndex: number;
|
|
@@ -38,8 +31,8 @@ declare class Radio extends React.Component<Props> {
|
|
|
38
31
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
39
32
|
focusFunction: FocusFunction;
|
|
40
33
|
static defaultProps: DefaultProps;
|
|
41
|
-
static validate(userInput:
|
|
42
|
-
static getUserInputFromProps(props: Props):
|
|
34
|
+
static validate(userInput: PerseusRadioUserInput, rubric: PerseusRadioRubric, strings: PerseusStrings): PerseusScore;
|
|
35
|
+
static getUserInputFromProps(props: Props): PerseusRadioUserInput;
|
|
43
36
|
componentDidUpdate(prevProps: Props): void;
|
|
44
37
|
_renderRenderer: (content?: string) => React.ReactElement;
|
|
45
38
|
focus(choiceIndex?: number | null): boolean;
|
|
@@ -48,8 +41,8 @@ declare class Radio extends React.Component<Props> {
|
|
|
48
41
|
checked: ReadonlyArray<boolean>;
|
|
49
42
|
crossedOut: ReadonlyArray<boolean>;
|
|
50
43
|
}>) => void;
|
|
51
|
-
getUserInput
|
|
52
|
-
simpleValidate
|
|
44
|
+
getUserInput(): PerseusRadioUserInput;
|
|
45
|
+
simpleValidate(rubric: PerseusRadioRubric): PerseusScore;
|
|
53
46
|
/**
|
|
54
47
|
* Turn on rationale display for the currently selected choices. Note that
|
|
55
48
|
* this leaves rationales on for choices that are already showing
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusScore } from "../../types";
|
|
3
|
+
import type { PerseusRadioRubric, PerseusRadioUserInput } from "../../validation.types";
|
|
4
|
+
declare function radioValidator(userInput: PerseusRadioUserInput, rubric: PerseusRadioRubric, strings: PerseusStrings): PerseusScore;
|
|
5
|
+
export default radioValidator;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusSorterRubric, PerseusSorterUserInput } from "../../validation.types";
|
|
3
|
+
declare function sorterValidator(userInput: PerseusSorterUserInput, rubric: PerseusSorterRubric): PerseusScore;
|
|
4
|
+
export default sorterValidator;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { SortableOption } from "../../components/sortable";
|
|
3
3
|
import type { PerseusSorterWidgetOptions } from "../../perseus-types";
|
|
4
|
-
import type { WidgetProps } from "../../types";
|
|
4
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
5
|
+
import type { PerseusSorterRubric, PerseusSorterUserInput } from "../../validation.types";
|
|
5
6
|
type RenderProps = PerseusSorterWidgetOptions;
|
|
6
|
-
type
|
|
7
|
-
type Props = WidgetProps<RenderProps, Rubric>;
|
|
7
|
+
type Props = WidgetProps<RenderProps, PerseusSorterRubric>;
|
|
8
8
|
type DefaultProps = {
|
|
9
9
|
correct: Props["correct"];
|
|
10
10
|
layout: Props["layout"];
|
|
@@ -19,16 +19,14 @@ type State = {
|
|
|
19
19
|
declare class Sorter extends React.Component<Props, State> {
|
|
20
20
|
_isMounted: boolean;
|
|
21
21
|
static defaultProps: DefaultProps;
|
|
22
|
-
static validate(
|
|
23
|
-
state:
|
|
22
|
+
static validate(userInput: PerseusSorterUserInput, rubric: PerseusSorterRubric): PerseusScore;
|
|
23
|
+
state: State;
|
|
24
24
|
componentDidMount(): void;
|
|
25
25
|
componentWillUnmount(): void;
|
|
26
26
|
handleChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
|
|
27
|
-
getUserInput
|
|
28
|
-
options: any;
|
|
29
|
-
};
|
|
27
|
+
getUserInput(): PerseusSorterUserInput;
|
|
30
28
|
moveOptionToIndex: (option: SortableOption, index: number) => void;
|
|
31
|
-
simpleValidate
|
|
29
|
+
simpleValidate(rubric: PerseusSorterRubric): PerseusScore;
|
|
32
30
|
render(): React.ReactNode;
|
|
33
31
|
}
|
|
34
32
|
declare const _default: Readonly<{
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusScore } from "../../types";
|
|
3
|
+
import type { PerseusTableRubric, PerseusTableUserInput } from "../../validation.types";
|
|
4
|
+
declare function tableValidator(state: PerseusTableUserInput, rubric: PerseusTableRubric, strings: PerseusStrings): PerseusScore;
|
|
5
|
+
export default tableValidator;
|
|
@@ -3,13 +3,13 @@ import { PerseusI18nContext } from "../../components/i18n-context";
|
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
4
|
import type { PerseusTableWidgetOptions } from "../../perseus-types";
|
|
5
5
|
import type { PerseusStrings } from "../../strings";
|
|
6
|
-
import type { WidgetProps } from "../../types";
|
|
6
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
7
|
+
import type { PerseusTableRubric, PerseusTableUserInput } from "../../validation.types";
|
|
7
8
|
type RenderProps = PerseusTableWidgetOptions & {
|
|
8
9
|
editableHeaders: boolean;
|
|
9
10
|
Editor: any;
|
|
10
11
|
};
|
|
11
|
-
type
|
|
12
|
-
type Props = ChangeableProps & WidgetProps<RenderProps, Rubric>;
|
|
12
|
+
type Props = ChangeableProps & WidgetProps<RenderProps, PerseusTableRubric>;
|
|
13
13
|
type DefaultProps = {
|
|
14
14
|
apiOptions: Props["apiOptions"];
|
|
15
15
|
headers: Props["headers"];
|
|
@@ -26,12 +26,13 @@ declare class Table extends React.Component<Props> {
|
|
|
26
26
|
}>;
|
|
27
27
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
28
28
|
static defaultProps: DefaultProps;
|
|
29
|
+
static validate(state: PerseusTableUserInput, rubric: PerseusTableRubric, strings: PerseusStrings): PerseusScore;
|
|
29
30
|
_getRows: () => number;
|
|
30
31
|
_getColumns: () => number;
|
|
31
|
-
getUserInput
|
|
32
|
+
getUserInput(): PerseusTableUserInput;
|
|
32
33
|
onValueChange: (arg1: any, arg2: any, arg3: any) => void;
|
|
33
34
|
onHeaderChange: (arg1: number, arg2: any) => void;
|
|
34
|
-
simpleValidate
|
|
35
|
+
simpleValidate(rubric: PerseusTableWidgetOptions): PerseusScore;
|
|
35
36
|
_handleFocus: (arg1: any) => void;
|
|
36
37
|
_handleBlur: (arg1: any) => void;
|
|
37
38
|
focus: () => boolean;
|
|
@@ -5,9 +5,9 @@ import * as React from "react";
|
|
|
5
5
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
6
6
|
import type { PerseusVideoWidgetOptions } from "../../perseus-types";
|
|
7
7
|
import type { WidgetProps } from "../../types";
|
|
8
|
-
type
|
|
8
|
+
import type { PerseusVideoRubric } from "../../validation.types";
|
|
9
9
|
type RenderProps = PerseusVideoWidgetOptions;
|
|
10
|
-
type Props = WidgetProps<RenderProps,
|
|
10
|
+
type Props = WidgetProps<RenderProps, PerseusVideoRubric> & {
|
|
11
11
|
alignment: string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
package/package.json
CHANGED