@khanacademy/perseus 54.1.0 → 55.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +18 -0
  2. package/dist/components/number-input.d.ts +9 -10
  3. package/dist/components/range-input.d.ts +5 -6
  4. package/dist/components/simple-keypad-input.d.ts +5 -0
  5. package/dist/components/stub-tag-editor.d.ts +3 -4
  6. package/dist/components/text-list-editor.d.ts +3 -4
  7. package/dist/es/index.css +16 -6
  8. package/dist/es/index.js +902 -985
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/strings.js +40 -10
  11. package/dist/es/strings.js.map +1 -1
  12. package/dist/index.css +16 -6
  13. package/dist/index.js +1036 -1086
  14. package/dist/index.js.map +1 -1
  15. package/dist/mixins/changeable.d.ts +1 -2
  16. package/dist/perseus-api.d.ts +1 -56
  17. package/dist/shared-utils/add-library-version-to-perseus-debug.d.ts +9 -0
  18. package/dist/strings.d.ts +34 -4
  19. package/dist/strings.js +142 -97
  20. package/dist/strings.js.map +1 -1
  21. package/dist/widget-ai-utils/numeric-input/prompt-utils.d.ts +1 -1
  22. package/dist/widgets/dropdown/dropdown.d.ts +5 -4
  23. package/dist/widgets/interactive-graph.d.ts +4 -2
  24. package/dist/widgets/interactive-graphs/graphs/circle.d.ts +7 -0
  25. package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +6 -0
  26. package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +8 -0
  27. package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +7 -0
  28. package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +1 -1
  29. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +6 -1
  30. package/dist/widgets/numeric-input/index.d.ts +1 -1
  31. package/dist/widgets/numeric-input/input-with-examples.d.ts +8 -0
  32. package/dist/widgets/numeric-input/numeric-input.class.d.ts +66 -0
  33. package/dist/widgets/numeric-input/numeric-input.d.ts +123 -77
  34. package/dist/widgets/numeric-input/utils.d.ts +25 -0
  35. package/package.json +120 -124
  36. package/dist/components/input-with-examples.d.ts +0 -51
  37. package/dist/components/tooltip.d.ts +0 -85
package/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright 2022 Khan Academy
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to use,
6
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ Software, and to permit persons to whom the Software is furnished to do so, subject
8
+ to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
17
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,4 +1,3 @@
1
- import PropTypes from "prop-types";
2
1
  import * as React from "react";
3
2
  import { PerseusI18nContext } from "./i18n-context";
4
3
  import type { MathFormat } from "@khanacademy/perseus-core";
