diff --git a/.changeset/rich-lizards-rule.md b/.changeset/rich-lizards-rule.md new file mode 100644 index 0000000000..73e0627ef2 --- /dev/null +++ b/.changeset/rich-lizards-rule.md @@ -0,0 +1,6 @@ +--- +"@khanacademy/perseus": major +"@khanacademy/perseus-editor": patch +--- + +Scope exports from grapher's util diff --git a/packages/perseus-editor/src/widgets/grapher-editor.tsx b/packages/perseus-editor/src/widgets/grapher-editor.tsx index f6a56194b4..471f7b0de7 100644 --- a/packages/perseus-editor/src/widgets/grapher-editor.tsx +++ b/packages/perseus-editor/src/widgets/grapher-editor.tsx @@ -2,9 +2,14 @@ import { components, Changeable, - GrapherUtil, GrapherWidget, SizingUtils, + DEFAULT_GRAPHER_PROPS, + chooseType, + defaultPlotProps, + getEquationString, + allTypes, + typeToButton, } from "@khanacademy/perseus"; import * as React from "react"; import _ from "underscore"; @@ -14,14 +19,6 @@ import GraphSettings from "../components/graph-settings"; const {InfoTip, MultiButtonGroup} = components; const {containerSizeClass, getInteractiveBoxFromSizeClass} = SizingUtils; const Grapher = GrapherWidget.widget; -const { - DEFAULT_GRAPHER_PROPS, - allTypes, - chooseType, - defaultPlotProps, - getEquationString, - typeToButton, -} = GrapherUtil; type Props = any; diff --git a/packages/perseus/src/index.ts b/packages/perseus/src/index.ts index fe3f336f43..7fad81a6fa 100644 --- a/packages/perseus/src/index.ts +++ b/packages/perseus/src/index.ts @@ -36,7 +36,14 @@ export {default as TableWidget} from "./widgets/table"; export {default as PlotterWidget} from "./widgets/plotter"; export {default as GrapherWidget} from "./widgets/grapher"; -export * as GrapherUtil from "./widgets/grapher/util"; +export { + allTypes, + DEFAULT_GRAPHER_PROPS, + chooseType, + defaultPlotProps, + getEquationString, + typeToButton, +} from "./widgets/grapher/util"; /** * Misc diff --git a/packages/perseus/src/widgets/grapher/util.tsx b/packages/perseus/src/widgets/grapher/util.tsx index c077e438bd..fa3a684e58 100644 --- a/packages/perseus/src/widgets/grapher/util.tsx +++ b/packages/perseus/src/widgets/grapher/util.tsx @@ -22,7 +22,7 @@ import type {Coord} from "../../interactive2/types"; // @ts-expect-error - TS2339 - Property 'Plot' does not exist on type 'typeof Graphie'. const Plot = Graphie.Plot; -export const DEFAULT_BACKGROUND_IMAGE = { +const DEFAULT_BACKGROUND_IMAGE = { url: null, } as const; @@ -663,7 +663,7 @@ export const getEquationString = (props: any): string => { return ""; }; -export const pointsFromNormalized = ( +const pointsFromNormalized = ( coordsList: ReadonlyArray, range: [Coord, Coord], step: [number, number],