@khanacademy/perseus-editor 2.6.1 → 2.6.3

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 (176) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/article-editor.d.ts +1 -2
  3. package/dist/components/form-wrapped-text-field.d.ts +1 -10
  4. package/dist/components/graph-points-count-selector.d.ts +1 -1
  5. package/dist/es/index.js +373 -364
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/index.js +375 -366
  8. package/dist/index.js.map +1 -1
  9. package/dist/widgets/input-number-editor.d.ts +1 -2
  10. package/dist/widgets/interactive-graph-editor.d.ts +140 -139
  11. package/package.json +12 -12
  12. package/src/__stories__/editor.stories.tsx +3 -1
  13. package/src/__tests__/i18n.test.ts +1 -1
  14. package/src/article-editor.tsx +13 -14
  15. package/src/components/checkbox.tsx +1 -1
  16. package/src/components/dropdown-option.tsx +12 -12
  17. package/src/components/form-wrapped-text-field.tsx +4 -2
  18. package/src/components/graph-points-count-selector.tsx +3 -1
  19. package/src/components/graph-settings.tsx +1 -1
  20. package/src/components/hover-behavior.ts +2 -2
  21. package/src/components/json-editor.tsx +2 -2
  22. package/src/components/sortable.tsx +1 -1
  23. package/src/components/util.ts +1 -1
  24. package/src/components/widget-editor.tsx +7 -7
  25. package/src/diffs/__tests__/structured-item-diff.test.ts +8 -8
  26. package/src/diffs/renderer-diff.tsx +3 -3
  27. package/src/diffs/split-diff.ts +2 -2
  28. package/src/diffs/structured-item-diff.tsx +10 -10
  29. package/src/diffs/text-diff.tsx +1 -1
  30. package/src/diffs/widget-diff.tsx +2 -2
  31. package/src/editor-page.tsx +8 -8
  32. package/src/editor.tsx +36 -36
  33. package/src/hint-editor.tsx +27 -27
  34. package/src/i18n.ts +4 -4
  35. package/src/iframe-content-renderer.tsx +10 -10
  36. package/src/item-editor.tsx +4 -4
  37. package/src/multirenderer-editor.tsx +17 -11
  38. package/src/widgets/categorizer-editor.tsx +3 -3
  39. package/src/widgets/cs-program-editor.tsx +2 -2
  40. package/src/widgets/definition-editor.tsx +2 -2
  41. package/src/widgets/dropdown-editor.tsx +8 -8
  42. package/src/widgets/example-graphie-widget-editor.tsx +1 -1
  43. package/src/widgets/example-graphie-widget.tsx +2 -2
  44. package/src/widgets/example-widget-editor.tsx +2 -2
  45. package/src/widgets/example-widget.tsx +3 -3
  46. package/src/widgets/explanation-editor.tsx +3 -3
  47. package/src/widgets/expression-editor.tsx +9 -9
  48. package/src/widgets/graded-group-editor.tsx +6 -6
  49. package/src/widgets/graded-group-set-editor.tsx +3 -3
  50. package/src/widgets/grapher-editor.tsx +2 -2
  51. package/src/widgets/group-editor.tsx +3 -3
  52. package/src/widgets/iframe-editor.tsx +4 -4
  53. package/src/widgets/input-number-editor.tsx +6 -6
  54. package/src/widgets/interaction-editor.tsx +102 -102
  55. package/src/widgets/interactive-graph-editor.tsx +12 -8
  56. package/src/widgets/label-image/marker.tsx +1 -1
  57. package/src/widgets/label-image/question-markers.tsx +1 -1
  58. package/src/widgets/lights-puzzle-editor.tsx +4 -4
  59. package/src/widgets/matrix-editor.tsx +2 -2
  60. package/src/widgets/measurer-editor.tsx +6 -6
  61. package/src/widgets/molecule-editor.tsx +2 -2
  62. package/src/widgets/number-line-editor.tsx +1 -1
  63. package/src/widgets/numeric-input-editor.tsx +2 -2
  64. package/src/widgets/orderer-editor.tsx +2 -2
  65. package/src/widgets/passage-editor.tsx +3 -3
  66. package/src/widgets/passage-ref-editor.tsx +3 -3
  67. package/src/widgets/passage-ref-target-editor.tsx +1 -1
  68. package/src/widgets/plotter-editor.tsx +4 -4
  69. package/src/widgets/radio/editor.tsx +3 -3
  70. package/src/widgets/reaction-diagram-editor.tsx +5 -5
  71. package/src/widgets/sequence-editor.tsx +1 -1
  72. package/src/widgets/simple-markdown-tester-editor.tsx +3 -3
  73. package/src/widgets/simple-markdown-tester.tsx +2 -2
  74. package/src/widgets/simulator-editor.tsx +1 -1
  75. package/src/widgets/sorter-editor.tsx +1 -1
  76. package/src/widgets/table-editor.tsx +1 -1
  77. package/src/widgets/transformer-editor.tsx +10 -10
  78. package/src/widgets/unit-editor.tsx +5 -5
  79. package/tsconfig-build.tsbuildinfo +1 -1
  80. package/dist/all-editors.js.flow +0 -8
  81. package/dist/all-widgets.js.flow +0 -34
  82. package/dist/article-editor.js.flow +0 -72
  83. package/dist/components/blur-input.js.flow +0 -25
  84. package/dist/components/checkbox.js.flow +0 -26
  85. package/dist/components/device-framer.js.flow +0 -20
  86. package/dist/components/drag-target.js.flow +0 -8
  87. package/dist/components/dropdown-option.js.flow +0 -49
  88. package/dist/components/form-wrapped-text-field.js.flow +0 -45
  89. package/dist/components/graph-points-count-selector.js.flow +0 -12
  90. package/dist/components/graph-settings.js.flow +0 -8
  91. package/dist/components/graph-type-selector.js.flow +0 -12
  92. package/dist/components/hover-behavior.js.flow +0 -48
  93. package/dist/components/json-editor.js.flow +0 -8
  94. package/dist/components/link.js.flow +0 -50
  95. package/dist/components/section-control-button.js.flow +0 -25
  96. package/dist/components/segment-count-selector.js.flow +0 -11
  97. package/dist/components/simple-button.js.flow +0 -18
  98. package/dist/components/sortable.js.flow +0 -8
  99. package/dist/components/util.js.flow +0 -9
  100. package/dist/components/viewport-resizer.js.flow +0 -22
  101. package/dist/components/widget-editor.js.flow +0 -91
  102. package/dist/components/widget-select.js.flow +0 -16
  103. package/dist/diffs/article-diff.js.flow +0 -71
  104. package/dist/diffs/item-diff.js.flow +0 -41
  105. package/dist/diffs/renderer-diff.js.flow +0 -25
  106. package/dist/diffs/split-diff.js.flow +0 -8
  107. package/dist/diffs/string-array-diff.js.flow +0 -11
  108. package/dist/diffs/structured-item-diff.js.flow +0 -37
  109. package/dist/diffs/tags-diff.js.flow +0 -24
  110. package/dist/diffs/text-diff.js.flow +0 -21
  111. package/dist/diffs/widget-diff-performer.js.flow +0 -8
  112. package/dist/diffs/widget-diff.js.flow +0 -31
  113. package/dist/editor-page.js.flow +0 -72
  114. package/dist/editor.js.flow +0 -96
  115. package/dist/hint-editor.js.flow +0 -87
  116. package/dist/i18n.js.flow +0 -13
  117. package/dist/iframe-content-renderer.js.flow +0 -28
  118. package/dist/index.js.flow +0 -23
  119. package/dist/item-editor.js.flow +0 -46
  120. package/dist/item-extras-editor.js.flow +0 -23
  121. package/dist/katex-error-view.js.flow +0 -24
  122. package/dist/multirenderer-editor.js.flow +0 -46
  123. package/dist/stateful-article-editor.js.flow +0 -16
  124. package/dist/stateful-editor-page.js.flow +0 -8
  125. package/dist/testing-widgets.js.flow +0 -34
  126. package/dist/util/points.js.flow +0 -9
  127. package/dist/util/register-all-widgets-and-editors-for-testing.js.flow +0 -7
  128. package/dist/widgets/categorizer-editor.js.flow +0 -62
  129. package/dist/widgets/cs-program-editor.js.flow +0 -25
  130. package/dist/widgets/definition-editor.js.flow +0 -23
  131. package/dist/widgets/dropdown-editor.js.flow +0 -37
  132. package/dist/widgets/example-graphie-widget-editor.js.flow +0 -25
  133. package/dist/widgets/example-graphie-widget.js.flow +0 -102
  134. package/dist/widgets/example-widget-editor.js.flow +0 -26
  135. package/dist/widgets/example-widget.js.flow +0 -86
  136. package/dist/widgets/explanation-editor.js.flow +0 -27
  137. package/dist/widgets/expression-editor.js.flow +0 -43
  138. package/dist/widgets/graded-group-editor.js.flow +0 -68
  139. package/dist/widgets/graded-group-set-editor.js.flow +0 -66
  140. package/dist/widgets/grapher-editor.js.flow +0 -21
  141. package/dist/widgets/group-editor.js.flow +0 -64
  142. package/dist/widgets/iframe-editor.js.flow +0 -24
  143. package/dist/widgets/image-editor.js.flow +0 -8
  144. package/dist/widgets/input-number-editor.js.flow +0 -77
  145. package/dist/widgets/interaction/constraint-editor.js.flow +0 -35
  146. package/dist/widgets/interaction-editor.js.flow +0 -36
  147. package/dist/widgets/interactive-graph-editor.js.flow +0 -5803
  148. package/dist/widgets/label-image/answer-choices.js.flow +0 -16
  149. package/dist/widgets/label-image/behavior.js.flow +0 -17
  150. package/dist/widgets/label-image/marker.js.flow +0 -32
  151. package/dist/widgets/label-image/question-markers.js.flow +0 -23
  152. package/dist/widgets/label-image/select-image.js.flow +0 -13
  153. package/dist/widgets/label-image-editor.js.flow +0 -44
  154. package/dist/widgets/lights-puzzle-editor.js.flow +0 -34
  155. package/dist/widgets/matcher-editor.js.flow +0 -28
  156. package/dist/widgets/matrix-editor.js.flow +0 -26
  157. package/dist/widgets/measurer-editor.js.flow +0 -42
  158. package/dist/widgets/molecule-editor.js.flow +0 -23
  159. package/dist/widgets/number-line-editor.js.flow +0 -45
  160. package/dist/widgets/numeric-input-editor.js.flow +0 -8
  161. package/dist/widgets/orderer-editor.js.flow +0 -30
  162. package/dist/widgets/passage-editor.js.flow +0 -24
  163. package/dist/widgets/passage-ref-editor.js.flow +0 -17
  164. package/dist/widgets/passage-ref-target-editor.js.flow +0 -22
  165. package/dist/widgets/plotter-editor.js.flow +0 -75
  166. package/dist/widgets/radio/editor.js.flow +0 -81
  167. package/dist/widgets/reaction-diagram-editor.js.flow +0 -26
  168. package/dist/widgets/sequence-editor.js.flow +0 -73
  169. package/dist/widgets/simple-markdown-tester-editor.js.flow +0 -23
  170. package/dist/widgets/simple-markdown-tester.js.flow +0 -61
  171. package/dist/widgets/simulator-editor.js.flow +0 -26
  172. package/dist/widgets/sorter-editor.js.flow +0 -22
  173. package/dist/widgets/table-editor.js.flow +0 -24
  174. package/dist/widgets/transformer-editor.js.flow +0 -17
  175. package/dist/widgets/unit-editor.js.flow +0 -41
  176. package/dist/widgets/video-editor.js.flow +0 -25
