@khanacademy/perseus-editor 13.0.1 → 14.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.
Files changed (34) hide show
  1. package/dist/all-editors.d.ts +1 -4
  2. package/dist/components/hover-behavior.d.ts +2 -2
  3. package/dist/components/widget-editor.d.ts +1 -1
  4. package/dist/content-preview.d.ts +22 -0
  5. package/dist/es/index.js +202 -633
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +748 -1197
  9. package/dist/index.js.map +1 -1
  10. package/dist/widgets/expression-editor.d.ts +1 -1
  11. package/dist/widgets/graded-group-editor.d.ts +1 -1
  12. package/dist/widgets/grapher-editor.d.ts +1 -1
  13. package/dist/widgets/group-editor.d.ts +1 -1
  14. package/dist/widgets/iframe-editor.d.ts +1 -1
  15. package/dist/widgets/image-editor.d.ts +2 -2
  16. package/dist/widgets/input-number-editor.d.ts +1 -1
  17. package/dist/widgets/interactive-graph-editor.d.ts +8 -114
  18. package/dist/widgets/matcher-editor.d.ts +1 -1
  19. package/dist/widgets/matrix-editor.d.ts +1 -1
  20. package/dist/widgets/measurer-editor.d.ts +1 -1
  21. package/dist/widgets/numeric-input-editor.d.ts +1 -1
  22. package/dist/widgets/orderer-editor.d.ts +1 -1
  23. package/dist/widgets/phet-simulation-editor.d.ts +2 -1
  24. package/dist/widgets/radio/editor.d.ts +1 -1
  25. package/dist/widgets/table-editor.d.ts +1 -1
  26. package/package.json +36 -35
  27. package/dist/all-widgets.d.ts +0 -22
  28. package/dist/testing-widgets.d.ts +0 -22
  29. package/dist/widgets/example-graphie-widget-editor.d.ts +0 -18
  30. package/dist/widgets/example-graphie-widget.d.ts +0 -61
  31. package/dist/widgets/example-widget-editor.d.ts +0 -20
  32. package/dist/widgets/example-widget.d.ts +0 -89
  33. package/dist/widgets/simple-markdown-tester-editor.d.ts +0 -21
  34. package/dist/widgets/simple-markdown-tester.d.ts +0 -54
