@khanacademy/perseus 81.0.2 → 82.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 (53) hide show
  1. package/dist/es/index.css +1 -1
  2. package/dist/es/index.css.map +1 -1
  3. package/dist/es/index.js +96 -105
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/es/strings.js +1 -1
  6. package/dist/es/strings.js.map +1 -1
  7. package/dist/index.css +1 -1
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.js +96 -105
  10. package/dist/index.js.map +1 -1
  11. package/dist/server-item-renderer.d.ts +1 -1
  12. package/dist/strings.d.ts +138 -41
  13. package/dist/strings.js +1 -1
  14. package/dist/strings.js.map +1 -1
  15. package/dist/styles/constants.d.ts +0 -1
  16. package/dist/testing/feature-flags-util.d.ts +0 -1
  17. package/dist/testing/item-renderer-hooks.d.ts +1 -1
  18. package/dist/widgets/dropdown/dropdown.d.ts +1 -1
  19. package/dist/widgets/expression/expression.d.ts +2 -2
  20. package/dist/widgets/free-response/free-response.d.ts +0 -2
  21. package/dist/widgets/image/image.d.ts +1 -1
  22. package/dist/widgets/interactive-graphs/graphs/components/build-point-aria-label.d.ts +7 -1
  23. package/dist/widgets/interactive-graphs/graphs/components/dashed-asymptote-line.d.ts +26 -0
  24. package/dist/widgets/interactive-graphs/graphs/strings/absolute-value.d.ts +2 -2
  25. package/dist/widgets/interactive-graphs/graphs/strings/angle.d.ts +1 -1
  26. package/dist/widgets/interactive-graphs/graphs/strings/circle.d.ts +1 -1
  27. package/dist/widgets/interactive-graphs/graphs/strings/coord-quadrant.d.ts +1 -1
  28. package/dist/widgets/interactive-graphs/graphs/strings/exponential.d.ts +1 -1
  29. package/dist/widgets/interactive-graphs/graphs/strings/linear-system.d.ts +17 -2
  30. package/dist/widgets/interactive-graphs/graphs/strings/logarithm.d.ts +1 -1
  31. package/dist/widgets/interactive-graphs/graphs/strings/quadratic.d.ts +1 -1
  32. package/dist/widgets/interactive-graphs/graphs/strings/ray.d.ts +1 -1
  33. package/dist/widgets/interactive-graphs/graphs/strings/segment.d.ts +16 -2
  34. package/dist/widgets/interactive-graphs/graphs/strings/sinusoid.d.ts +1 -1
  35. package/dist/widgets/interactive-graphs/graphs/strings/tangent.d.ts +2 -2
  36. package/dist/widgets/interactive-graphs/interactive-graph.d.ts +1 -1
  37. package/dist/widgets/interactive-graphs/mafs-graph.d.ts +0 -2
  38. package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +0 -2
  39. package/dist/widgets/interactive-graphs/types.d.ts +11 -10
  40. package/dist/widgets/label-image/label-image.d.ts +1 -1
  41. package/dist/widgets/measurer/measurer.d.ts +0 -14
  42. package/dist/widgets/mock-widgets/mock-widget.d.ts +1 -1
  43. package/dist/widgets/numeric-input/numeric-input.class.d.ts +1 -1
  44. package/dist/widgets/numeric-input/numeric-input.d.ts +2 -2
  45. package/dist/widgets/plotter/plotter.d.ts +0 -2
  46. package/dist/widgets/table/table.d.ts +1 -1
  47. package/package.json +7 -7
  48. package/dist/widgets/interactive-graphs/graphs/strings/custom-point-label.d.ts +0 -22
  49. package/dist/widgets/molecule/index.d.ts +0 -1
  50. package/dist/widgets/molecule/molecule-drawing.d.ts +0 -5
  51. package/dist/widgets/molecule/molecule-layout.d.ts +0 -81
  52. package/dist/widgets/molecule/molecule.d.ts +0 -23
  53. package/dist/widgets/molecule/smiles-parser.d.ts +0 -19
