@khanacademy/perseus-editor 2.15.3 → 2.15.5

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 (61) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/editor-page.d.ts +4 -10
  3. package/dist/editor.d.ts +2 -2
  4. package/dist/es/index.js +362 -360
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/index.js +426 -425
  7. package/dist/index.js.map +1 -1
  8. package/dist/widgets/interaction-editor/function-editor.d.ts +26 -0
  9. package/dist/widgets/interaction-editor/index.d.ts +2 -0
  10. package/dist/widgets/interaction-editor/label-editor.d.ts +22 -0
  11. package/dist/widgets/interaction-editor/line-editor.d.ts +30 -0
  12. package/dist/widgets/interaction-editor/movable-line-editor.d.ts +32 -0
  13. package/dist/widgets/interaction-editor/movable-point-editor.d.ts +28 -0
  14. package/dist/widgets/interaction-editor/parametric-editor.d.ts +28 -0
  15. package/dist/widgets/interaction-editor/point-editor.d.ts +20 -0
  16. package/dist/widgets/interaction-editor/rectangle-editor.d.ts +24 -0
  17. package/dist/widgets/interactive-graph-editor.d.ts +92 -92
  18. package/package.json +2 -2
  19. package/src/__stories__/editor-page.stories.tsx +65 -0
  20. package/src/__stories__/editor.stories.tsx +2 -4
  21. package/src/editor-page.tsx +5 -11
  22. package/src/editor.tsx +2 -2
  23. package/src/widgets/__stories__/categorizer-editor.stories.tsx +24 -0
  24. package/src/widgets/__stories__/definition-editor.stories.tsx +18 -0
  25. package/src/widgets/__stories__/dropdown-editor.stories.tsx +18 -0
  26. package/src/widgets/__stories__/explanation-editor.stories.tsx +18 -0
  27. package/src/widgets/__stories__/input-number-editor.stories.tsx +18 -0
  28. package/src/widgets/__stories__/interaction-editor.stories.tsx +24 -0
  29. package/src/widgets/__stories__/matcher-editor.stories.tsx +18 -0
  30. package/src/widgets/__stories__/number-line-editor.stories.tsx +18 -0
  31. package/src/widgets/__stories__/numeric-input-editor.stories.tsx +18 -0
  32. package/src/widgets/__stories__/radio-editor.stories.tsx +3 -3
  33. package/src/widgets/__stories__/sorter-editor.stories.tsx +18 -0
  34. package/src/widgets/__tests__/categorizer-editor.test.tsx +51 -0
  35. package/src/widgets/__tests__/definition-editor.test.tsx +41 -0
  36. package/src/widgets/__tests__/dropdown-editor.test.tsx +57 -0
  37. package/src/widgets/__tests__/explanation-editor.test.tsx +59 -0
  38. package/src/widgets/__tests__/input-number-editor.test.tsx +128 -0
  39. package/src/widgets/__tests__/matcher-editor.test.tsx +47 -0
  40. package/src/widgets/__tests__/number-line-editor.test.tsx +144 -0
  41. package/src/widgets/__tests__/numeric-input-editor.test.tsx +177 -0
  42. package/src/widgets/__tests__/radio-editor.test.tsx +118 -0
  43. package/src/widgets/__tests__/sorter-editor.test.tsx +55 -0
  44. package/src/widgets/dropdown-editor.tsx +1 -0
  45. package/src/widgets/input-number-editor.tsx +2 -0
  46. package/src/widgets/interaction-editor/function-editor.tsx +111 -0
  47. package/src/widgets/interaction-editor/index.ts +3 -0
  48. package/src/widgets/{interaction-editor.tsx → interaction-editor/interaction-editor.tsx} +14 -768
  49. package/src/widgets/interaction-editor/label-editor.tsx +91 -0
  50. package/src/widgets/interaction-editor/line-editor.tsx +129 -0
  51. package/src/widgets/interaction-editor/movable-line-editor.tsx +125 -0
  52. package/src/widgets/interaction-editor/movable-point-editor.tsx +92 -0
  53. package/src/widgets/interaction-editor/parametric-editor.tsx +122 -0
  54. package/src/widgets/interaction-editor/point-editor.tsx +79 -0
  55. package/src/widgets/interaction-editor/rectangle-editor.tsx +105 -0
  56. package/src/widgets/number-line-editor.tsx +16 -5
  57. package/src/widgets/numeric-input-editor.tsx +2 -0
  58. package/tsconfig-build.tsbuildinfo +1 -1
  59. package/dist/widgets/{interaction → interaction-editor}/constraint-editor.d.ts +0 -0
  60. package/dist/widgets/{interaction-editor.d.ts → interaction-editor/interaction-editor.d.ts} +1 -1
  61. /package/src/widgets/{interaction → interaction-editor}/constraint-editor.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @khanacademy/perseus-editor
