@khanacademy/perseus-editor 38.1.3 → 40.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 (46) hide show
  1. package/dist/all-editors.d.ts +49 -9
  2. package/dist/article-editor.d.ts +2 -1
  3. package/dist/components/util.d.ts +0 -1
  4. package/dist/components/widget-editor.d.ts +1 -1
  5. package/dist/es/index.js +135 -140
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/{item-extras-editor.d.ts → extras-editor.d.ts} +2 -2
  8. package/dist/index.js +134 -139
  9. package/dist/index.js.map +1 -1
  10. package/dist/item-editor.d.ts +3 -3
  11. package/dist/styles/global-colors.d.ts +0 -5
  12. package/dist/testing/feature-flags-util.d.ts +2 -0
  13. package/dist/widgets/categorizer-editor/categorizer-editor.d.ts +0 -1
  14. package/dist/widgets/cs-program-editor/cs-program-editor.d.ts +0 -1
  15. package/dist/widgets/definition-editor/definition-editor.d.ts +0 -1
  16. package/dist/widgets/deprecated-standin-editor/deprecated-standin-editor.d.ts +0 -1
  17. package/dist/widgets/dropdown-editor/dropdown-editor.d.ts +0 -1
  18. package/dist/widgets/explanation-editor/explanation-editor.d.ts +0 -1
  19. package/dist/widgets/expression-editor/expression-editor.d.ts +0 -1
  20. package/dist/widgets/free-response-editor/free-response-editor.d.ts +0 -1
  21. package/dist/widgets/graded-group-editor/graded-group-editor.d.ts +0 -1
  22. package/dist/widgets/graded-group-set-editor/graded-group-set-editor.d.ts +0 -1
  23. package/dist/widgets/grapher-editor/grapher-editor.d.ts +0 -1
  24. package/dist/widgets/group-editor/group-editor.d.ts +0 -1
  25. package/dist/widgets/iframe-editor/iframe-editor.d.ts +0 -1
  26. package/dist/widgets/image-editor/image-editor.d.ts +0 -1
  27. package/dist/widgets/input-number-editor/input-number-editor.d.ts +0 -1
  28. package/dist/widgets/interaction-editor/interaction-editor.d.ts +0 -1
  29. package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +62 -29
  30. package/dist/widgets/label-image-editor/label-image-editor.d.ts +0 -1
  31. package/dist/widgets/label-image-editor/marker.d.ts +5 -19
  32. package/dist/widgets/matcher-editor/matcher-editor.d.ts +0 -1
  33. package/dist/widgets/matrix-editor/matrix-editor.d.ts +0 -1
  34. package/dist/widgets/measurer-editor/measurer-editor.d.ts +0 -1
  35. package/dist/widgets/number-line-editor/number-line-editor.d.ts +0 -1
  36. package/dist/widgets/numeric-input-editor/numeric-input-editor.d.ts +0 -1
  37. package/dist/widgets/orderer-editor/orderer-editor.d.ts +0 -1
  38. package/dist/widgets/phet-simulation-editor/phet-simulation-editor.d.ts +0 -1
  39. package/dist/widgets/plotter-editor/plotter-editor.d.ts +0 -1
  40. package/dist/widgets/python-program-editor/python-program-editor.d.ts +0 -1
  41. package/dist/widgets/radio-editor/radio-editor.d.ts +0 -1
  42. package/dist/widgets/sorter-editor/sorter-editor.d.ts +0 -1
  43. package/dist/widgets/table-editor/table-editor.d.ts +0 -1
  44. package/dist/widgets/video-editor/video-editor.d.ts +0 -1
  45. package/package.json +13 -11
  46. package/dist/components/dropdown-option.d.ts +0 -31
@@ -12,6 +12,7 @@ import GrapherEditor from "./widgets/grapher-editor";
12
12
  import GroupEditor from "./widgets/group-editor";
13
13
  import IframeEditor from "./widgets/iframe-editor";
14
14
  import ImageEditor from "./widgets/image-editor";
15
+ import InputNumberEditor from "./widgets/input-number-editor";
15
16
  import InteractionEditor from "./widgets/interaction-editor";
16
17
  import InteractiveGraphEditor from "./widgets/interactive-graph-editor";
17
18
  import LabelImageEditor from "./widgets/label-image-editor";
@@ -27,13 +28,52 @@ import PythonProgramEditor from "./widgets/python-program-editor";
27
28
  import RadioEditor from "./widgets/radio-editor";
28
29
  import TableEditor from "./widgets/table-editor";
29
30
  import VideoEditor from "./widgets/video-editor";
