@khanacademy/perseus-editor 1.1.0 → 2.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 (312) hide show
  1. package/.babelrc.js +1 -1
  2. package/.eslintrc.js +1 -0
  3. package/CHANGELOG.md +21 -0
  4. package/dist/all-editors.d.ts +2 -0
  5. package/dist/all-editors.js.flow +8 -0
  6. package/dist/all-widgets.d.ts +22 -0
  7. package/dist/all-widgets.js.flow +34 -0
  8. package/dist/article-editor.d.ts +59 -0
  9. package/dist/article-editor.js.flow +72 -0
  10. package/dist/components/blur-input.d.ts +19 -0
  11. package/dist/components/blur-input.js.flow +25 -0
  12. package/dist/components/checkbox.d.ts +20 -0
  13. package/dist/components/checkbox.js.flow +26 -0
  14. package/dist/components/device-framer.d.ts +15 -0
  15. package/dist/components/device-framer.js.flow +20 -0
  16. package/dist/components/drag-target.d.ts +2 -0
  17. package/dist/components/drag-target.js.flow +8 -0
  18. package/dist/components/dropdown-option.d.ts +35 -0
  19. package/dist/components/dropdown-option.js.flow +49 -0
  20. package/dist/components/form-wrapped-text-field.d.ts +48 -0
  21. package/dist/components/form-wrapped-text-field.js.flow +48 -0
  22. package/dist/components/graph-settings.d.ts +2 -0
  23. package/dist/components/graph-settings.js.flow +8 -0
  24. package/dist/components/hover-behavior.d.ts +85 -0
  25. package/dist/components/hover-behavior.js.flow +48 -0
  26. package/dist/components/json-editor.d.ts +2 -0
  27. package/dist/components/json-editor.js.flow +8 -0
  28. package/dist/components/link.d.ts +41 -0
  29. package/dist/components/link.js.flow +50 -0
  30. package/dist/components/simple-button.d.ts +16 -0
  31. package/dist/components/simple-button.js.flow +18 -0
  32. package/dist/components/sortable.d.ts +2 -0
  33. package/dist/components/sortable.js.flow +8 -0
  34. package/dist/components/util.d.ts +1 -0
  35. package/dist/components/util.js.flow +9 -0
  36. package/dist/components/viewport-resizer.d.ts +16 -0
  37. package/dist/components/viewport-resizer.js.flow +22 -0
  38. package/dist/diffs/__stories__/perseus-diff-wrapper.d.ts +5 -0
  39. package/dist/diffs/__stories__/perseus-diff-wrapper.js.flow +11 -0
  40. package/dist/diffs/article-diff.d.ts +50 -0
  41. package/dist/diffs/article-diff.js.flow +71 -0
  42. package/dist/diffs/item-diff.d.ts +23 -0
  43. package/dist/diffs/item-diff.js.flow +41 -0
  44. package/dist/diffs/renderer-diff.d.ts +22 -0
  45. package/dist/diffs/renderer-diff.js.flow +25 -0
  46. package/dist/diffs/split-diff.d.ts +2 -0
  47. package/dist/diffs/split-diff.js.flow +8 -0
  48. package/dist/diffs/string-array-diff.d.ts +2 -0
  49. package/dist/diffs/string-array-diff.js.flow +11 -0
  50. package/dist/diffs/structured-item-diff.d.ts +25 -0
  51. package/dist/diffs/structured-item-diff.js.flow +37 -0
  52. package/dist/diffs/tags-diff.d.ts +21 -0
  53. package/dist/diffs/tags-diff.js.flow +24 -0
  54. package/dist/diffs/text-diff.d.ts +15 -0
  55. package/dist/diffs/text-diff.js.flow +21 -0
  56. package/dist/diffs/widget-diff-performer.d.ts +2 -0
  57. package/dist/diffs/widget-diff-performer.js.flow +8 -0
  58. package/dist/diffs/widget-diff.d.ts +21 -0
  59. package/dist/diffs/widget-diff.js.flow +31 -0
  60. package/dist/editor-page.d.ts +57 -0
  61. package/dist/editor-page.js.flow +73 -0
  62. package/dist/editor.d.ts +82 -0
  63. package/dist/editor.js.flow +98 -0
  64. package/dist/es/index.js +1428 -2587
  65. package/dist/es/index.js.map +1 -1
  66. package/dist/hint-editor.d.ts +64 -0
  67. package/dist/hint-editor.js.flow +87 -0
  68. package/dist/i18n.d.ts +7 -0
  69. package/dist/i18n.js.flow +13 -0
  70. package/dist/iframe-content-renderer.d.ts +22 -0
  71. package/dist/iframe-content-renderer.js.flow +28 -0
  72. package/dist/index.d.ts +17 -2
  73. package/dist/index.js +1492 -2548
  74. package/dist/index.js.flow +23 -2
  75. package/dist/index.js.map +1 -1
  76. package/dist/item-editor.d.ts +36 -0
  77. package/dist/item-editor.js.flow +46 -0
  78. package/dist/item-extras-editor.d.ts +17 -0
  79. package/dist/item-extras-editor.js.flow +23 -0
  80. package/dist/katex-error-view.d.ts +16 -0
  81. package/dist/katex-error-view.js.flow +24 -0
  82. package/dist/multirenderer-editor.d.ts +32 -0
  83. package/dist/multirenderer-editor.js.flow +46 -0
  84. package/dist/section-control-button.d.ts +12 -0
  85. package/dist/section-control-button.js.flow +20 -0
  86. package/dist/stateful-article-editor.d.ts +10 -0
  87. package/dist/stateful-article-editor.js.flow +16 -0
  88. package/dist/stateful-editor-page.d.ts +2 -0
  89. package/dist/stateful-editor-page.js.flow +8 -0
  90. package/dist/testing-widgets.d.ts +22 -0
  91. package/dist/testing-widgets.js.flow +34 -0
  92. package/dist/util/register-all-widgets-and-editors-for-testing.d.ts +1 -0
  93. package/dist/util/register-all-widgets-and-editors-for-testing.js.flow +7 -0
  94. package/dist/widgets/categorizer-editor.d.ts +47 -0
  95. package/dist/widgets/categorizer-editor.js.flow +61 -0
  96. package/dist/widgets/cs-program-editor.d.ts +21 -0
  97. package/dist/widgets/cs-program-editor.js.flow +25 -0
  98. package/dist/widgets/definition-editor.d.ts +17 -0
  99. package/dist/widgets/definition-editor.js.flow +23 -0
  100. package/dist/widgets/dropdown-editor.d.ts +23 -0
  101. package/dist/widgets/dropdown-editor.js.flow +37 -0
  102. package/dist/widgets/example-graphie-widget-editor.d.ts +18 -0
  103. package/dist/widgets/example-graphie-widget-editor.js.flow +25 -0
  104. package/dist/widgets/example-graphie-widget.d.ts +87 -0
  105. package/dist/widgets/example-graphie-widget.js.flow +101 -0
  106. package/dist/widgets/example-widget-editor.d.ts +19 -0
  107. package/dist/widgets/example-widget-editor.js.flow +26 -0
  108. package/dist/widgets/example-widget.d.ts +71 -0
  109. package/dist/widgets/example-widget.js.flow +86 -0
  110. package/dist/widgets/explanation-editor.d.ts +21 -0
  111. package/dist/widgets/explanation-editor.js.flow +27 -0
  112. package/dist/widgets/expression-editor.d.ts +33 -0
  113. package/dist/widgets/expression-editor.js.flow +41 -0
  114. package/dist/widgets/graded-group-editor.d.ts +53 -0
  115. package/dist/widgets/graded-group-editor.js.flow +67 -0
  116. package/dist/widgets/graded-group-set-editor.d.ts +51 -0
  117. package/dist/widgets/graded-group-set-editor.js.flow +65 -0
  118. package/dist/widgets/grapher-editor.d.ts +14 -0
  119. package/dist/widgets/grapher-editor.js.flow +21 -0
  120. package/dist/widgets/group-editor.d.ts +49 -0
  121. package/dist/widgets/group-editor.js.flow +63 -0
  122. package/dist/widgets/iframe-editor.d.ts +18 -0
  123. package/dist/widgets/iframe-editor.js.flow +24 -0
  124. package/dist/widgets/image-editor.d.ts +2 -0
  125. package/dist/widgets/image-editor.js.flow +8 -0
  126. package/dist/widgets/input-number-editor.d.ts +47 -0
  127. package/dist/widgets/input-number-editor.js.flow +77 -0
  128. package/dist/widgets/interaction/constraint-editor.d.ts +26 -0
  129. package/dist/widgets/interaction/constraint-editor.js.flow +35 -0
  130. package/dist/widgets/interaction-editor.d.ts +28 -0
  131. package/dist/widgets/interaction-editor.js.flow +36 -0
  132. package/dist/widgets/interactive-graph-editor.d.ts +2 -0
  133. package/dist/widgets/interactive-graph-editor.js.flow +8 -0
  134. package/dist/widgets/label-image/answer-choices.d.ts +13 -0
  135. package/dist/widgets/label-image/answer-choices.js.flow +16 -0
  136. package/dist/widgets/label-image/behavior.d.ts +14 -0
  137. package/dist/widgets/label-image/behavior.js.flow +17 -0
  138. package/dist/widgets/label-image/marker.d.ts +30 -0
  139. package/dist/widgets/label-image/marker.js.flow +34 -0
  140. package/dist/widgets/label-image/question-markers.d.ts +22 -0
  141. package/dist/widgets/label-image/question-markers.js.flow +25 -0
  142. package/dist/widgets/label-image/select-image.d.ts +10 -0
  143. package/dist/widgets/label-image/select-image.js.flow +13 -0
  144. package/dist/widgets/label-image-editor.d.ts +45 -0
  145. package/dist/widgets/label-image-editor.js.flow +44 -0
  146. package/dist/widgets/lights-puzzle-editor.d.ts +24 -0
  147. package/dist/widgets/lights-puzzle-editor.js.flow +34 -0
  148. package/dist/widgets/matcher-editor.d.ts +19 -0
  149. package/dist/widgets/matcher-editor.js.flow +28 -0
  150. package/dist/widgets/matrix-editor.d.ts +20 -0
  151. package/dist/widgets/matrix-editor.js.flow +26 -0
  152. package/dist/widgets/measurer-editor.d.ts +32 -0
  153. package/dist/widgets/measurer-editor.js.flow +42 -0
  154. package/dist/widgets/molecule-editor.d.ts +17 -0
  155. package/dist/widgets/molecule-editor.js.flow +23 -0
  156. package/dist/widgets/number-line-editor.d.ts +36 -0
  157. package/dist/widgets/number-line-editor.js.flow +45 -0
  158. package/dist/widgets/numeric-input-editor.d.ts +2 -0
  159. package/dist/widgets/numeric-input-editor.js.flow +8 -0
  160. package/dist/widgets/orderer-editor.d.ts +20 -0
  161. package/dist/widgets/orderer-editor.js.flow +30 -0
  162. package/dist/widgets/passage-editor.d.ts +18 -0
  163. package/dist/widgets/passage-editor.js.flow +24 -0
  164. package/dist/widgets/passage-ref-editor.d.ts +11 -0
  165. package/dist/widgets/passage-ref-editor.js.flow +17 -0
  166. package/dist/widgets/passage-ref-target-editor.d.ts +16 -0
  167. package/dist/widgets/passage-ref-target-editor.js.flow +22 -0
  168. package/dist/widgets/plotter-editor.d.ts +45 -0
  169. package/dist/widgets/plotter-editor.js.flow +53 -0
  170. package/dist/widgets/radio/editor.d.ts +64 -0
  171. package/dist/widgets/radio/editor.js.flow +80 -0
  172. package/dist/widgets/reaction-diagram-editor.d.ts +20 -0
  173. package/dist/widgets/reaction-diagram-editor.js.flow +26 -0
  174. package/dist/widgets/sequence-editor.d.ts +56 -0
  175. package/dist/widgets/sequence-editor.js.flow +72 -0
  176. package/dist/widgets/simple-markdown-tester-editor.d.ts +14 -0
  177. package/dist/widgets/simple-markdown-tester-editor.js.flow +23 -0
  178. package/dist/widgets/simple-markdown-tester.d.ts +52 -0
  179. package/dist/widgets/simple-markdown-tester.js.flow +61 -0
  180. package/dist/widgets/simulator-editor.d.ts +20 -0
  181. package/dist/widgets/simulator-editor.js.flow +26 -0
  182. package/dist/widgets/sorter-editor.d.ts +16 -0
  183. package/dist/widgets/sorter-editor.js.flow +22 -0
  184. package/dist/widgets/table-editor.d.ts +18 -0
  185. package/dist/widgets/table-editor.js.flow +24 -0
  186. package/dist/widgets/transformer-editor.d.ts +11 -0
  187. package/dist/widgets/transformer-editor.js.flow +17 -0
  188. package/dist/widgets/unit-editor.d.ts +33 -0
  189. package/dist/widgets/unit-editor.js.flow +41 -0
  190. package/dist/widgets/video-editor.d.ts +19 -0
  191. package/dist/widgets/video-editor.js.flow +25 -0
  192. package/package.json +6 -5
  193. package/src/__stories__/{editor.stories.js → editor.stories.tsx} +4 -5
  194. package/src/__stories__/{section-control-button.stories.jsx → section-control-button.stories.tsx} +10 -11
  195. package/src/__testdata__/{input-number_testdata.js → input-number.testdata.ts} +2 -3
  196. package/src/__tests__/{editor_test.jsx → editor.test.tsx} +4 -7
  197. package/src/__tests__/{i18n_test.jsx → i18n.test.ts} +5 -5
  198. package/src/__tests__/{traversal_test.jsx → traversal.test.ts} +9 -10
  199. package/src/{all-editors_test.js → all-editors.test.ts} +1 -2
  200. package/src/all-editors.ts +83 -0
  201. package/src/all-widgets.ts +7 -0
  202. package/src/{article-editor.jsx → article-editor.tsx} +52 -42
  203. package/src/components/__stories__/{blur-input.stories.jsx → blur-input.stories.tsx} +2 -4
  204. package/src/components/{blur-input.jsx → blur-input.tsx} +12 -13
  205. package/src/components/{checkbox.jsx → checkbox.tsx} +18 -19
  206. package/src/components/{device-framer.jsx → device-framer.tsx} +4 -5
  207. package/src/components/{drag-target.jsx → drag-target.tsx} +0 -1
  208. package/src/components/{dropdown-option.jsx → dropdown-option.tsx} +40 -40
  209. package/src/components/{form-wrapped-text-field.jsx → form-wrapped-text-field.tsx} +47 -53
  210. package/src/components/{graph-settings.jsx → graph-settings.tsx} +4 -8
  211. package/src/components/{hover-behavior.jsx → hover-behavior.ts} +32 -33
  212. package/src/components/{json-editor.jsx → json-editor.tsx} +4 -3
  213. package/src/components/{link.jsx → link.ts} +33 -33
  214. package/src/components/{simple-button.jsx → simple-button.tsx} +3 -4
  215. package/src/components/{sortable.jsx → sortable.tsx} +3 -3
  216. package/src/components/{util.js → util.ts} +1 -2
  217. package/src/components/{viewport-resizer.jsx → viewport-resizer.tsx} +5 -6
  218. package/src/diffs/__stories__/{perseus-diff-wrapper.jsx → perseus-diff-wrapper.tsx} +3 -2
  219. package/src/diffs/__stories__/{structured-item-diff.stories.jsx → structured-item-diff.stories.tsx} +27 -22
  220. package/src/diffs/__stories__/{tags-diff.stories.jsx → tags-diff.stories.tsx} +12 -14
  221. package/src/diffs/__stories__/{text-diff.stories.jsx → text-diff.stories.tsx} +12 -14
  222. package/src/diffs/__tests__/{split-diff_test.js → split-diff.test.ts} +1 -2
  223. package/src/diffs/__tests__/{string-array-diff_test.js → string-array-diff.test.ts} +1 -2
  224. package/src/diffs/__tests__/{structured-item-diff_test.js → structured-item-diff.test.ts} +15 -14
  225. package/src/diffs/__tests__/{widget-diff-performer_test.js → widget-diff-performer.test.ts} +1 -2
  226. package/src/diffs/{article-diff.jsx → article-diff.tsx} +5 -6
  227. package/src/diffs/{item-diff.jsx → item-diff.tsx} +4 -5
  228. package/src/diffs/{renderer-diff.jsx → renderer-diff.tsx} +22 -28
  229. package/src/diffs/{split-diff.jsx → split-diff.ts} +4 -3
  230. package/src/diffs/{string-array-diff.jsx → string-array-diff.ts} +8 -9
  231. package/src/diffs/{structured-item-diff.jsx → structured-item-diff.tsx} +32 -27
  232. package/src/diffs/{tags-diff.jsx → tags-diff.tsx} +15 -16
  233. package/src/diffs/{text-diff.jsx → text-diff.tsx} +13 -13
  234. package/src/diffs/{widget-diff-performer.jsx → widget-diff-performer.ts} +3 -8
  235. package/src/diffs/{widget-diff.jsx → widget-diff.tsx} +15 -14
  236. package/src/{editor-page.jsx → editor-page.tsx} +52 -60
  237. package/src/{editor.jsx → editor.tsx} +315 -277
  238. package/src/{hint-editor.jsx → hint-editor.tsx} +105 -79
  239. package/src/{i18n.jsx → i18n.ts} +9 -6
  240. package/src/{iframe-content-renderer.jsx → iframe-content-renderer.tsx} +23 -17
  241. package/src/{index.js → index.ts} +15 -16
  242. package/src/{item-editor.jsx → item-editor.tsx} +35 -30
  243. package/src/{item-extras-editor.jsx → item-extras-editor.tsx} +3 -4
  244. package/src/{katex-error-view.jsx → katex-error-view.tsx} +4 -5
  245. package/src/{multirenderer-editor.jsx → multirenderer-editor.tsx} +132 -127
  246. package/src/{section-control-button.jsx → section-control-button.tsx} +10 -9
  247. package/src/{stateful-article-editor.jsx → stateful-article-editor.tsx} +2 -5
  248. package/src/{stateful-editor-page.jsx → stateful-editor-page.tsx} +1 -3
  249. package/src/{testing-widgets.js → testing-widgets.ts} +5 -6
  250. package/src/util/{register-all-widgets-and-editors-for-testing_test.js → register-all-widgets-and-editors-for-testing.test.ts} +1 -2
  251. package/src/util/{register-all-widgets-and-editors-for-testing.js → register-all-widgets-and-editors-for-testing.ts} +2 -3
  252. package/src/widgets/__stories__/{label-image-editor.stories.jsx → label-image-editor.stories.tsx} +22 -18
  253. package/src/widgets/__stories__/{radio-editor.stories.jsx → radio-editor.stories.tsx} +15 -10
  254. package/src/widgets/{categorizer-editor.jsx → categorizer-editor.tsx} +8 -6
  255. package/src/widgets/{cs-program-editor.jsx → cs-program-editor.tsx} +17 -17
  256. package/src/widgets/{definition-editor.jsx → definition-editor.tsx} +9 -8
  257. package/src/widgets/{dropdown-editor.jsx → dropdown-editor.tsx} +27 -19
  258. package/src/widgets/{example-graphie-widget-editor.jsx → example-graphie-widget-editor.tsx} +8 -8
  259. package/src/widgets/{example-graphie-widget.jsx → example-graphie-widget.tsx} +14 -17
  260. package/src/widgets/{example-widget-editor.jsx → example-widget-editor.tsx} +10 -7
  261. package/src/widgets/{example-widget.jsx → example-widget.tsx} +14 -12
  262. package/src/widgets/{explanation-editor.jsx → explanation-editor.tsx} +12 -10
  263. package/src/widgets/{expression-editor.jsx → expression-editor.tsx} +36 -26
  264. package/src/widgets/{graded-group-editor.jsx → graded-group-editor.tsx} +18 -10
  265. package/src/widgets/{graded-group-set-editor.jsx → graded-group-set-editor.tsx} +15 -12
  266. package/src/widgets/{grapher-editor.jsx → grapher-editor.tsx} +10 -9
  267. package/src/widgets/{group-editor.jsx → group-editor.tsx} +11 -9
  268. package/src/widgets/{iframe-editor.jsx → iframe-editor.tsx} +16 -13
  269. package/src/widgets/{image-editor.jsx → image-editor.tsx} +4 -7
  270. package/src/widgets/{input-number-editor.jsx → input-number-editor.tsx} +61 -47
  271. package/src/widgets/interaction/{constraint-editor.jsx → constraint-editor.tsx} +21 -24
  272. package/src/widgets/{interaction-editor.jsx → interaction-editor.tsx} +160 -61
  273. package/src/widgets/{interactive-graph-editor.jsx → interactive-graph-editor.tsx} +13 -10
  274. package/src/widgets/label-image/__stories__/{answer-choices.stories.jsx → answer-choices.stories.tsx} +22 -17
  275. package/src/widgets/label-image/__stories__/{behavior.stories.jsx → behavior.stories.tsx} +9 -10
  276. package/src/widgets/label-image/__stories__/{marker.stories.jsx → marker.stories.tsx} +11 -12
  277. package/src/widgets/label-image/__stories__/{question-markers.stories.jsx → question-markers.stories.tsx} +17 -16
  278. package/src/widgets/label-image/__stories__/{select-image.stories.jsx → select-image.stories.tsx} +12 -13
  279. package/src/widgets/label-image/{answer-choices.jsx → answer-choices.tsx} +18 -18
  280. package/src/widgets/label-image/{behavior.jsx → behavior.tsx} +9 -11
  281. package/src/widgets/label-image/{marker.jsx → marker.tsx} +17 -19
  282. package/src/widgets/label-image/{question-markers.jsx → question-markers.tsx} +16 -21
  283. package/src/widgets/label-image/{select-image.jsx → select-image.tsx} +5 -7
  284. package/src/widgets/{label-image-editor.jsx → label-image-editor.tsx} +38 -44
  285. package/src/widgets/{lights-puzzle-editor.jsx → lights-puzzle-editor.tsx} +34 -24
  286. package/src/widgets/{matcher-editor.jsx → matcher-editor.tsx} +9 -7
  287. package/src/widgets/{matrix-editor.jsx → matrix-editor.tsx} +10 -9
  288. package/src/widgets/{measurer-editor.jsx → measurer-editor.tsx} +21 -14
  289. package/src/widgets/{molecule-editor.jsx → molecule-editor.tsx} +9 -8
  290. package/src/widgets/{number-line-editor.jsx → number-line-editor.tsx} +19 -17
  291. package/src/widgets/{numeric-input-editor.jsx → numeric-input-editor.tsx} +10 -10
  292. package/src/widgets/{orderer-editor.jsx → orderer-editor.tsx} +17 -12
  293. package/src/widgets/{passage-editor.jsx → passage-editor.tsx} +9 -7
  294. package/src/widgets/{passage-ref-editor.jsx → passage-ref-editor.tsx} +8 -6
  295. package/src/widgets/{passage-ref-target-editor.jsx → passage-ref-target-editor.tsx} +9 -7
  296. package/src/widgets/{plotter-editor.jsx → plotter-editor.tsx} +34 -33
  297. package/src/widgets/radio/{editor.jsx → editor.tsx} +22 -21
  298. package/src/widgets/{reaction-diagram-editor.jsx → reaction-diagram-editor.tsx} +14 -10
  299. package/src/widgets/{sequence-editor.jsx → sequence-editor.tsx} +13 -13
  300. package/src/widgets/{simple-markdown-tester-editor.jsx → simple-markdown-tester-editor.tsx} +11 -9
  301. package/src/widgets/{simple-markdown-tester.jsx → simple-markdown-tester.tsx} +8 -7
  302. package/src/widgets/{simulator-editor.jsx → simulator-editor.tsx} +10 -8
  303. package/src/widgets/{sorter-editor.jsx → sorter-editor.tsx} +8 -6
  304. package/src/widgets/{table-editor.jsx → table-editor.tsx} +11 -10
  305. package/src/widgets/{transformer-editor.jsx → transformer-editor.tsx} +37 -35
  306. package/src/widgets/{unit-editor.jsx → unit-editor.tsx} +31 -25
  307. package/src/widgets/{video-editor.jsx → video-editor.tsx} +8 -9
  308. package/tsconfig.json +22 -0
  309. package/tsconfig.tsbuildinfo +1 -0
  310. package/src/all-editors.js +0 -85
  311. package/src/all-widgets.js +0 -10
  312. /package/dist/{strings.js → strings} +0 -0
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  /* eslint-disable react/no-unsafe */
3
3
  /* eslint-disable react/sort-comp */