@@ -1,24 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- declare type State = any;
11
- declare class KatexErrorView extends React.Component<Props, State> {
12
- static propTypes: {|
13
- errorList: PropTypes.Validator<
14
- (PropTypes.InferProps<{|
15
- math: PropTypes.Validator<string>,
16
- message: PropTypes.Validator<string>,
17
- |}> | null | void)[]
18
- >,
19
- |};
20
- state: State;
21
- handleToggleKatexErrors: (arg1: SyntheticMouseEvent<>) => void;
22
- render(): React.Node;
23
- }
24
- declare export default typeof KatexErrorView;
@@ -1,46 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as React from "react";
8
- import type {
9
- APIOptions,
10
- ChangeHandler,
11
- EditorMode,
12
- Item,
13
- Shape,
14
- } from "@khanacademy/perseus";
15
- declare type Path = $ReadOnlyArray<any>;
16
- declare interface LayoutStatics {
17
- shape: Shape;
18
- }
19
- declare type MultiRendererEditorProps = {|
20
- Layout: {| ...React.ComponentType<any>, ...LayoutStatics |},
21
- apiOptions: APIOptions,
22
- item: Item,
23
- editorMode: EditorMode,
24
- onChange: ChangeHandler,
25
- |};
26
- declare class MultiRendererEditor
27
- extends React.Component<MultiRendererEditorProps>
28
- {
29
- layout: React.ElementRef<any> | null | void;
30
- _renderLayout: () => React.Element<any>;
31
- _renderJson: () => React.Element<"div">;
32
- _renderPreview: () => React.Element<"div">;
33
- mergeValueAtPath: (path: Path, newValue?: any) => void;
34
- setValueAtPath: (path: Path, newValue?: any) => void;
35
- addArrayElement: (path: Path, shape: Shape) => void;
36
- removeArrayElement: (path: Path) => void;
37
- moveArrayElementDown: (path: Path) => void;
38
- moveArrayElementUp: (path: Path) => void;
39
- _renderEdit: () => React.Element<"div">;
40
- score: () => any | void;
41
- getSerializedState: () => any | void;
42
- restoreSerializedState: (state?: any) => void;
43
- _renderContent: () => React.Element<"div"> | React.Node;
44
- render(): React.Node;
45
- }
46
- declare export default typeof MultiRendererEditor;
@@ -1,16 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- /**
8
- * Renders an ArticleEditor as a non-controlled component.
9
- *
10
- * Normally the parent of ArticleEditor must pass it an onChange callback and
11
- * then respond to any changes by modifying the ArticleEditor props to reflect
12
- * those changes. With StatefulArticleEditor changes are stored in state so you
13
- * can query them with serialize.
14
- */
15
- declare var StatefulArticleEditor: any;
16
- declare export default typeof StatefulArticleEditor;
@@ -1,8 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- declare var StatefulEditorPage: any;
8
- declare export default typeof StatefulEditorPage;
@@ -1,34 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as $Flowgen$Import$react from "react";
8
- import * as $Flowgen$Import$_40_khanacademy_2f_perseus from "@khanacademy/perseus";
9
- import * as $Flowgen$Import$_2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types from "../../perseus/src/types";
10
- declare var _default: $ReadOnlyArray<
11
- $ReadOnly<{|
12
- name: string,
13
- displayName: string,
14
- getWidget?: (() => $Flowgen$Import$react.ComponentType<any>) | void,
15
- accessible?: boolean | ((props: any) => boolean) | void,
16
- hidden?: boolean | void,
17
- version?: $Flowgen$Import$_40_khanacademy_2f_perseus.Version | void,
18
- supportedAlignments?: $ReadOnlyArray<$Flowgen$Import$_40_khanacademy_2f_perseus.Alignment> | void,
19
- defaultAlignment?: $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment | void,
20
- getDefaultAlignment?:
21
- | (() => $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment)
22
- | void,
23
- isLintable?: boolean | void,
24
- tracking?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.Tracking | void,
25
- traverseChildWidgets?: any,
26
- transform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
27
- staticTransform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
28
- propUpgrades?: {
29
- [key: string]: (arg1: any) => any,
30
- } | void,
31
- widget: $Flowgen$Import$react.ComponentType<any>,
32
- |}>
33
- >;
34
- declare export default typeof _default;
@@ -1,9 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- declare export var UNLIMITED: "unlimited";
8
- export type PointValue = number | typeof UNLIMITED;
9
- declare export var parsePointCount: (points: string) => PointValue;
@@ -1,7 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- declare export var registerAllWidgetsAndEditorsForTesting: () => void;
@@ -1,62 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- declare class CategorizerEditor extends React.Component<Props> {
11
- static propTypes: {|
12
- apiOptions: PropTypes.Validator<
13
- $NonMaybeType<
14
- PropTypes.InferProps<{|
15
- isArticle: PropTypes.Validator<boolean>,
16
- onInputError: PropTypes.Validator<(...args: any[]) => any>,
17
- onFocusChange: PropTypes.Validator<(...args: any[]) => any>,
18
- GroupMetadataEditor: PropTypes.Validator<(...args: any[]) => any>,
19
- showAlignmentOptions: PropTypes.Validator<boolean>,
20
- readOnly: PropTypes.Validator<boolean>,
21
- answerableCallback: PropTypes.Requireable<(...args: any[]) => any>,
22
- getAnotherHint: PropTypes.Requireable<(...args: any[]) => any>,
23
- interactionCallback: PropTypes.Requireable<(...args: any[]) => any>,
24
- groupAnnotator: PropTypes.Validator<(...args: any[]) => any>,
25
- imagePlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>,
26
- widgetPlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>,
27
- baseElements: PropTypes.Requireable<
28
- PropTypes.InferProps<{|
29
- Link: PropTypes.Requireable<(...args: any[]) => any>,
30
- |}>
31
- >,
32
- imagePreloader: PropTypes.Requireable<(...args: any[]) => any>,
33
- trackInteraction: PropTypes.Requireable<(...args: any[]) => any>,
34
- customKeypad: PropTypes.Requireable<boolean>,
35
- nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>,
36
- isMobile: PropTypes.Requireable<boolean>,
37
- useV2Keypad: PropTypes.Requireable<boolean>,
38
- setDrawingAreaAvailable: PropTypes.Requireable<
39
- (...args: any[]) => any
40
- >,
41
- useDraftEditor: PropTypes.Requireable<boolean>,
42
- hintProgressColor: PropTypes.Requireable<string>,
43
- canScrollPage: PropTypes.Requireable<boolean>,
44
- inModal: PropTypes.Requireable<boolean>,
45
- crossOutEnabled: PropTypes.Requireable<boolean>,
46
- editorChangeDelay: PropTypes.Requireable<number>,
47
- |}>
48
- >
49
- >,
50
- items: PropTypes.Requireable<(string | null | void)[]>,
51
- categories: PropTypes.Requireable<(string | null | void)[]>,
52
- values: PropTypes.Requireable<(number | null | void)[]>,
53
- randomizeItems: PropTypes.Requireable<boolean>,
54
- onChange: PropTypes.Validator<(...args: any[]) => any>,
55
- |};
56
- static widgetName: "categorizer";
57
- static defaultProps: Props;
58
- change: (arg1: any, arg2: any, arg3: any) => any;
59
- serialize: () => any;
60
- render(): React.Node;
61
- }
62
- declare export default typeof CategorizerEditor;
@@ -1,25 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
-
10
- /**
11
- * This is the main editor for this widget, to specify all the options.
12
- */
13
- declare class CSProgramEditor extends React.Component<any> {
14
- static propTypes: {|
15
- onChange: PropTypes.Validator<(...args: any[]) => any>,
16
- |};
17
- static widgetName: "cs-program";
18
- static defaultProps: any;
19
- change: (...args: $ReadOnlyArray<mixed>) => any;
20
- _handleSettingsChange: (arg1: any) => void;
21
- _handleProgramIDChange: (arg1: string) => void;
22
- serialize: () => any;
23
- render(): React.Node;
24
- }
25
- declare export default typeof CSProgramEditor;
@@ -1,23 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- declare class DefinitionEditor extends React.Component<Props> {
11
- static propTypes: {|
12
- togglePrompt: PropTypes.Requireable<string>,
13
- definition: PropTypes.Requireable<string>,
14
- apiOptions: PropTypes.Requireable<any>,
15
- onChange: PropTypes.Validator<(...args: any[]) => any>,
16
- |};
17
- static widgetName: "definition";
18
- static defaultProps: Props;
19
- change: (arg1: any, arg2: any, arg3: any) => any;
20
- serialize: () => any;
21
- render(): React.Node;
22
- }
23
- declare export default typeof DefinitionEditor;
@@ -1,37 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- declare class DropdownEditor extends React.Component<Props> {
11
- static propTypes: {|
12
- choices: PropTypes.Requireable<
13
- (PropTypes.InferProps<{|
14
- content: PropTypes.Requireable<string>,
15
- correct: PropTypes.Requireable<boolean>,
16
- |}> | null | void)[]
17
- >,
18
- placeholder: PropTypes.Requireable<string>,
19
- |};
20
- static widgetName: "dropdown";
21
- static defaultProps: Props;
22
- onPlaceholderChange: (arg1: SyntheticInputEvent<HTMLInputElement>) => void;
23
- onCorrectChange: (
24
- arg1: number,
25
- arg2: SyntheticInputEvent<HTMLInputElement>
26
- ) => void;
27
- onContentChange: (
28
- arg1: number,
29
- arg2: SyntheticInputEvent<HTMLInputElement>
30
- ) => void;
31
- addChoice: (arg1: SyntheticMouseEvent<>) => void;
32
- removeChoice: (arg1: number, arg2: SyntheticMouseEvent<>) => void;
33
- focus: (arg1: number) => boolean;
34
- serialize: () => any;
35
- render(): React.Node;
36
- }
37
- declare export default typeof DropdownEditor;
@@ -1,25 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as $Flowgen$Import$prop_2d_types from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- /**
11
- * This is the widget's editor. This is what shows up on the left side
12
- * of the screen in the demo page. Only the question writer sees this.
13
- */
14
- declare class ExampleGraphieWidgetEditor extends React.Component<Props> {
15
- static propTypes: {|
16
- onChange: $Flowgen$Import$prop_2d_types.Validator<(...args: any[]) => any>,
17
- |};
18
- static widgetName: "example-graphie-widget";
19
- static defaultProps: Props;
20
- change: (arg1: any, arg2: any, arg3: any) => any;
21
- handleChange: (arg1: any) => void;
22
- serialize: () => any;
23
- render(): React.Node;
24
- }
25
- declare export default typeof ExampleGraphieWidgetEditor;
@@ -1,102 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as $Flowgen$Import$_40_khanacademy_2f_perseus from "@khanacademy/perseus";
8
- import * as $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types from "../../../perseus/src/types";
9
- import PropTypes from "prop-types";
10
- import * as React from "react";
11
- import type { Coord } from "@khanacademy/perseus";
12
- declare type Props = any;
13
- /**
14
- * This is the widget's renderer. It shows up in the right column
15
- * in the demo, and is what is visible to users, and where
16
- * users enter their answers.
17
- */
18
- declare class ExampleGraphieWidget extends React.Component<Props> {
19
- static propTypes: {|
20
- apiOptions: PropTypes.Validator<
21
- $NonMaybeType<
22
- PropTypes.InferProps<{|
23
- isArticle: PropTypes.Validator<boolean>,
24
- onInputError: PropTypes.Validator<(...args: any[]) => any>,
25
- onFocusChange: PropTypes.Validator<(...args: any[]) => any>,
26
- GroupMetadataEditor: PropTypes.Validator<(...args: any[]) => any>,
27
- showAlignmentOptions: PropTypes.Validator<boolean>,
28
- readOnly: PropTypes.Validator<boolean>,
29
- answerableCallback: PropTypes.Requireable<(...args: any[]) => any>,
30
- getAnotherHint: PropTypes.Requireable<(...args: any[]) => any>,
31
- interactionCallback: PropTypes.Requireable<(...args: any[]) => any>,
32
- groupAnnotator: PropTypes.Validator<(...args: any[]) => any>,
33
- imagePlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>,
34
- widgetPlaceholder: PropTypes.Requireable<PropTypes.ReactNodeLike>,
35
- baseElements: PropTypes.Requireable<
36
- PropTypes.InferProps<{|
37
- Link: PropTypes.Requireable<(...args: any[]) => any>,
38
- |}>
39
- >,
40
- imagePreloader: PropTypes.Requireable<(...args: any[]) => any>,
41
- trackInteraction: PropTypes.Requireable<(...args: any[]) => any>,
42
- customKeypad: PropTypes.Requireable<boolean>,
43
- nativeKeypadProxy: PropTypes.Requireable<(...args: any[]) => any>,
44
- isMobile: PropTypes.Requireable<boolean>,
45
- useV2Keypad: PropTypes.Requireable<boolean>,
46
- setDrawingAreaAvailable: PropTypes.Requireable<
47
- (...args: any[]) => any
48
- >,
49
- useDraftEditor: PropTypes.Requireable<boolean>,
50
- hintProgressColor: PropTypes.Requireable<string>,
51
- canScrollPage: PropTypes.Requireable<boolean>,
52
- inModal: PropTypes.Requireable<boolean>,
53
- crossOutEnabled: PropTypes.Requireable<boolean>,
54
- editorChangeDelay: PropTypes.Requireable<number>,
55
- |}>
56
- >
57
- >,
58
- graph: PropTypes.Validator<{ ... }>,
59
- coord: PropTypes.Requireable<(number | null | void)[]>,
60
- onChange: PropTypes.Validator<(...args: any[]) => any>,
61
- |};
62
- static defaultProps: Props;
63
-
64
- /**
65
- * This is the widget's grading function
66
- */
67
- static validate(state: any, rubric: any): any;
68
- getUserInput: () => any;
69
- render(): React.Node;
70
- change: (arg1: any, arg2: any, arg3: any) => any;
71
- movePoint: (arg1: Coord) => void;
72
- _getGridConfig: (arg1: any) => any;
73
- setupGraphie: (arg1: any, arg2: any) => any;
74
- simpleValidate: (arg1: any) => any;
75
- }
76
- /**
77
- * For this widget to work, we must export it.
78
- * We also must import this file in src/all-widgets.js
79
- */
80
- declare var _default: $ReadOnly<{|
81
- name: string,
82
- displayName: string,
83
- getWidget?: (() => typeof ExampleGraphieWidget) | void,
84
- accessible?: boolean | ((props: any) => boolean) | void,
85
- hidden?: boolean | void,
86
- version?: $Flowgen$Import$_40_khanacademy_2f_perseus.Version | void,
87
- supportedAlignments?: $ReadOnlyArray<$Flowgen$Import$_40_khanacademy_2f_perseus.Alignment> | void,
88
- defaultAlignment?: $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment | void,
89
- getDefaultAlignment?:
90
- | (() => $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment)
91
- | void,
92
- isLintable?: boolean | void,
93
- tracking?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.Tracking | void,
94
- traverseChildWidgets?: any,
95
- transform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
96
- staticTransform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
97
- propUpgrades?: {
98
- [key: string]: (arg1: any) => any,
99
- } | void,
100
- widget: typeof ExampleGraphieWidget,
101
- |}>;
102
- declare export default typeof _default;
@@ -1,26 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as $Flowgen$Import$prop_2d_types from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- /**
11
- * This is the widget's editor. This is what shows up on the left side
12
- * of the screen in the demo. Only the question writer sees this.
13
- */
14
- declare class ExampleWidgetEditor extends React.Component<Props> {
15
- static propTypes: {|
16
- onChange: $Flowgen$Import$prop_2d_types.Validator<(...args: any[]) => any>,
17
- |};
18
- static widgetName: "example-widget";
19
- static defaultProps: Props;
20
- handleAnswerChange: (arg1: SyntheticInputEvent<HTMLInputElement>) => void;
21
- render(): React.Node;
22
- change: (arg1: any, arg2: any, arg3: any) => any;
23
- focus: () => boolean;
24
- serialize: () => any;
25
- }
26
- declare export default typeof ExampleWidgetEditor;
@@ -1,86 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import * as $Flowgen$Import$_40_khanacademy_2f_perseus from "@khanacademy/perseus";
8
- import * as $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types from "../../../perseus/src/types";
9
- import PropTypes from "prop-types";
10
- import * as React from "react";
11
-
12
- /**
13
- * This is the widget's renderer. It shows up in the right column
14
- * in the demo, and is what is visible to users, and where
15
- * users enter their answers.
16
- */
17
- declare class ExampleWidget extends React.Component<any> {
18
- static propTypes: {|
19
- value: PropTypes.Requireable<string>,
20
- onChange: PropTypes.Validator<(...args: any[]) => any>,
21
- |};
22
- static defaultProps: any;
23
-
24
- /**
25
- * This is the widget's grading function. simpleValidate generally
26
- * defers to this function.
27
- *
28
- * value is usually the result of getUserInput on the widget
29
- * rubric is the result of calling serialize() on the editor
30
- */
31
- static validate(value: string, rubric: any): any;
32
-
33
- /**
34
- * Tell our parent to update our props.
35
- */
36
- change: (arg1: any, arg2: any, arg3: any) => any;
37
- render(): React.Node;
38
- getUserInput: () => string;
39
-
40
- /**
41
- * Widgets that are focusable should add a focus method that returns
42
- * true if focusing succeeded. The first such widget found will be
43
- * focused on page load.
44
- */
45
- focus: () => boolean;
46
-
47
- /**
48
- * simpleValidate is called for grading. Rubric is the result of calling
49
- * getUserInput() on the editor that created this widget.
50
- *
51
- * Should return an object representing the grading result, such as
52
- * {
53
- * type: "points",
54
- * earned: 1,
55
- * total: 1,
56
- * message: null
57
- * }
58
- */
59
- simpleValidate: (arg1: any) => any;
60
- }
61
- /**
62
- * For this widget to work, we must import this file in src/all-widgets.js
63
- */
64
- declare var _default: $ReadOnly<{|
65
- name: string,
66
- displayName: string,
67
- getWidget?: (() => typeof ExampleWidget) | void,
68
- accessible?: boolean | ((props: any) => boolean) | void,
69
- hidden?: boolean | void,
70
- version?: $Flowgen$Import$_40_khanacademy_2f_perseus.Version | void,
71
- supportedAlignments?: $ReadOnlyArray<$Flowgen$Import$_40_khanacademy_2f_perseus.Alignment> | void,
72
- defaultAlignment?: $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment | void,
73
- getDefaultAlignment?:
74
- | (() => $Flowgen$Import$_40_khanacademy_2f_perseus.Alignment)
75
- | void,
76
- isLintable?: boolean | void,
77
- tracking?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.Tracking | void,
78
- traverseChildWidgets?: any,
79
- transform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
80
- staticTransform?: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_perseus_2f_src_2f_types.WidgetTransform | void,
81
- propUpgrades?: {
82
- [key: string]: (arg1: any) => any,
83
- } | void,
84
- widget: typeof ExampleWidget,
85
- |}>;
86
- declare export default typeof _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare type Props = any;
10
- declare type State = any;
11
- declare class ExplanationEditor extends React.Component<Props, State> {
12
- static propTypes: {|
13
- showPrompt: PropTypes.Requireable<string>,
14
- hidePrompt: PropTypes.Requireable<string>,
15
- explanation: PropTypes.Requireable<string>,
16
- widgets: PropTypes.Requireable<{ ... }>,
17
- apiOptions: PropTypes.Requireable<any>,
18
- onChange: PropTypes.Validator<(...args: any[]) => any>,
19
- |};
20
- static widgetName: "explanation";
21
- static defaultProps: Props;
22
- state: State;
23
- change: (arg1: any, arg2: any, arg3: any) => any;
24
- serialize: () => any;
25
- render(): React.Node;
26
- }
27
- declare export default typeof ExplanationEditor;
@@ -1,43 +0,0 @@
1
- /**
2
- * Flowtype definitions for data
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import PropTypes from "prop-types";
8
- import * as React from "react";
9
- declare class ExpressionEditor extends React.Component<any, any> {
10
- static propTypes: {|
11
- answerForms: PropTypes.Requireable<
12
- (PropTypes.InferProps<{|
13
- considered: PropTypes.Validator<
14
- $NonMaybeType<"correct" | "wrong" | "ungraded">
15
- >,
16
- value: PropTypes.Validator<string>,
17
- form: PropTypes.Validator<boolean>,
18
- simplify: PropTypes.Validator<boolean>,
19
- |}> | null | void)[]
20
- >,
21
- times: PropTypes.Requireable<boolean>,
22
- buttonSets: any,
23
- functions: PropTypes.Requireable<(string | null | void)[]>,
24
- onChange: PropTypes.Validator<(...args: any[]) => any>,
25
- |};
26
- static widgetName: "expression";
27
- static defaultProps: any;
28
- constructor(props: any): this;
29
- change: (arg1: any, arg2: any, arg3: any) => any;
30
- render(): React.Node;
31
- serialize: () => any;
32
- getSaveWarnings: () => any;
33
- _newEmptyAnswerForm: () => any;
34
- newAnswer: () => void;
35
- handleRemoveForm: (arg1: number) => void;
36
- updateForm: (arg1: number, arg2: any) => void;
37
- handleReorder: (arg1: any) => void;
38
- handleButtonSet: (arg1: string) => void;
39
- handleToggleDiv: () => void;
40
- handleTexInsert: (arg1: string) => void;
41
- handleFunctions: (arg1: SyntheticInputEvent<HTMLInputElement>) => void;
42
- }
43
- declare export default typeof ExpressionEditor;