30
- declare const _default: (typeof CategorizerEditor | typeof CSProgramEditor | typeof DefinitionEditor | typeof DeprecatedStandinEditor | typeof DropdownEditor | typeof ExplanationEditor | typeof ExpressionEditor | typeof FreeResponseEditor | typeof GradedGroupEditor | typeof GradedGroupSetEditor | typeof GrapherEditor | typeof GroupEditor | typeof IframeEditor | typeof ImageEditor | typeof NumericInputEditor | typeof InteractionEditor | typeof InteractiveGraphEditor | typeof LabelImageEditor | typeof MatcherEditor | typeof MatrixEditor | typeof MeasurerEditor | typeof NumberLineEditor | typeof OrdererEditor | typeof PhetSimulationEditor | typeof PlotterEditor | typeof PythonProgramEditor | typeof RadioEditor | (import("react").ForwardRefExoticComponent<import("@khanacademy/perseus-core").PerseusSorterWidgetOptions & {
31
- onChange: (newOptions: Partial<import("@khanacademy/perseus-core").PerseusSorterWidgetOptions>, callback?: () => void) => void;
32
- } & import("react").RefAttributes<{
33
- serialize: () => import("@khanacademy/perseus-core").PerseusSorterWidgetOptions;
34
- getSaveWarnings: () => string[];
35
- }>> & {
36
- widgetName: "sorter";
37
- defaultProps: import("@khanacademy/perseus-core").PerseusSorterWidgetOptions;
38
- }) | typeof TableEditor | typeof VideoEditor)[];
31
+ /**
32
+ * Every widget editor, keyed by the type of widget it edits.
33
+ *
34
+ * The keys are widget types as they appear in Perseus content (eg. the
35
+ * `interactive-graph` in the widget's `type`. `Widgets.registerEditors`
36
+ * registers each editor under its key, and the editor page looks an editor up by
37
+ * the type of the widget it's rendering.
38
+ */
39
+ declare const _default: {
40
+ categorizer: typeof CategorizerEditor;
41
+ "cs-program": typeof CSProgramEditor;
42
+ definition: typeof DefinitionEditor;
43
+ "deprecated-standin": typeof DeprecatedStandinEditor;
44
+ dropdown: typeof DropdownEditor;
45
+ explanation: typeof ExplanationEditor;
46
+ expression: typeof ExpressionEditor;
47
+ "free-response": typeof FreeResponseEditor;
48
+ "graded-group": typeof GradedGroupEditor;
49
+ "graded-group-set": typeof GradedGroupSetEditor;
50
+ grapher: typeof GrapherEditor;
51
+ group: typeof GroupEditor;
52
+ iframe: typeof IframeEditor;
53
+ image: typeof ImageEditor;
54
+ "input-number": typeof InputNumberEditor;
55
+ interaction: typeof InteractionEditor;
56
+ "interactive-graph": typeof InteractiveGraphEditor;
57
+ "label-image": typeof LabelImageEditor;
58
+ matcher: typeof MatcherEditor;
59
+ matrix: typeof MatrixEditor;
60
+ measurer: typeof MeasurerEditor;
61
+ "number-line": typeof NumberLineEditor;
62
+ "numeric-input": typeof NumericInputEditor;
63
+ orderer: typeof OrdererEditor;
64
+ "phet-simulation": typeof PhetSimulationEditor;
65
+ plotter: typeof PlotterEditor;
66
+ "python-program": typeof PythonProgramEditor;
67
+ radio: typeof RadioEditor;
68
+ sorter: import("react").ForwardRefExoticComponent<import("@khanacademy/perseus-core").PerseusSorterWidgetOptions & {
69
+ onChange: (newOptions: Partial<import("@khanacademy/perseus-core").PerseusSorterWidgetOptions>, callback?: () => void) => void;
70
+ } & import("react").RefAttributes<{
71
+ serialize: () => import("@khanacademy/perseus-core").PerseusSorterWidgetOptions;
72
+ getSaveWarnings: () => string[];
73
+ }>> & {
74
+ defaultProps: import("@khanacademy/perseus-core").PerseusSorterWidgetOptions;
75
+ };
76
+ table: typeof TableEditor;
77
+ video: typeof VideoEditor;
78
+ };
39
79
  export default _default;
@@ -43,6 +43,7 @@ export default class ArticleEditor extends React.Component<Props, State> {
43
43
  isArticle?: boolean;
44
44
  onFocusChange?: (newFocusPath: import("@khanacademy/perseus").FocusPath, oldFocusPath: import("@khanacademy/perseus").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
45
45
  showAlignmentOptions?: boolean;
46
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
46
47
  readOnly?: boolean;
47
48
  editingDisabled?: boolean;
48
49
  answerableCallback?: (arg1: boolean) => unknown;
@@ -66,7 +67,7 @@ export default class ArticleEditor extends React.Component<Props, State> {
66
67
  isMobile?: boolean;
67
68
  isMobileApp?: boolean;
68
69
  hintProgressColor?: string;
69
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
70
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
70
71
  }>;
71
72
  linterContext: {
72
73
  contentType: string;
@@ -1,5 +1,4 @@
1
1
  import type { Alignment } from "@khanacademy/perseus-core";
2
- export declare function focusWithChromeStickyFocusBugWorkaround(element: Element): void;
3
2
  /**
4
3
  * Map of alignment values to their corresponding human-readable descriptions.
5
4
  * Only includes alignments that show up in the widget select (i.e. occur
@@ -28,7 +28,7 @@ declare class WidgetEditor extends React.Component<Props, State> {
28
28
  _handleAlignmentChange: (newAlignment: Alignment) => void;
29
29
  getSaveWarnings: () => unknown;
30
30
  serialize: () => {
31
- type: "iframe" | "table" | "video" | "image" | "radio" | "categorizer" | "definition" | "group" | "cs-program" | "blank" | "dropdown" | "explanation" | "expression" | "free-response" | "grapher" | "graded-group-set" | "graded-group" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "number-line" | "numeric-input" | "orderer" | "phet-simulation" | "python-program" | "plotter" | "sorter" | "mock-widget" | "deprecated-standin";
31
+ type: "iframe" | "table" | "video" | "image" | "radio" | "definition" | "group" | "blank" | "categorizer" | "cs-program" | "dropdown" | "explanation" | "expression" | "free-response" | "grapher" | "graded-group-set" | "graded-group" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "number-line" | "numeric-input" | "orderer" | "phet-simulation" | "python-program" | "plotter" | "sorter" | "mock-widget" | "deprecated-standin";
32
32
  alignment: Alignment | undefined;
33
33
  static: boolean | undefined;
34
34
  graded: boolean | undefined;