4
- // @flow
5
4
  import {
6
5
  components,
7
6
  interactiveSizes,
@@ -13,26 +12,29 @@ import createReactClass from "create-react-class";
13
12
  import * as React from "react";
14
13
  import _ from "underscore";
15
14
 
16
- import GraphSettings from "../components/graph-settings.jsx";
15
+ import GraphSettings from "../components/graph-settings";
17
16
 
18
17
  const {InfoTip} = components;
19
18
  const {containerSizeClass, getInteractiveBoxFromSizeClass} = SizingUtils;
20
19
  const DeprecationMixin = Util.DeprecationMixin;
21
20
  const InteractiveGraph = InteractiveGraphWidget.widget;
22
21
 
23
- type InteractiveGraphProps = React.ElementConfig<typeof InteractiveGraph>;
22
+ type InteractiveGraphProps = JSX.LibraryManagedAttributes<
23
+ typeof InteractiveGraph,
24
+ React.ComponentProps<typeof InteractiveGraph>
25
+ >;
24
26
 
25
27
  const defaultBackgroundImage = {
26
28
  url: null,
27
- };
29
+ } as const;
28
30
 
29
31
  const deprecatedProps = {
30
32
  showGraph: function (props) {
31
33
  return {markings: props.showGraph ? "graph" : "none"};
32
34
  },
33
- };
35
+ } as const;
34
36
 