@@ -1,81 +0,0 @@
1
- /**
2
- * A molecule layout engine.
3
- *
4
- * This module transforms the SMILES syntax tree into a set of rendering
5
- * instructions. A rendering instruction is an object indicating what type of
6
- * thing to render (e.g. text or line), where to render it, and any other style
7
- * properties needed.
8
- *
9
- * For instance, an oxygen atom might be rendered as
10
- * {type: "text", value: "O", pos: [0, 0], idx: "1,0"}
11
- */
12
- /**
13
- * Compute the layout for a single atom.
14
- *
15
- * Args:
16
- * atom: the atom node for which layout is being created, as returned from
17
- * convertTree; the computed position of this atom is added to this
18
- * object in place, in addition to being returned in the layout
19
- * instruction.
20
- * atoms: the list of all atoms, as returned from convertTree, used to
21
- * position this atom appropriately relative to its neighbors
22
- * bonds: the list of all bonds, as returned from convertTree, used to
23
- * determine the geometry based on bond type
24
- * rotationAngle: a constant rotation for the whole molecule (in degrees)
25
- *
26
- * Return:
27
- * a rendering instruction for the atom, containing a type (text), the text
28
- * to render, the position, and the atom index
29
- */
30
- declare function atomLayout(atom: any, atoms: any, bonds: ReadonlyArray<any>, rotationAngle: number): any;
31
- /**
32
- * Compute the layout for a bond between two atoms.
33
- *
34
- * Args:
35
- * bond: the bond node for which the layout is being computed, as returned
36
- * by convertTree
37
- * atoms: the list of all atoms returned by convertTree, which should
38
- * already have been processed for layout and thus have positions set
39
- *
40
- * Return:
41
- * a rendering instruction for the bond containing a type
42
- * (line:{single,double,triple}) and the line's endpoints
43
- */
44
- declare function bondLayout(bond: any, atoms: any): any;
45
- /**
46
- * Convert the parse tree output by the parser into an ordered list of atoms
47
- * and bonds to render.
48
- *
49
- * Args:
50
- * atoms: the output list of atoms that we're in the process of building.
51
- * This should be the empty list if not being called recursively.
52
- * bonds: the output list of bonds that we're in the process of building.
53
- * This should be the empty list if not being called recursively.
54
- * tree: the parse tree generated by the SMILES parser module.
55
- *
56
- * Return:
57
- * the final value of atoms and bonds, which are lists of all the atom
58
- * nodes and bond nodes, respectively, that need to be rendered.
59
- */
60
- declare function convertTree(atoms: any, bonds: any, tree: any): [any, any];
61
- /**
62
- * Compute an array of rendering instructions from the parse tree of a molecule.
63
- *
64
- * Args:
65
- * tree: the parse tree as returned by the SMILES parser module
66
- * rotationAngle: a global rotation (in degrees) to be applied to the whole
67
- * molecule; this is manually adjustable in the widget.
68
- *
69
- * Return:
70
- * an array of rendering instructions for all the atoms and bonds in the
71
- * molecule suitable for processing by the renderer
72
- */
73
- declare function layout(tree: any, rotationAngle: any): any;
74
- declare const _default: {
75
- layout: typeof layout;
76
- _atomLayout: typeof atomLayout;
77
- _bondLayout: typeof bondLayout;
78
- _bondLength: number;
79
- _convertTree: typeof convertTree;
80
- };
81
- export default _default;
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
- import type { Widget } from "../../types";
3
- import type { PerseusMoleculeRendererWidgetOptions } from "@khanacademy/perseus-core";
4
- type Props = {
5
- widgetId: PerseusMoleculeRendererWidgetOptions["widgetId"];
6
- smiles: PerseusMoleculeRendererWidgetOptions["smiles"];
7
- rotationAngle: PerseusMoleculeRendererWidgetOptions["rotationAngle"];
8
- };
9
- type DefaultProps = {
10
- rotationAngle: Props["rotationAngle"];
11
- };
12
- declare class MoleculeWidget extends React.Component<Props> implements Widget {
13
- static defaultProps: DefaultProps;
14
- isWidget: true;
15
- render(): React.ReactNode;
16
- }
17
- declare const _default: {
18
- name: string;
19
- displayName: string;
20
- hidden: true;
21
- widget: typeof MoleculeWidget;
22
- };
23
- export default _default;
@@ -1,19 +0,0 @@
1
- declare function ParseError(message: string): void;
2
- /**
3
- * Parse a SMILES string to an internal tree representation.
4
- *
5
- * Args:
6
- * smiles [string]: a string representing the molecule.
7
- *
8
- * Returns: the parse tree (see top-of file docstring for details).
9
- *
10
- * Throws:
11
- * ParseError: if the input is not valid SMILES or contains features not
12
- * yet implemented.
13
- */
14
- declare function parse(smiles: any, ctx: any): any;
15
- declare const _default: {
16
- parse: typeof parse;
17
- ParseError: typeof ParseError;
18
- };
19
- export default _default;