@@ -26,15 +25,15 @@ declare class NumberInput extends React.Component<any, any> {
26
25
  context: React.ContextType<typeof PerseusI18nContext>;
27
26
  inputRef: React.RefObject<HTMLInputElement>;
28
27
  static propTypes: {
29
- value: PropTypes.Requireable<number>;
30
- format: PropTypes.Requireable<string>;
31
- placeholder: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
32
- onChange: PropTypes.Validator<(...args: any[]) => any>;
33
- onFormatChange: PropTypes.Requireable<(...args: any[]) => any>;
34
- checkValidity: PropTypes.Requireable<(...args: any[]) => any>;
35
- size: PropTypes.Requireable<string>;
36
- label: PropTypes.Requireable<string>;
37
- allowPiTruncation: PropTypes.Requireable<boolean>;
28
+ value: any;
29
+ format: any;
30
+ placeholder: any;
31
+ onChange: any;
32
+ onFormatChange: any;
33
+ checkValidity: any;
34
+ size: any;
35
+ label: any;
36
+ allowPiTruncation: any;
38
37
  };
39
38
  static defaultProps: any;
40
39
  state: any;
@@ -1,15 +1,14 @@
1
- import PropTypes from "prop-types";
2
1
  import * as React from "react";
3
2
  /**
4
3
  * A minor abstraction on top of `NumberInput` for ranges
5
4
  */
6
5
  declare class RangeInput extends React.Component<any> {
7
6
  static propTypes: {
8
- value: PropTypes.Validator<any[]>;
9
- onChange: PropTypes.Validator<(...args: any[]) => any>;
10
- placeholder: PropTypes.Requireable<any[]>;
11
- checkValidity: PropTypes.Requireable<(...args: any[]) => any>;
12
- allowPiTruncation: PropTypes.Requireable<boolean>;
7
+ value: any;
8
+ onChange: any;
9
+ placeholder: any;
10
+ checkValidity: any;
11
+ allowPiTruncation: any;
13
12
  };
14
13
  static defaultProps: any;
15
14
  onChange: (arg1: number, arg2: string) => void;
@@ -7,9 +7,14 @@
7
7
  * `math-input` subrepo and use it everywhere as a simpler, keypad-coupled
8
8
  * interface to `math-input`'s MathInput component.
9
9
  */
10
+ import { KeypadContext } from "@khanacademy/keypad-context";
11
+ import { KeypadInput } from "@khanacademy/math-input";
10
12
  import * as React from "react";
11
13
  export default class SimpleKeypadInput extends React.Component<any> {
14
+ static contextType: React.Context<import("@khanacademy/keypad-context").KeypadContextType>;
15
+ context: React.ContextType<typeof KeypadContext>;
12
16
  _isMounted: boolean;
17
+ inputRef: React.RefObject<KeypadInput>;
13
18
  componentDidMount(): void;
14
19
  componentWillUnmount(): void;
15
20
  focus(): void;
@@ -1,4 +1,3 @@
1
- import PropTypes from "prop-types";
2
1
  import * as React from "react";
3
2
  /**
4
3
  * Stub Tag Editor.
@@ -15,9 +14,9 @@ import * as React from "react";
15
14
  */
16
15
  declare class StubTagEditor extends React.Component<any> {
17
16
  static propTypes: {
18
- value: PropTypes.Requireable<(string | null | undefined)[]>;
19
- onChange: PropTypes.Validator<(...args: any[]) => any>;
20
- showTitle: PropTypes.Validator<boolean>;
17
+ value: any;
18
+ onChange: any;
19
+ showTitle: any;
21
20
  };
22
21
  static defaultProps: any;
23
22
  render(): React.ReactNode;
@@ -1,10 +1,9 @@
1
- import PropTypes from "prop-types";
2
1
  import * as React from "react";
3
2
  declare class TextListEditor extends React.Component<any, any> {
4
3
  static propTypes: {
5
- options: PropTypes.Requireable<any[]>;
6
- layout: PropTypes.Requireable<string>;
7
- onChange: PropTypes.Validator<(...args: any[]) => any>;
4
+ options: any;
5
+ layout: any;
6
+ onChange: any;
8
7
  };
9
8
  static defaultProps: any;
10
9
  state: any;
package/dist/es/index.css CHANGED
@@ -3091,6 +3091,22 @@ body.mobile .perseus-matrix .matrix-input-field {
3091
3091
  #translations-dashboard .perseus-widget-measurer > .graphie {
3092
3092
  z-index: -1;
3093
3093
  }
3094
+ .input-with-examples-tooltip {
3095
+ font-size: 18px;
3096
+ line-height: 28px;
3097
+ color: #717378;
3098
+ background: #fff;
3099
+ }
3100
+ .input-with-examples-tooltip ul {
3101
+ list-style-type: disc;
3102
+ margin-left: 30px;
3103
+ }
3104
+ .input-with-examples-tooltip strong {
3105
+ font-weight: 700;
3106
+ }
3107
+ .input-with-examples-tooltip em {
3108
+ font-style: italic;
3109
+ }
3094
3110
  .orderer {
3095
3111
  position: relative;
3096
3112
  }
@@ -3532,12 +3548,6 @@ body.mobile .framework-perseus table.perseus-widget-table-of-values.non-markdown
3532
3548
  display: none;
3533
3549
  }
3534
3550
  }
3535
- .perseus-formats-tooltip {
3536
- background: #fff;
3537
- color: #717378;
3538
- padding: 5px 10px;
3539
- width: 240px;
3540
- }
3541
3551
  /*
3542
3552
  Extra specificity needed to override other styles that are too broad.
3543
3553
  Once we get a better framework in place (like CSS Modules), we can fix this selector.