35
- const InteractiveGraphEditor: $FlowFixMe = createReactClass({
37
+ const InteractiveGraphEditor: any = createReactClass({
36
38
  displayName: "InteractiveGraphEditor",
37
39
  className: "perseus-widget-interactive-graph",
38
40
 
@@ -68,7 +70,6 @@ const InteractiveGraphEditor: $FlowFixMe = createReactClass({
68
70
 
69
71
  // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`
70
72
  UNSAFE_componentWillMount() {
71
- // $FlowFixMe[object-this-reference]
72
73
  DeprecationMixin.UNSAFE_componentWillMount.call(this);
73
74
  },
74
75
 
@@ -107,7 +108,7 @@ const InteractiveGraphEditor: $FlowFixMe = createReactClass({
107
108
  trackInteraction: function () {},
108
109
  onChange: (newProps: InteractiveGraphProps) => {
109
110
  let correct = this.props.correct;
110
- // $FlowFixMe[incompatible-use]
111
+ // @ts-expect-error [FEI-5003] - TS2532 - Object is possibly 'undefined'.
111
112
  if (correct.type === newProps.graph.type) {
112
113
  correct = _.extend({}, correct, newProps.graph);
113
114
  } else {
@@ -116,12 +117,13 @@ const InteractiveGraphEditor: $FlowFixMe = createReactClass({
116
117
  }
117
118
  this.props.onChange({correct: correct});
118
119
  },
119
- };
120
+ } as const;
120
121
  graph = (
121
122
  // There are a bunch of props that renderer.jsx passes to widgets via
122
123
  // getWidgetProps() and widget-container.jsx that the editors don't
123
124
  // bother passing.
124
125
  // $FlowFixMe[prop-missing]
126
+ // @ts-expect-error [FEI-5003] - TS2769 - No overload matches this call.
125
127
  <InteractiveGraph
126
128
  {...graphProps}
127
129
  containerSizeClass={sizeClass}
@@ -133,7 +135,7 @@ const InteractiveGraphEditor: $FlowFixMe = createReactClass({
133
135
  );
134
136
  // TODO(kevinb): Update getEquationString to only accept the data it actually
135
137
  // needs to compute the equation string.
136
- // $FlowFixMe[prop-missing]
138
+ // @ts-expect-error [FEI-5003] - TS2345 - Argument of type '{ readonly ref: "graph"; readonly box: any; readonly range: any; readonly labels: any; readonly step: any; readonly gridStep: any; readonly snapStep: any; readonly graph: any; readonly backgroundImage: any; ... 6 more ...; readonly onChange: (newProps: Pick<...> & ... 1 more ... & InexactPartial<...>) => void; }' is not assignable to parameter of type 'Props'.
137
139
  equationString = InteractiveGraph.getEquationString(graphProps);
138
140
  } else {
139
141
  graph = <div className="perseus-error">{this.props.valid}</div>;
@@ -310,6 +312,7 @@ const InteractiveGraphEditor: $FlowFixMe = createReactClass({
310
312
  ],
311
313
  function (key) {
312
314
  if (_.has(correct, key)) {
315
+ // @ts-expect-error [FEI-5003] - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor" | "showRuler" | "rulerLabel" | "rulerTicks">'.
313
316
  json.graph[key] = correct[key];
314
317
  }
315
318
  },
@@ -1,19 +1,18 @@
1
- // @flow
2
1
  import {action} from "@storybook/addon-actions";
3
2
  import {StyleSheet, css} from "aphrodite";
4
3
  import * as React from "react";
5
4
 
6
- import AnswerChoices from "../answer-choices.jsx";
5
+ import AnswerChoices from "../answer-choices";
7
6
 
8
- type StoryArgs = {||};
7
+ type StoryArgs = Record<any, any>;
9
8
 
10
- type Story = {|
11
- title: string,
12
- |};
9
+ type Story = {
10
+ title: string;
11
+ };
13
12
 
14
- export default ({
13
+ export default {
15
14
  title: "Perseus/Editor/Widgets/Label Image/Answer Choices",
16
- }: Story);
15
+ } as Story;
17
16
 
18
17
  const styles = StyleSheet.create({
19
18
  wrapper: {
@@ -22,7 +21,7 @@ const styles = StyleSheet.create({
22
21
  },
23
22
  });
24
23
 
25
- const Wrapper = (props: $FlowFixMe) => {
24
+ const Wrapper = (props: any) => {
26
25
  return (
27
26
  <div className={css(styles.wrapper)}>
28
27
  <AnswerChoices
@@ -37,14 +36,16 @@ const Wrapper = (props: $FlowFixMe) => {
37
36
  };
38
37
 
39
38
  class WithState extends React.Component<
40
- {||},
41
- {|choices: $ReadOnlyArray<string>|},
39
+ Record<any, any>,
40
+ {
41
+ choices: ReadonlyArray<string>;
42
+ }
42
43
  > {
43
44
  state = {
44
45
  choices: [],
45
46
  };
46
47
 
47
- render(): React.Node {
48
+ render(): React.ReactNode {
48
49
  const {choices} = this.state;
49
50
 
50
51
  return (
@@ -56,12 +57,16 @@ class WithState extends React.Component<
56
57
  }
57
58
  }
58
59
 
59
- export const EmptyNonInteractive = (args: StoryArgs): React.Node => {
60
- const props = {choices: [], onChange: (...args) => {}};
60
+ export const EmptyNonInteractive: React.FC<StoryArgs> = (
61
+ args,
62
+ ): React.ReactElement => {
63
+ const props = {choices: [], onChange: (...args) => {}} as const;
61
64
  return <Wrapper {...props} />;
62
65
  };
63
66
 
64
- export const FilledNonInteractive = (args: StoryArgs): React.Node => {
67
+ export const FilledNonInteractive: React.FC<StoryArgs> = (
68
+ args,
69
+ ): React.ReactElement => {
65
70
  const props = {
66
71
  choices: [
67
72
  "Lamborghini",
@@ -72,10 +77,10 @@ export const FilledNonInteractive = (args: StoryArgs): React.Node => {
72
77
  "Ferrari",
73
78
  ],
74
79
  onChange: (...args) => {},
75
- };
80
+ } as const;
76
81
  return <Wrapper {...props} />;
77
82
  };
78
83
 
79
- export const Interactive = (args: StoryArgs): React.Node => {
84
+ export const Interactive: React.FC<StoryArgs> = (args): React.ReactElement => {
80
85
  return <WithState />;
81
86
  };
@@ -1,20 +1,19 @@
1
- // @flow
2
1
  import {action} from "@storybook/addon-actions";
3
2
  import * as React from "react";
4
3
 
5
- import Behavior from "../behavior.jsx";
4
+ import Behavior from "../behavior";
6
5
 
7
- type StoryArgs = {||};
6
+ type StoryArgs = Record<any, any>;
8
7
 
9
- type Story = {|
10
- title: string,
11
- |};
8
+ type Story = {
9
+ title: string;
10
+ };
12
11
 
13
- export default ({
12
+ export default {
14
13
  title: "Perseus/Editor/Widgets/Label Image/Behavior",
15
- }: Story);
14
+ } as Story;
16
15
 
17
- export const Default = (args: StoryArgs): React.Node => {
16
+ export const Default: React.FC<StoryArgs> = (args): React.ReactElement => {
18
17
  const [state, setState] = React.useState({
19
18
  multipleAnswers: false,
20
19
  hideChoicesFromInstructions: false,
@@ -27,6 +26,6 @@ export const Default = (args: StoryArgs): React.Node => {
27
26
  action("onChange")(newState);
28
27
  setState({...state, ...newState});
29
28
  },
30
- };
29
+ } as const;
31
30
  return <Behavior {...props} />;
32
31
  };
@@ -1,19 +1,18 @@
1
- // @flow
2
1
  import {action} from "@storybook/addon-actions";
3
2
  import {StyleSheet, css} from "aphrodite";
4
3
  import * as React from "react";
5
4
 
6
- import Marker from "../marker.jsx";
5
+ import Marker from "../marker";
7
6
 
8
- type StoryArgs = {||};
7
+ type StoryArgs = Record<any, any>;
9
8
 
10
- type Story = {|
11
- title: string,
12
- |};
9
+ type Story = {
10
+ title: string;
11
+ };
13
12
 
14
- export default ({
13
+ export default {
15
14
  title: "Perseus/Editor/Widgets/Label Image/Marker",
16
- }: Story);
15
+ } as Story;
17
16
 
18
17
  const styles = StyleSheet.create({
19
18
  wrapper: {
@@ -34,7 +33,7 @@ const Wrapper = (props) => (
34
33
  </div>
35
34
  );
36
35
 
37
- export const Empty = (args: StoryArgs): React.Node => {
36
+ export const Empty: React.FC<StoryArgs> = (args): React.ReactElement => {
38
37
  const props = {
39
38
  answers: [],
40
39
  choices: [],
@@ -47,11 +46,11 @@ export const Empty = (args: StoryArgs): React.Node => {
47
46
  },
48
47
  x: 50,
49
48
  y: 50,
50
- };
49
+ } as const;
51
50
  return <Wrapper {...props} />;
52
51
  };
53
52
 
54
- export const WithAnswers = (args: StoryArgs): React.Node => {
53
+ export const WithAnswers: React.FC<StoryArgs> = (args): React.ReactElement => {
55
54
  const props = {
56
55
  answers: ["BMW", "Ferrari"],
57
56
  choices: [
@@ -71,6 +70,6 @@ export const WithAnswers = (args: StoryArgs): React.Node => {
71
70
  },
72
71
  x: 50,
73
72
  y: 50,
74
- };
73
+ } as const;
75
74
  return <Wrapper {...props} />;
76
75
  };
@@ -1,20 +1,19 @@
1
- // @flow
2
1
  import {StyleSheet, css} from "aphrodite";
3
2
  import * as React from "react";
4
3
 
5
- import QuestionMarkers from "../question-markers.jsx";
4
+ import QuestionMarkers from "../question-markers";
6
5
 
7
6
  import type {MarkerType} from "@khanacademy/perseus";
8
7
 
9
- type StoryArgs = {||};
8
+ type StoryArgs = Record<any, any>;
10
9
 
11
- type Story = {|
12
- title: string,
13
- |};
10
+ type Story = {
11
+ title: string;
12
+ };
14
13
 
15
- export default ({
14
+ export default {
16
15
  title: "Perseus/Editor/Widgets/Label Image/Question Markers",
17
- }: Story);
16
+ } as Story;
18
17
 
19
18
  const styles = StyleSheet.create({
20
19
  wrapper: {
@@ -30,8 +29,10 @@ const Wrapper = (props) => (
30
29
  );
31
30
 
32
31
  class WithState extends React.Component<
33
- {||},
34
- {|markers: $ReadOnlyArray<MarkerType>|},
32
+ Record<any, any>,
33
+ {
34
+ markers: ReadonlyArray<MarkerType>;
35
+ }
35
36
  > {
36
37
  state = {
37
38
  markers: [
@@ -44,7 +45,7 @@ class WithState extends React.Component<
44
45
  ],
45
46
  };
46
47
 
47
- render(): React.Node {
48
+ render(): React.ReactNode {
48
49
  const {markers} = this.state;
49
50
 
50
51
  return (
@@ -69,7 +70,7 @@ class WithState extends React.Component<
69
70
  }
70
71
  }
71
72
 
72
- export const Empty = (args: StoryArgs): React.Node => {
73
+ export const Empty: React.FC<StoryArgs> = (args): React.ReactElement => {
73
74
  const props = {
74
75
  choices: [],
75
76
  imageUrl: "",
@@ -77,11 +78,11 @@ export const Empty = (args: StoryArgs): React.Node => {
77
78
  imageHeight: 0,
78
79
  markers: [],
79
80
  onChange: () => {},
80
- };
81
+ } as const;
81
82
  return <Wrapper {...props} />;
82
83
  };
83
84
 
84
- export const Filled = (args: StoryArgs): React.Node => {
85
+ export const Filled: React.FC<StoryArgs> = (args): React.ReactElement => {
85
86
  const props = {
86
87
  choices: [],
87
88
  imageUrl:
@@ -97,10 +98,10 @@ export const Filled = (args: StoryArgs): React.Node => {
97
98
  },
98
99
  ],
99
100
  onChange: () => {},
100
- };
101
+ } as const;
101
102
  return <Wrapper {...props} />;
102
103
  };
103
104
 
104
- export const Interactive = (args: StoryArgs): React.Node => {
105
+ export const Interactive: React.FC<StoryArgs> = (args): React.ReactElement => {
105
106
  return <WithState />;
106
107
  };
@@ -1,18 +1,17 @@
1
- // @flow
2
1
  import {StyleSheet, css} from "aphrodite";
3
2
  import * as React from "react";
4
3
 
5
- import SelectImage from "../select-image.jsx";
4
+ import SelectImage from "../select-image";
6
5
 
7
- type StoryArgs = {||};
6
+ type StoryArgs = Record<any, any>;
8
7
 
9
- type Story = {|
10
- title: string,
11
- |};
8
+ type Story = {
9
+ title: string;
10
+ };
12
11
 
13
- export default ({
12
+ export default {
14
13
  title: "Perseus/Editor/Widgets/Label Image/Select Image",
15
- }: Story);
14
+ } as Story;
16
15
 
17
16
  const styles = StyleSheet.create({
18
17
  wrapper: {
@@ -37,24 +36,24 @@ const WithState = () => {
37
36
  );
38
37
  };
39
38
 
40
- export const Empty = (args: StoryArgs): React.Node => {
39
+ export const Empty: React.FC<StoryArgs> = (args): React.ReactElement => {
41
40
  const props = {
42
41
  url: "",
43
42
  onChange: () => {},
44
- };
43
+ } as const;
45
44
 
46
45
  return <Wrapper {...props} />;
47
46
  };
48
47
 
49
- export const Filled = (args: StoryArgs): React.Node => {
48
+ export const Filled: React.FC<StoryArgs> = (args): React.ReactElement => {
50
49
  const props = {
51
50
  url: "https://ka-perseus-images.s3.amazonaws.com/2ee5fc32e35c5178373b39fd304b325b2994c913.png",
52
51
  onChange: () => {},
53
- };
52
+ } as const;
54
53
 
55
54
  return <Wrapper {...props} />;
56
55
  };
57
56
 
58
- export const Interactive = (args: StoryArgs): React.Node => {
57
+ export const Interactive: React.FC<StoryArgs> = (args): React.ReactElement => {
59
58
  return <WithState />;
60
59
  };
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  /**
3
2
  * Controlled list of answer choices, handles adding and removing answers.
4
3
  */
@@ -7,47 +6,44 @@ import {components, globalStyles} from "@khanacademy/perseus";
7
6
  import {StyleSheet, css} from "aphrodite";
8
7
  import * as React from "react";
9
8
 
10
- import FormWrappedTextField from "../../components/form-wrapped-text-field.jsx";
11
- import Link from "../../components/link.jsx";
9
+ import FormWrappedTextField from "../../components/form-wrapped-text-field";
10
+ import Link from "../../components/link";
12
11
 
13
12
  const {colors, typography} = globalStyles;
14
13
  const {Icon} = components;
15
14
 
16
15
  type AddAnswerProps = {
17
16
  // Callback to add new answer choice.
18
- onClick: () => void,
19
- ...
17
+ onClick: () => void;
20
18
  };
21
19
 
22
20
  type AnswerProps = {
23
21
  // The answer string, can be plain text or a KaTeX expression.
24
- answer: string,
22
+ answer: string;
25
23
  // Callback for when an answer is changed.
26
- onChange: (answer: string) => void,
24
+ onChange: (answer: string) => void;
27
25
  // Callback to remove answer from list of choices.
28
- onRemove: () => void,
29
- ...
26
+ onRemove: () => void;
30
27
  };
31
28
 
32
29
  type AnswerChoicesProps = {
33
30
  // The list of possible answers in a specific order.
34
- choices: $ReadOnlyArray<string>,
31
+ choices: ReadonlyArray<string>;
35
32
  // Callback for when answers change.
36
- onChange: (choices: $ReadOnlyArray<string>) => void,
37
- ...
33
+ onChange: (choices: ReadonlyArray<string>) => void;
38
34
  };
39
35
 
40
36
  const addIcon = {
41
37
  path: "M11 11V7a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4H7a1 1 0 0 1 0-2h4zm1 13C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",
42
38
  width: 24,
43
39
  height: 24,
44
- };
40
+ } as const;
45
41
 
46
42
  const removeIcon = {
47
43
  path: "M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm-5-9a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2H7z",
48
44
  width: 24,
49
45
  height: 24,
50
- };
46
+ } as const;
51
47
 
52
48
  const DraggableGripIcon = () => (
53
49
  <svg width="16" height="16" viewBox="0 0 16 16">
@@ -93,7 +89,7 @@ const DraggableGripIcon = () => (
93
89
  /**
94
90
  * A button link to add a new answer.
95
91
  */
96
- const AddAnswer = ({onClick}: AddAnswerProps) => (
92
+ const AddAnswer: React.FC<AddAnswerProps> = ({onClick}): React.ReactElement => (
97
93
  <Link
98
94
  className={css(styles.addAnswer, editorStyles.addAnswer)}
99
95
  onClick={onClick}
@@ -109,7 +105,11 @@ const AddAnswer = ({onClick}: AddAnswerProps) => (
109
105
  *
110
106
  * TODO(michaelpolyak): Implement answer reordering, CP-117
111
107
  */
112
- const Answer = ({answer, onChange, onRemove}: AnswerProps) => (
108
+ const Answer: React.FC<AnswerProps> = ({
109
+ answer,
110
+ onChange,
111
+ onRemove,
112
+ }): React.ReactElement => (
113
113
  <li className={css(styles.answer)}>
114
114
  <Link onClick={onRemove}>
115
115
  <Icon icon={removeIcon} size={24} color="#D92916" />
@@ -137,10 +137,10 @@ const Answer = ({answer, onChange, onRemove}: AnswerProps) => (
137
137
  /**
138
138
  * The list of choices, handles adding, removing and reording of answers.
139
139
  */
140
- const AnswerChoices = ({
140
+ const AnswerChoices: React.FC<AnswerChoicesProps> = ({
141
141
  choices,
142
142
  onChange,
143
- }: AnswerChoicesProps): React.Element<"div"> => (
143
+ }): React.ReactElement => (
144
144
  <div>
145
145
  <div className={css(styles.title)}>Answer Choices</div>
146
146
 
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  /**
3
2
  * Controlled component to display and change widget options.
4
3
  */
@@ -7,28 +6,27 @@ import {globalStyles} from "@khanacademy/perseus";
7
6
  import {StyleSheet, css} from "aphrodite";
8
7
  import * as React from "react";
9
8
 
10
- import Checkbox from "../../components/checkbox.jsx";
9
+ import Checkbox from "../../components/checkbox";
11
10
 
12
11
  const {colors, typography} = globalStyles;
13
12
 
14
13
  type BehaviorProps = {
15
14
  // Whether multiple answer choices may be selected for markers.
16
- multipleAnswers: boolean,
15
+ multipleAnswers: boolean;
17
16
  // Whether to hide answer choices from user instructions.
18
- hideChoicesFromInstructions: boolean,
17
+ hideChoicesFromInstructions: boolean;
19
18
  // Callback for when widget options change.
20
- onChange: (options: {|
21
- multipleAnswers?: boolean,
22
- hideChoicesFromInstructions?: boolean,
23
- |}) => void,
24
- ...
19
+ onChange: (options: {
20
+ multipleAnswers?: boolean;
21
+ hideChoicesFromInstructions?: boolean;
22
+ }) => void;
25
23
  };
26
24
 
27
- const Behavior = ({
25
+ const Behavior: React.FC<BehaviorProps> = ({
28
26
  multipleAnswers,
29
27
  hideChoicesFromInstructions,
30
28
  onChange,
31
- }: BehaviorProps): React.Element<"div"> => (
29
+ }): React.ReactElement => (
32
30
  <div>
33
31
  <div className={css(styles.title)}>Behavior</div>
34
32
 
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable react/no-unsafe */
2
- // @flow
3
2
  /**
4
3
  * Controlled editor image marker on the question image.
5
4
  *
@@ -11,34 +10,30 @@ import {globalConstants, globalStyles} from "@khanacademy/perseus";
11
10
  import {StyleSheet, css} from "aphrodite";
12
11
  import * as React from "react";
13
12
 
14
- import Option, {OptionGroup} from "../../components/dropdown-option.jsx";
15
- import FormWrappedTextField from "../../components/form-wrapped-text-field.jsx";
13
+ import Option, {OptionGroup} from "../../components/dropdown-option";
14
+ import FormWrappedTextField from "../../components/form-wrapped-text-field";
16
15
 
17
16
  import type {MarkerType} from "@khanacademy/perseus";
18
17
 
19
18
  const {colors, borderRadius} = globalStyles;
20
19
 
21
- type MarkerProps = {|
22
- ...MarkerType,
23
-
20
+ type MarkerProps = MarkerType & {
24
21
  // The list of possible answer choices.
25
- choices: $ReadOnlyArray<string>,
26
-
22
+ choices: ReadonlyArray<string>;
27
23
  // Callback for when any of the marker props are changed.
28
- onChange: (marker: MarkerType) => void,
29
-
24
+ onChange: (marker: MarkerType) => void;
30
25
  // Callback to remove marker from the question image.
31
- onRemove: () => void,
32
- |};
26
+ onRemove: () => void;
27
+ };
33
28
 
34
- type MarkerState = {|
29
+ type MarkerState = {
35
30
  // Whether answer choices dropdown is shown, controlled by the user clicking
36
31
  // on the marker icon.
37
- showDropdown: boolean,
38
- |};
32
+ showDropdown: boolean;
33
+ };
39
34
 
40
35
  export default class Marker extends React.Component<MarkerProps, MarkerState> {
41
- _marker: ?HTMLElement;
36
+ _marker: HTMLElement | null | undefined;
42
37
 
43
38
  constructor(props: MarkerProps) {
44
39
  super(props);
@@ -96,7 +91,7 @@ export default class Marker extends React.Component<MarkerProps, MarkerState> {
96
91
  this.setState({showDropdown: !showDropdown});
97
92
  } else if (showDropdown) {
98
93
  // Close dropdown if click event was registered anywhere outside it.
99
- if (this._marker && !this._marker.contains((e.target: any))) {
94
+ if (this._marker && !this._marker.contains(e.target as any)) {
100
95
  // Ensure other listeners are not triggered on click event that
101
96
  // closes the dropdown. A specific case this addresses is when
102
97
  // user clicks on question image to close dropdown, a new marker
@@ -108,7 +103,9 @@ export default class Marker extends React.Component<MarkerProps, MarkerState> {
108
103
  }
109
104
  };
110
105
 
111
- handleLabelChange: (e: SyntheticInputEvent<>) => void = (e) => {
106
+ handleLabelChange: (e: React.ChangeEvent<HTMLInputElement>) => void = (
107
+ e,
108
+ ) => {
112
109
  this.updateMarker({label: e.target.value});
113
110
  };
114
111
 
@@ -126,7 +123,7 @@ export default class Marker extends React.Component<MarkerProps, MarkerState> {
126
123
  this.updateMarker({answers});
127
124
  };
128
125
 
129
- render(): React.Element<"div"> {
126
+ render(): React.ReactNode {
130
127
  const {answers, choices, label, onRemove, x, y} = this.props;
131
128
 
132
129
  const {showDropdown} = this.state;
@@ -166,6 +163,7 @@ export default class Marker extends React.Component<MarkerProps, MarkerState> {
166
163
  onSelected={this.handleSelectAnswer}
167
164
  // TODO(WB-1096): make selectedValues immutable in wonder-blocks
168
165
  // $FlowFixMe[incompatible-type]
166
+ // @ts-expect-error [FEI-5003] - TS2769 - No overload matches this call.
169
167
  selectedValues={answers}
170
168
  >
171
169
  {choices.map((choice) => (