@@ -19,7 +19,6 @@ declare class ExpressionEditor extends React.Component<Props, State> {
19
19
  static defaultProps: DefaultProps;
20
20
  constructor(props: any);
21
21
  change(...args: any[]): any;
22
- render(): React.ReactNode;
23
22
  serialize: () => any;
24
23
  getSaveWarnings: () => any;
25
24
  _newEmptyAnswerForm: () => any;
@@ -31,5 +30,6 @@ declare class ExpressionEditor extends React.Component<Props, State> {
31
30
  handleToggleDiv: () => void;
32
31
  handleTexInsert: (arg1: string) => void;
33
32
  handleFunctions: (value: string) => void;
33
+ render(): React.ReactNode;
34
34
  }
35
35
  export default ExpressionEditor;
@@ -44,11 +44,11 @@ declare class GradedGroupEditor extends React.Component<Props> {
44
44
  change: (arg1: any, arg2: any, arg3: any) => any;
45
45
  handleAddHint: () => void;
46
46
  handleRemoveHint: (arg1: React.MouseEvent) => void;
47
- render(): React.ReactNode;
48
47
  getSaveWarnings: () => any;
49
48
  serialize: () => {
50
49
  title: string;
51
50
  hint: any | null | undefined;
52
51
  };
52
+ render(): React.ReactNode;
53
53
  }
54
54
  export default GradedGroupEditor;
@@ -7,8 +7,8 @@ declare class GrapherEditor extends React.Component<Props> {
7
7
  static widgetName: "grapher";
8
8
  static defaultProps: Props;
9
9
  change: (arg1: any, arg2: any, arg3: any) => any;
10
- render(): React.ReactNode;
11
10
  handleAvailableTypesChange: (newAvailableTypes: Array<any>) => void;
12
11
  serialize: () => any;
12
+ render(): React.ReactNode;
13
13
  }
14
14
  export default GrapherEditor;
@@ -40,10 +40,10 @@ declare class GroupEditor extends React.Component<Props> {
40
40
  static widgetName: "group";
41
41
  static defaultProps: Props;
42
42
  editor: React.RefObject<Editor>;
43
- render(): React.ReactNode;
44
43
  _renderMetadataEditor: () => React.ReactElement;
45
44
  change: (arg1: any, arg2: any, arg3: any) => any;
46
45
  getSaveWarnings: () => ReadonlyArray<any>;
47
46
  serialize: () => any;
47
+ render(): React.ReactNode;
48
48
  }
49
49
  export default GroupEditor;
@@ -11,8 +11,8 @@ declare class IframeEditor extends React.Component<IframeEditorProps> {
11
11
  static widgetName: "iframe";
12
12
  static defaultProps: IframeEditorProps;
13
13
  change: (arg1: any, arg2: any, arg3: any) => any;
14
- render(): React.ReactNode;
15
14
  handleSettingsChange: (arg1: any) => void;
16
15
  serialize: () => any;
16
+ render(): React.ReactNode;
17
17
  }
18
18
  export default IframeEditor;
@@ -24,14 +24,13 @@ type State = {
24
24
  backgroundImageError?: string;
25
25
  };
26
26
  declare class ImageEditor extends React.Component<Props> {
27
- _isMounted: boolean;
28
27
  static displayName: string;
29
28
  static widgetName: string;
29
+ _isMounted: boolean;
30
30
  static defaultProps: DefaultProps;
31
31
  state: State;
32
32
  componentDidMount(): void;
33
33
  componentWillUnmount(): void;
34
- render(): React.JSX.Element;
35
34
  _renderRowForLabel(label: any, i: any): React.JSX.Element;
36
35
  change(...args: any[]): any;
37
36
  removeLabel(labelIndex: any, e: any): void;
@@ -42,5 +41,6 @@ declare class ImageEditor extends React.Component<Props> {
42
41
  onUrlChange(url: string | undefined | null, silent: boolean): Promise<void>;
43
42
  onRangeChange(type: any, newRange: any): void;
44
43
  serialize(): any;
44
+ render(): React.JSX.Element;
45
45
  }
46
46
  export default ImageEditor;
@@ -40,7 +40,6 @@ declare class InputNumberEditor extends React.Component<Props> {
40
40
  static defaultProps: DefaultProps;
41
41
  input: React.RefObject<BlurInput>;
42
42
  handleAnswerChange: (arg1: string) => void;
43
- render(): React.ReactNode;
44
43
  focus: () => boolean;
45
44
  serialize: () => {
46
45
  value: Props["value"];
@@ -51,5 +50,6 @@ declare class InputNumberEditor extends React.Component<Props> {
51
50
  answerType: Props["answerType"];
52
51
  rightAlign: Props["rightAlign"];
53
52
  };
53
+ render(): React.ReactNode;
54
54
  }
55
55
  export default InputNumberEditor;
@@ -3,97 +3,7 @@ import * as React from "react";
3
3
  import type { PerseusImageBackground, PerseusInteractiveGraphWidgetOptions, APIOptionsWithDefaults, LockedFigure } from "@khanacademy/perseus";
4
4
  import type { PropsFor } from "@khanacademy/wonder-blocks-core";
5
5
  declare const InteractiveGraph: {
6
- new (props: (PerseusInteractiveGraphWidgetOptions & {
7
- widgetId: string;
8
- alignment: string | null | undefined;
9
- static: boolean | null | undefined;
10
- problemNum: number | null | undefined;
11
- apiOptions: Readonly<Readonly<{
12
- isArticle?: boolean | undefined;
13
- onInputError?: ((widgetId: any, value: string, message?: string | null | undefined) => unknown) | undefined;
14
- onFocusChange?: ((newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
15
- GroupMetadataEditor?: React.ComponentType<any> | undefined;
16
- showAlignmentOptions?: boolean | undefined;
17
- readOnly?: boolean | undefined;
18
- answerableCallback?: ((arg1: boolean) => unknown) | undefined;
19
- getAnotherHint?: (() => unknown) | undefined;
20
- interactionCallback?: ((widgetData: {
21
- [widgetId: string]: any;
22
- }) => void) | undefined;
23
- groupAnnotator?: ((groupNumber: number, widgetId: string) => React.ReactNode) | undefined;
24
- imagePlaceholder?: React.ReactNode;
25
- widgetPlaceholder?: React.ReactNode;
26
- baseElements?: {
27
- Link: React.ComponentType<any>;
28
- } | undefined;
29
- imagePreloader?: ((dimensions: import("../../../perseus/src/types").Dimensions) => React.ReactNode) | undefined;
30
- trackInteraction?: ((args: {
31
- type: string;
32
- id: string;
33
- correct?: boolean | undefined;
34
- } & Partial<import("../../../perseus/src/types").TrackingGradedGroupExtraArguments> & Partial<import("../../../perseus/src/types").TrackingSequenceExtraArguments>) => void) | undefined;
35
- customKeypad?: boolean | undefined;
36
- nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
37
- isMobile?: boolean | undefined;
38
- setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
39
- hintProgressColor?: string | undefined;
40
- canScrollPage?: boolean | undefined;
41
- crossOutEnabled?: boolean | undefined;
42
- editorChangeDelay?: number | undefined;
43
- flags?: {
44
- mafs?: false | ({
45
- circle?: boolean | undefined;
46
- polygon?: boolean | undefined;
47
- linear?: boolean | undefined;
48
- quadratic?: boolean | undefined;
49
- sinusoid?: boolean | undefined;
50
- point?: boolean | undefined;
51
- ray?: boolean | undefined;
52
- segment?: boolean | undefined;
53
- angle?: boolean | undefined;
54
- "linear-system"?: boolean | undefined;
55
- "unlimited-point"?: boolean | undefined;
56
- } & {
57
- "interactive-graph-locked-features-m2b"?: boolean | undefined;
58
- "interactive-graph-locked-features-labels"?: boolean | undefined;
59
- } & {
60
- "start-coords-ui-phase-1"?: boolean | undefined;
61
- "start-coords-ui-phase-2"?: boolean | undefined;
62
- "start-coords-ui-point"?: boolean | undefined;
63
- "start-coords-ui-polygon"?: boolean | undefined;
64
- "start-coords-ui-angle"?: boolean | undefined;
65
- }) | undefined;
66
- } | undefined;
67
- onWidgetStartProps?: ((widgets: import("@khanacademy/perseus").PerseusWidgetsMap) => void) | undefined;
68
- }> & {
69
- GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
70
- baseElements: {
71
- Link: React.ComponentType<any>;
72
- };
73
- canScrollPage: NonNullable<boolean | undefined>;
74
- crossOutEnabled: NonNullable<boolean | undefined>;
75
- editorChangeDelay: number;
76
- groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
77
- isArticle: NonNullable<boolean | undefined>;
78
- isMobile: NonNullable<boolean | undefined>;
79
- onFocusChange: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
80
- onInputError: (widgetId: any, value: string, message?: string | null | undefined) => unknown;
81
- readOnly: NonNullable<boolean | undefined>;
82
- setDrawingAreaAvailable: (arg1: boolean) => unknown;
83
- showAlignmentOptions: NonNullable<boolean | undefined>;
84
- }>;
85
- keypadElement?: any;
86
- questionCompleted?: boolean | undefined;
87
- onFocus: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
88
- onBlur: (blurPath: import("@khanacademy/perseus").FocusPath) => void;
89
- findWidgets: (arg1: import("../../../perseus/src/types").FilterCriterion) => readonly any[];
90
- reviewModeRubric: import("../../../perseus/src/widgets/interactive-graph").Rubric;
91
- onChange: import("@khanacademy/perseus").ChangeHandler;
92
- trackInteraction: (extraData?: Empty | undefined) => void;
93
- isLastUsedWidget: boolean;
94
- linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
95
- containerSizeClass: SizingUtils.SizeClass;
96
- }) | Readonly<PerseusInteractiveGraphWidgetOptions & {
6
+ new (props: PerseusInteractiveGraphWidgetOptions & {
97
7
  widgetId: string;
98
8
  alignment: string | null | undefined;
99
9
  static: boolean | null | undefined;
@@ -183,7 +93,7 @@ declare const InteractiveGraph: {
183
93
  isLastUsedWidget: boolean;
184
94
  linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
185
95
  containerSizeClass: SizingUtils.SizeClass;
186
- }>): {
96
+ }): {
187
97
  legacyGraphRef: React.RefObject<{
188
98
  context: {
189
99
  strings: import("../../../perseus/src/strings").PerseusStrings;
@@ -583,10 +493,7 @@ declare const InteractiveGraph: {
583
493
  areAngleGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeAngle, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeAngle): boolean;
584
494
  arePointGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePoint, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePoint): boolean;
585
495
  arePolygonGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePolygon, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePolygon): boolean;
586
- areSegmentGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment): boolean; /**
587
- * An error message to display in the graph area, or true if the
588
- * graph is valid.
589
- */
496
+ areSegmentGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment): boolean;
590
497
  _lineStroke: () => {
591
498
  "stroke-width"?: number | undefined;
592
499
  };
@@ -595,12 +502,7 @@ declare const InteractiveGraph: {
595
502
  addLinearControls: () => void;
596
503
  removeLinearControls: () => void;
597
504
  addQuadraticControls: () => void;
598
- updateQuadratic: () => void; /**
599
- * The type of markings to display on the graph.
600
- * - graph: shows the axes and the grid lines
601
- * - grid: shows only the grid lines
602
- * - none: shows no markings
603
- */
505
+ updateQuadratic: () => void;
604
506
  removeQuadraticControls: () => void;
605
507
  addSinusoidControls: () => void;
606
508
  updateSinusoid: () => void;
@@ -2422,10 +2324,7 @@ declare const InteractiveGraph: {
2422
2324
  areAngleGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeAngle, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeAngle): boolean;
2423
2325
  arePointGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePoint, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePoint): boolean;
2424
2326
  arePolygonGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePolygon, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypePolygon): boolean;
2425
- areSegmentGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment): boolean; /**
2426
- * An error message to display in the graph area, or true if the
2427
- * graph is valid.
2428
- */
2327
+ areSegmentGraphsEqual(prevGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment, currentGraph: import("../../../perseus/src/perseus-types").PerseusGraphTypeSegment): boolean;
2429
2328
  _lineStroke: () => {
2430
2329
  "stroke-width"?: number | undefined;
2431
2330
  };
@@ -2434,12 +2333,7 @@ declare const InteractiveGraph: {
2434
2333
  addLinearControls: () => void;
2435
2334
  removeLinearControls: () => void;
2436
2335
  addQuadraticControls: () => void;
2437
- updateQuadratic: () => void; /**
2438
- * The type of markings to display on the graph.
2439
- * - graph: shows the axes and the grid lines
2440
- * - grid: shows only the grid lines
2441
- * - none: shows no markings
2442
- */
2336
+ updateQuadratic: () => void;
2443
2337
  removeQuadraticControls: () => void;
2444
2338
  addSinusoidControls: () => void;
2445
2339
  updateSinusoid: () => void;
@@ -5974,9 +5868,9 @@ type DefaultProps = {
5974
5868
  * Used in the exercise editor.
5975
5869
  */
5976
5870
  declare class InteractiveGraphEditor extends React.Component<Props> {
5871
+ static widgetName: string;
5977
5872
  displayName: string;
5978
5873
  className: string;
5979
- static widgetName: string;
5980
5874
  static defaultProps: DefaultProps;
5981
5875
  deprecatedProps: {
5982
5876
  readonly showGraph: (props: any) => {
@@ -5984,10 +5878,10 @@ declare class InteractiveGraphEditor extends React.Component<Props> {
5984
5878
  };
5985
5879
  };
5986
5880
  UNSAFE_componentWillMount(): void;
5987
- render(): React.JSX.Element;
5988
5881
  changeMatchType: (newValue: any) => void;
5989
5882
  changeStartCoords: (coords: any) => void;
5990
5883
  serialize(): PerseusInteractiveGraphWidgetOptions;
5991
5884
  getSaveWarnings: () => any[];
5885
+ render(): React.JSX.Element;
5992
5886
  }
5993
5887
  export default InteractiveGraphEditor;
@@ -11,9 +11,9 @@ declare class MatcherEditor extends React.Component<Props> {
11
11
  };
12
12
  static widgetName: "matcher";
13
13
  static defaultProps: Props;
14
- render(): React.ReactNode;
15
14
  onLabelChange: (arg1: number, arg2: React.ChangeEvent<HTMLInputElement>) => void;
16
15
  getSaveWarnings: () => ReadonlyArray<string>;
17
16
  serialize: any;
17
+ render(): React.ReactNode;
18
18
  }
19
19
  export default MatcherEditor;
@@ -12,9 +12,9 @@ declare class MatrixEditor extends React.Component<Props> {
12
12
  };
13
13
  static widgetName: "matrix";
14
14
  static defaultProps: Props;
15
- render(): React.ReactNode;
16
15
  change: (arg1: any, arg2: any, arg3: any) => any;
17
16
  onMatrixBoardSizeChange: (arg1: [number, number]) => void;
18
17
  serialize: () => any;
18
+ render(): React.ReactNode;
19
19
  }
20
20
  export default MatrixEditor;
@@ -20,7 +20,6 @@ declare class MeasurerEditor extends React.Component<Props> {
20
20
  };
21
21
  static defaultProps: Props;
22
22
  className: string;
23
- render(): React.ReactNode;
24
23
  change: (arg1: any, arg2: any, arg3: any) => any;
25
24
  _changeUrl: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
26
25
  _changeTop: (arg1: any) => void;
@@ -28,5 +27,6 @@ declare class MeasurerEditor extends React.Component<Props> {
28
27
  _changeImage: (arg1: string, arg2: any) => void;
29
28
  renderLabelChoices: (arg1: ReadonlyArray<[string, string]>) => ReadonlyArray<React.ReactElement<React.ComponentProps<"option">>>;
30
29
  serialize: () => any;
30
+ render(): React.ReactNode;
31
31
  }
32
32
  export default MeasurerEditor;
@@ -56,7 +56,6 @@ declare class NumericInputEditor extends React.Component<Props, State> {
56
56
  rightAlign: boolean;
57
57
  };
58
58
  constructor(props: Props);
59
- render(): React.JSX.Element;
60
59
  change: (...args: any[]) => any;
61
60
  onToggleOptions: (choiceIndex: any) => void;
62
61
  onTrashAnswer: (choiceIndex: any) => void;
@@ -66,5 +65,6 @@ declare class NumericInputEditor extends React.Component<Props, State> {
66
65
  addAnswer: () => void;
67
66
  getSaveWarnings: () => never[];
68
67
  serialize: () => any;
68
+ render(): React.JSX.Element;
69
69
  }
70
70
  export default NumericInputEditor;
@@ -11,10 +11,10 @@ declare class OrdererEditor extends React.Component<Props> {
11
11
  };
12
12
  static widgetName: "orderer";
13
13
  static defaultProps: Props;
14
- render(): React.ReactNode;
15
14
  onOptionsChange: (arg1: "correctOptions" | "otherOptions", arg2: any, arg3: any) => any;
16
15
  onLayoutChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
17
16
  onHeightChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
18
17
  serialize: () => any;
18
+ render(): React.ReactNode;
19
19
  }
20
20
  export default OrdererEditor;
@@ -13,7 +13,8 @@ type Props = DefaultProps & {
13
13
  declare class PhetSimulationEditor extends React.Component<Props> {
14
14
  static defaultProps: DefaultProps;
15
15
  static widgetName: "phet-simulation";
16
- render(): React.ReactNode;
17
16
  serialize(): PerseusPhetSimulationWidgetOptions;
17
+ getSaveWarnings: () => ReadonlyArray<string>;
18
+ render(): React.ReactNode;
18
19
  }
19
20
  export default PhetSimulationEditor;
@@ -45,7 +45,6 @@ declare class RadioEditor extends React.Component<any> {
45
45
  };
46
46
  static widgetName: "radio";
47
47
  static defaultProps: any;
48
- render(): React.ReactNode;
49
48
  change: (...args: ReadonlyArray<unknown>) => any;
50
49
  onMultipleSelectChange: (arg1: any) => any;
51
50
  onCountChoicesChange: (arg1: any) => void;
@@ -58,5 +57,6 @@ declare class RadioEditor extends React.Component<any> {
58
57
  focus: () => boolean;
59
58
  getSaveWarnings: () => ReadonlyArray<string>;
60
59
  serialize: () => any;
60
+ render(): React.ReactNode;
61
61
  }
62
62
  export default RadioEditor;
@@ -13,8 +13,8 @@ declare class TableEditor extends React.Component<Props> {
13
13
  static defaultProps: Props;
14
14
  numberOfColumns: React.RefObject<components.NumberInput>;
15
15
  focus: () => void;
16
- render(): React.ReactNode;
17
16
  onSizeInput: (arg1: number, arg2: number) => void;
18
17
  serialize: () => any;
18
+ render(): React.ReactNode;
19
19
  }
20
20
  export default TableEditor;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Perseus editors",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "13.0.1",
6
+ "version": "14.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -35,26 +35,27 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@khanacademy/kas": "^0.3.12",
38
+ "@khanacademy/keypad-context": "^1.0.1",
38
39
  "@khanacademy/kmath": "^0.1.13",
39
- "@khanacademy/math-input": "^21.0.1",
40
- "@khanacademy/perseus": "^31.0.1",
40
+ "@khanacademy/math-input": "^21.0.2",
41
+ "@khanacademy/perseus": "^32.0.0",
41
42
  "@khanacademy/perseus-core": "1.5.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@khanacademy/wonder-blocks-accordion": "1.3.1",
45
- "@khanacademy/wonder-blocks-banner": "3.0.42",
46
- "@khanacademy/wonder-blocks-button": "6.3.1",
47
- "@khanacademy/wonder-blocks-clickable": "4.2.1",
48
- "@khanacademy/wonder-blocks-core": "6.4.0",
49
- "@khanacademy/wonder-blocks-dropdown": "5.3.0",
50
- "@khanacademy/wonder-blocks-form": "^4.7.1",
51
- "@khanacademy/wonder-blocks-icon": "4.1.0",
52
- "@khanacademy/wonder-blocks-icon-button": "5.2.1",
53
- "@khanacademy/wonder-blocks-switch": "1.1.16",
54
- "@khanacademy/wonder-blocks-timing": "5.0.0",
55
- "@khanacademy/wonder-blocks-tokens": "1.3.0",
56
- "@khanacademy/wonder-blocks-tooltip": "2.3.1",
57
- "@khanacademy/wonder-blocks-typography": "2.1.11",
45
+ "@khanacademy/wonder-blocks-accordion": "1.3.6",
46
+ "@khanacademy/wonder-blocks-banner": "3.1.7",
47
+ "@khanacademy/wonder-blocks-button": "6.3.8",
48
+ "@khanacademy/wonder-blocks-clickable": "4.2.6",
49
+ "@khanacademy/wonder-blocks-core": "6.4.3",
50
+ "@khanacademy/wonder-blocks-dropdown": "5.4.5",
51
+ "@khanacademy/wonder-blocks-form": "4.9.0",
52
+ "@khanacademy/wonder-blocks-icon": "4.1.3",
53
+ "@khanacademy/wonder-blocks-icon-button": "5.3.4",
54
+ "@khanacademy/wonder-blocks-switch": "1.1.20",
55
+ "@khanacademy/wonder-blocks-timing": "5.0.1",
56
+ "@khanacademy/wonder-blocks-tokens": "2.0.0",
57
+ "@khanacademy/wonder-blocks-tooltip": "2.4.0",
58
+ "@khanacademy/wonder-blocks-typography": "2.1.14",
58
59
  "@khanacademy/wonder-stuff-core": "1.5.2",
59
60
  "@phosphor-icons/core": "^2.0.2",
60
61
  "aphrodite": "^1.2.5",
@@ -64,25 +65,25 @@
64
65
  "katex": "0.11.1",
65
66
  "perseus-build-settings": "^0.4.1",
66
67
  "prop-types": "15.6.1",
67
- "react": ">= 18",
68
- "react-dom": ">= 18",
68
+ "react": "^18.2.0",
69
+ "react-dom": "^18.2.0",
69
70
  "underscore": "^1.4.4"
70
71
  },
71
72
  "peerDependencies": {
72
- "@khanacademy/wonder-blocks-accordion": "1.3.1",
73
- "@khanacademy/wonder-blocks-banner": "3.0.42",
74
- "@khanacademy/wonder-blocks-button": "6.3.1",
75
- "@khanacademy/wonder-blocks-clickable": "4.2.1",
76
- "@khanacademy/wonder-blocks-core": "6.4.0",
77
- "@khanacademy/wonder-blocks-dropdown": "5.3.0",
78
- "@khanacademy/wonder-blocks-form": "^4.7.1",
79
- "@khanacademy/wonder-blocks-icon": "4.1.0",
80
- "@khanacademy/wonder-blocks-icon-button": "5.2.1",
81
- "@khanacademy/wonder-blocks-switch": "1.1.16",
82
- "@khanacademy/wonder-blocks-timing": "5.0.0",
83
- "@khanacademy/wonder-blocks-tokens": "1.3.0",
84
- "@khanacademy/wonder-blocks-tooltip": "2.3.1",
85
- "@khanacademy/wonder-blocks-typography": "2.1.11",
73
+ "@khanacademy/wonder-blocks-accordion": "1.3.6",
74
+ "@khanacademy/wonder-blocks-banner": "3.1.7",
75
+ "@khanacademy/wonder-blocks-button": "6.3.8",
76
+ "@khanacademy/wonder-blocks-clickable": "4.2.6",
77
+ "@khanacademy/wonder-blocks-core": "6.4.3",
78
+ "@khanacademy/wonder-blocks-dropdown": "5.4.5",
79
+ "@khanacademy/wonder-blocks-form": "4.9.0",
80
+ "@khanacademy/wonder-blocks-icon": "4.1.3",
81
+ "@khanacademy/wonder-blocks-icon-button": "5.3.4",
82
+ "@khanacademy/wonder-blocks-switch": "1.1.20",
83
+ "@khanacademy/wonder-blocks-timing": "5.0.1",
84
+ "@khanacademy/wonder-blocks-tokens": "2.0.0",
85
+ "@khanacademy/wonder-blocks-tooltip": "2.4.0",
86
+ "@khanacademy/wonder-blocks-typography": "2.1.14",
86
87
  "@khanacademy/wonder-stuff-core": "1.5.2",
87
88
  "@phosphor-icons/core": "^2.0.2",
88
89
  "aphrodite": "^1.2.5",
@@ -90,8 +91,8 @@
90
91
  "create-react-class": "15.6.3",
91
92
  "jquery": "^2.1.1",
92
93
  "prop-types": "15.6.1",
93
- "react": ">= 18",
94
- "react-dom": ">= 18",
94
+ "react": "^18.2.0",
95
+ "react-dom": "^18.2.0",
95
96
  "underscore": "^1.4.4"
96
97
  },
97
98
  "keywords": []
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: readonly Readonly<{
3
- name: string;
4
- displayName: string;
5
- getWidget?: (() => import("react").ComponentType<any>) | undefined;
6
- widget: import("react").ComponentType<any>;
7
- accessible?: boolean | ((props: any) => boolean) | undefined;
8
- hidden?: boolean | undefined;
9
- version?: import("@khanacademy/perseus").Version | undefined;
10
- supportedAlignments?: readonly import("@khanacademy/perseus").Alignment[] | undefined;
11
- defaultAlignment?: import("@khanacademy/perseus").Alignment | undefined;
12
- getDefaultAlignment?: (() => import("@khanacademy/perseus").Alignment) | undefined;
13
- isLintable?: boolean | undefined;
14
- tracking?: import("../../perseus/src/types").Tracking | undefined;
15
- traverseChildWidgets?: any;
16
- transform?: import("../../perseus/src/types").WidgetTransform | undefined;
17
- staticTransform?: import("../../perseus/src/types").WidgetTransform | undefined;
18
- propUpgrades?: {
19
- [key: string]: (arg1: any) => any;
20
- } | undefined;
21
- }>[];
22
- export default _default;
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: readonly Readonly<{
3
- name: string;
4
- displayName: string;
5
- getWidget?: (() => import("react").ComponentType<any>) | undefined;
6
- widget: import("react").ComponentType<any>;
7
- accessible?: boolean | ((props: any) => boolean) | undefined;
8
- hidden?: boolean | undefined;
9
- version?: import("@khanacademy/perseus").Version | undefined;
10
- supportedAlignments?: readonly import("@khanacademy/perseus").Alignment[] | undefined;
11
- defaultAlignment?: import("@khanacademy/perseus").Alignment | undefined;
12
- getDefaultAlignment?: (() => import("@khanacademy/perseus").Alignment) | undefined;
13
- isLintable?: boolean | undefined;
14
- tracking?: import("../../perseus/src/types").Tracking | undefined;
15
- traverseChildWidgets?: any;
16
- transform?: import("../../perseus/src/types").WidgetTransform | undefined;
17
- staticTransform?: import("../../perseus/src/types").WidgetTransform | undefined;
18
- propUpgrades?: {
19
- [key: string]: (arg1: any) => any;
20
- } | undefined;
21
- }>[];
22
- export default _default;
@@ -1,18 +0,0 @@
1
- import * as React from "react";
2
- type Props = any;
3
- /**
4
- * This is the widget's editor. This is what shows up on the left side
5
- * of the screen in the demo page. Only the question writer sees this.
6
- */
7
- declare class ExampleGraphieWidgetEditor extends React.Component<Props> {
8
- static propTypes: {
9
- onChange: import("prop-types").Validator<(...args: any[]) => any>;
10
- };
11
- static widgetName: "example-graphie-widget";
12
- static defaultProps: Props;
13
- change: (arg1: any, arg2: any, arg3: any) => any;
14
- handleChange: (arg1: any) => void;
15
- serialize: () => any;
16
- render(): React.ReactNode;
17
- }
18
- export default ExampleGraphieWidgetEditor;
@@ -1,61 +0,0 @@
1
- /**
2
- * This is an example graphie-using widget
3
- *
4
- * TODO(jack): Add more comments
5
- */
6
- import { Changeable } from "@khanacademy/perseus";
7
- import * as React from "react";
8
- import type { Coord, PerseusExampleGraphieWidgetOptions, APIOptionsWithDefaults } from "@khanacademy/perseus";
9
- type Props = Changeable.ChangeableProps & {
10
- apiOptions: APIOptionsWithDefaults;
11
- graph: PerseusExampleGraphieWidgetOptions["graph"];
12
- coord: PerseusExampleGraphieWidgetOptions["coord"];
13
- };
14
- type DefaultProps = {
15
- graph: Props["graph"];
16
- coord: Props["coord"];
17
- };
18
- /**
19
- * This is the widget's renderer. It shows up in the right column
20
- * in the demo, and is what is visible to users, and where
21
- * users enter their answers.
22
- */
23
- declare class ExampleGraphieWidget extends React.Component<Props> {
24
- static defaultProps: DefaultProps;
25
- /**
26
- * This is the widget's grading function
27
- */
28
- static validate(state: any, rubric: any): any;
29
- getUserInput: () => any;
30
- render(): React.ReactNode;
31
- change: (arg1: any, arg2: any, arg3: any) => any;
32
- movePoint: (arg1: Coord) => void;
33
- _getGridConfig: (arg1: any) => any;
34
- setupGraphie: (arg1: any, arg2: any) => any;
35
- simpleValidate: (arg1: any) => any;
36
- }
37
- /**
38
- * For this widget to work, we must export it.
39
- * We also must import this file in src/all-widgets.js
40
- */
41
- declare const _default: Readonly<{
42
- name: string;
43
- displayName: string;
44
- getWidget?: (() => typeof ExampleGraphieWidget) | undefined;
45
- widget: typeof ExampleGraphieWidget;
46
- accessible?: boolean | ((props: any) => boolean) | undefined;
47
- hidden?: boolean | undefined;
48
- version?: import("@khanacademy/perseus").Version | undefined;
49
- supportedAlignments?: readonly import("@khanacademy/perseus").Alignment[] | undefined;
50
- defaultAlignment?: import("@khanacademy/perseus").Alignment | undefined;
51
- getDefaultAlignment?: (() => import("@khanacademy/perseus").Alignment) | undefined;
52
- isLintable?: boolean | undefined;
53
- tracking?: import("../../../perseus/src/types").Tracking | undefined;
54
- traverseChildWidgets?: any;
55
- transform?: import("../../../perseus/src/types").WidgetTransform | undefined;
56
- staticTransform?: import("../../../perseus/src/types").WidgetTransform | undefined;
57
- propUpgrades?: {
58
- [key: string]: (arg1: any) => any;
59
- } | undefined;
60
- }>;
61
- export default _default;
@@ -1,20 +0,0 @@
1
- import * as React from "react";
2
- type Props = any;
3
- /**
4
- * This is the widget's editor. This is what shows up on the left side
5
- * of the screen in the demo. Only the question writer sees this.
6
- */
7
- declare class ExampleWidgetEditor extends React.Component<Props> {
8
- static propTypes: {
9
- onChange: import("prop-types").Validator<(...args: any[]) => any>;
10
- };
11
- static widgetName: "example-widget";
12
- static defaultProps: Props;
13
- input: React.RefObject<HTMLInputElement>;
14
- handleAnswerChange: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
15
- render(): React.ReactNode;
16
- change: (arg1: any, arg2: any, arg3: any) => any;
17
- focus: () => boolean;
18
- serialize: () => any;
19
- }
20
- export default ExampleWidgetEditor;