2
2
 
3
+ ## 2.15.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#904](https://github.com/Khan/perseus/pull/904) [`ca241171`](https://github.com/Khan/perseus/commit/ca241171e5fa893fc114241ac1ebc0260c9d57c5) Thanks [@handeyeco](https://github.com/handeyeco)! - Restructure interaction-editor subcomponents
8
+
9
+ - Updated dependencies [[`29563723`](https://github.com/Khan/perseus/commit/29563723cf229a9169d0c78a0174a8dbc8029861), [`6c841f55`](https://github.com/Khan/perseus/commit/6c841f55027c87bfc8339816dac582f175a84193)]:
10
+ - @khanacademy/perseus@17.5.0
11
+
12
+ ## 2.15.4
13
+
14
+ ### Patch Changes
15
+
16
+ - [#892](https://github.com/Khan/perseus/pull/892) [`22a8f42c`](https://github.com/Khan/perseus/commit/22a8f42c9e31cc74f1ab2f5a375ce5166353153f) Thanks [@handeyeco](https://github.com/handeyeco)! - add tests for NumberLineEditor
17
+
18
+ * [#887](https://github.com/Khan/perseus/pull/887) [`d09fdb98`](https://github.com/Khan/perseus/commit/d09fdb98963f23dbeb2009518513db671e0f09bb) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Add Storybook story for EditorPage component
19
+
20
+ - [#882](https://github.com/Khan/perseus/pull/882) [`6f1ddaa3`](https://github.com/Khan/perseus/commit/6f1ddaa3eae41d87aaf3514ab0f4cd7875b3125b) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests for RadioEditor
21
+
22
+ * [#893](https://github.com/Khan/perseus/pull/893) [`cbd51e81`](https://github.com/Khan/perseus/commit/cbd51e810cc6f6f406fa92b5faceb4fb3655bbb4) Thanks [@handeyeco](https://github.com/handeyeco)! - add tests for InputNumber
23
+
24
+ - [#884](https://github.com/Khan/perseus/pull/884) [`c2172fb9`](https://github.com/Khan/perseus/commit/c2172fb90f247b3a914eaf7eb01b7b15ceb1f0c0) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests for DropdownEditor
25
+
26
+ * [#891](https://github.com/Khan/perseus/pull/891) [`4fe720db`](https://github.com/Khan/perseus/commit/4fe720dbb388b71606bbf98c0606523b3eb3e395) Thanks [@handeyeco](https://github.com/handeyeco)! - add tests for DefinitionEditor
27
+
28
+ - [#890](https://github.com/Khan/perseus/pull/890) [`6607ed0d`](https://github.com/Khan/perseus/commit/6607ed0d81adedc84a201ddb4b55f32a78e92dc0) Thanks [@handeyeco](https://github.com/handeyeco)! - add tests for CategorizerEditor
29
+
30
+ * [#888](https://github.com/Khan/perseus/pull/888) [`68d8a766`](https://github.com/Khan/perseus/commit/68d8a766bfa769b8ab57c60e79be7080c6b32593) Thanks [@handeyeco](https://github.com/handeyeco)! - add tests for MatcherEditor
31
+
32
+ - [#886](https://github.com/Khan/perseus/pull/886) [`eeac31b7`](https://github.com/Khan/perseus/commit/eeac31b7be6ef2526f0f7ae20cc6bfa237581798) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests for SorterEditor
33
+
34
+ * [#885](https://github.com/Khan/perseus/pull/885) [`8e0eb5bc`](https://github.com/Khan/perseus/commit/8e0eb5bc7059c99054f9b13af9780c1103ebf5ee) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests for ExplanationEditor
35
+
36
+ - [#883](https://github.com/Khan/perseus/pull/883) [`0b90e681`](https://github.com/Khan/perseus/commit/0b90e681b7c81f76bca419c879c0985e3fa1226f) Thanks [@handeyeco](https://github.com/handeyeco)! - Add tests for NumericInputEditor
37
+
38
+ - Updated dependencies [[`c9db8185`](https://github.com/Khan/perseus/commit/c9db818510e2e0fd142c23298890dcad89a7549a), [`d09fdb98`](https://github.com/Khan/perseus/commit/d09fdb98963f23dbeb2009518513db671e0f09bb)]:
39
+ - @khanacademy/perseus@17.4.0
40
+
3
41
  ## 2.15.3
4
42
 
5
43
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { APIOptions, APIOptionsWithDefaults, ChangeHandler, DeviceType, Hint, ImageUploader, Version } from "@khanacademy/perseus";
2
+ import type { APIOptions, APIOptionsWithDefaults, ChangeHandler, DeviceType, Hint, ImageUploader, Version, PerseusItem } from "@khanacademy/perseus";
3
3
  import type { KEScore } from "@khanacademy/perseus-core";
4
4
  type Props = {
5
5
  apiOptions?: APIOptions;
@@ -18,14 +18,8 @@ type Props = {
18
18
  question?: any;
19
19
  previewURL: string;
20
20
  };
21
- type PerseusJson = {
22
- question: any;
23
- answerArea: any;
24
- hints: ReadonlyArray<Hint>;
25
- itemDataVersion?: Version;
26
- };
27
21
  type State = {
28
- json: PerseusJson;
22
+ json: PerseusItem;
29
23
  gradeMessage: string;
30
24
  wasAnswered: boolean;
31
25
  highlightLint: boolean;
@@ -49,9 +43,9 @@ declare class EditorPage extends React.Component<Props, State> {
49
43
  getSaveWarnings(): any;
50
44
  serialize(options?: {
51
45
  keepDeletedWidgets?: boolean;
52
- }): any | PerseusJson;
46
+ }): any | PerseusItem;
53
47
  handleChange: ChangeHandler;
54
- changeJSON: (newJson: PerseusJson) => void;
48
+ changeJSON: (newJson: PerseusItem) => void;
55
49
  scorePreview(): KEScore | null | undefined;
56
50
  render(): React.ReactNode;
57
51
  }
package/dist/editor.d.ts CHANGED
@@ -20,7 +20,7 @@ type Props = Readonly<{
20
20
  imageUploader?: (file: string, callback: (url: string) => unknown) => unknown;
21
21
  onChange: ChangeHandler;
22
22
  }>;
23
- type DeafultProps = {
23
+ type DefaultProps = {
24
24
  content: string;
25
25
  disabled: boolean;
26
26
  images: Record<any, any>;
@@ -41,7 +41,7 @@ declare class Editor extends React.Component<Props, State> {
41
41
  lastUserValue: string | null | undefined;
42
42
  deferredChange: any | null | undefined;
43
43
  widgetIds: any | null | undefined;
44
- static defaultProps: DeafultProps;
44
+ static defaultProps: DefaultProps;
45
45
  state: State;
46
46
  componentDidMount(): void;
47
47
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;