@khanacademy/perseus 92.0.2 → 93.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 (59) hide show
  1. package/dist/chunk-rolldown-runtime-DWWV-OC4.js +14 -0
  2. package/dist/components/button-group.d.ts +7 -7
  3. package/dist/components/drag-and-drop/answer-tile/answer-tile.d.ts +2 -1
  4. package/dist/components/drag-and-drop/answer-tile/index.d.ts +0 -1
  5. package/dist/components/drag-and-drop/blank/blank-component.d.ts +2 -1
  6. package/dist/components/drag-and-drop/blank/index.d.ts +0 -1
  7. package/dist/components/drag-and-drop/dnd-action-menu/index.d.ts +1 -1
  8. package/dist/index.css +2 -27
  9. package/dist/index.d.ts +5 -1
  10. package/dist/index.js +21508 -115
  11. package/dist/index.js.map +1 -1
  12. package/dist/renderer.d.ts +1 -0
  13. package/dist/server-item-renderer.d.ts +1 -9
  14. package/dist/strings.js +1021 -3
  15. package/dist/strings.js.map +1 -1
  16. package/dist/types.d.ts +1 -1
  17. package/dist/widgets/grapher/util.d.ts +6 -1
  18. package/dist/widgets/image/utils.d.ts +0 -55
  19. package/dist/widgets/input-number/input-number.d.ts +1 -1
  20. package/dist/widgets/interactive-graphs/graphs/components/movable-line/index.d.ts +0 -1
  21. package/dist/widgets/interactive-graphs/interactive-graph.d.ts +1 -1
  22. package/dist/widgets/mock-widgets/index.d.ts +0 -1
  23. package/dist/widgets/sorter/index.d.ts +2 -2
  24. package/dist/widgets/sorter/new/sorter.d.ts +6 -0
  25. package/dist/widgets/sorter/old/sorter.d.ts +16 -0
  26. package/dist/widgets/sorter/sorter.d.ts +2 -11
  27. package/package.json +50 -50
  28. package/dist/chunk-register-all-widgets-for-testing-BicV4HKq.js +0 -2105
  29. package/dist/chunk-register-all-widgets-for-testing-BicV4HKq.js.map +0 -1
  30. package/dist/index.css.map +0 -1
  31. package/dist/testing/article-renderer-with-debug-ui.d.ts +0 -17
  32. package/dist/testing/debug-accordion-ui.d.ts +0 -14
  33. package/dist/testing/debug-check-answer-footer.d.ts +0 -20
  34. package/dist/testing/extract-widget-ids-contract-tests.d.ts +0 -10
  35. package/dist/testing/feature-flags-context.d.ts +0 -7
  36. package/dist/testing/feature-flags-util.d.ts +0 -15
  37. package/dist/testing/image-loader-utils.d.ts +0 -9
  38. package/dist/testing/item-flipbook/item-flipbook-model.d.ts +0 -22
  39. package/dist/testing/item-flipbook/item-flipbook-view-model.d.ts +0 -57
  40. package/dist/testing/item-flipbook/item-flipbook-view.d.ts +0 -7
  41. package/dist/testing/item-flipbook/item-flipbook.d.ts +0 -2
  42. package/dist/testing/item-flipbook/safe-parse-perseus-item.d.ts +0 -2
  43. package/dist/testing/item-renderer-hooks.d.ts +0 -45
  44. package/dist/testing/item-renderer-reducer.d.ts +0 -39
  45. package/dist/testing/object-utils.d.ts +0 -1
  46. package/dist/testing/render-question-with-cypress.d.ts +0 -9
  47. package/dist/testing/server-item-renderer-with-debug-ui.d.ts +0 -17
  48. package/dist/testing/split-view.d.ts +0 -13
  49. package/dist/testing/storybook-view-options-context.d.ts +0 -7
  50. package/dist/testing/test-dependencies.d.ts +0 -6
  51. package/dist/testing/test-keypad-context-wrapper.d.ts +0 -10
  52. package/dist/testing/test-mathjax.d.ts +0 -10
  53. package/dist/testing/use-storybook-api-options.d.ts +0 -6
  54. package/dist/testing/user-input-ui.d.ts +0 -7
  55. package/dist/testing/wait.d.ts +0 -27
  56. package/dist/testing.d.ts +0 -5
  57. package/dist/testing.js +0 -68113
  58. package/dist/testing.js.map +0 -1
  59. package/dist/widgets/interactive-graphs/utils/point-labels/point-labels.d.ts +0 -2
@@ -1,39 +0,0 @@
1
- import type { PerseusItem, ShowSolutions, PerseusScore, UserInputMap } from "@khanacademy/perseus-core";
2
- export type ItemRendererState = {
3
- perseusItem: PerseusItem;
4
- originalItem: PerseusItem;
5
- answerless: boolean;
6
- score: PerseusScore | undefined;
7
- userInput: UserInputMap | undefined;
8
- showPopover: boolean;
9
- showSolutions: ShowSolutions | undefined;
10
- hintsVisible: number;
11
- key: number;
12
- reviewMode: boolean;
13
- };
14
- export type ItemRendererAction = {
15
- type: "UPDATE_ITEM";
16
- payload: PerseusItem;
17
- } | {
18
- type: "SET_SCORE";
19
- score: PerseusScore;
20
- userInput: UserInputMap;
21
- } | {
22
- type: "TOGGLE_POPOVER";
23
- payload: boolean;
24
- } | {
25
- type: "SET_SHOW_SOLUTIONS";
26
- payload: ShowSolutions | undefined;
27
- } | {
28
- type: "SET_HINTS_VISIBLE";
29
- payload: number;
30
- } | {
31
- type: "SET_ANSWERLESS";
32
- payload: boolean;
33
- } | {
34
- type: "RESET_STATE";
35
- } | {
36
- type: "SKIP_TO_SOLUTION";
37
- };
38
- export declare const createInitialState: (item: PerseusItem, reviewMode?: boolean, showSolutions?: ShowSolutions) => ItemRendererState;
39
- export declare const itemRendererReducer: (state: ItemRendererState, action: ItemRendererAction) => ItemRendererState;
@@ -1 +0,0 @@
1
- export declare const clone: <T>(obj: T) => T;
@@ -1,9 +0,0 @@
1
- import * as Perseus from "../index";
2
- import type { APIOptions } from "../types";
3
- import type { PerseusRenderer } from "@khanacademy/perseus-core";
4
- /**
5
- * Renders the given question using Cypress. Waits until all assets have been
6
- * "rendered/loaded" before it returns.
7
- */
8
- declare const renderQuestion: (question: PerseusRenderer, apiOptions?: APIOptions, reviewMode?: boolean) => (() => Perseus.Renderer);
9
- export default renderQuestion;
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
- import type { APIOptions } from "../types";
3
- import type { PerseusItem, ShowSolutions } from "@khanacademy/perseus-core";
4
- import type { LinterContextProps } from "@khanacademy/perseus-linter";
5
- type Props = {
6
- item: PerseusItem;
7
- apiOptions?: APIOptions;
8
- linterContext?: LinterContextProps;
9
- reviewMode?: boolean;
10
- showSolutions?: ShowSolutions;
11
- expanded?: boolean;
12
- };
13
- /**
14
- * ServerItemRendererWithDebugUI is a component that renders a Perseus item with debug UI controls
15
- */
16
- export declare const ServerItemRendererWithDebugUI: ({ item, apiOptions, linterContext, reviewMode, showSolutions, expanded, }: Props) => React.ReactElement;
17
- export {};
@@ -1,13 +0,0 @@
1
- import * as React from "react";
2
- type Props = {
3
- rendererTitle: React.ReactNode;
4
- renderer: React.ReactNode;
5
- JSONTitle?: string;
6
- jsonObject: any;
7
- };
8
- /**
9
- * This component is used in Storybook to render both the renderer and the JSON object in a split view.
10
- * Currently, the renderer is displayed above the JSON object.
11
- */
12
- declare const SplitView: ({ rendererTitle, renderer, JSONTitle, jsonObject, }: Props) => React.ReactElement;
13
- export default SplitView;
@@ -1,7 +0,0 @@
1
- import * as React from "react";
2
- type StorybookViewOptions = {
3
- isMobile: boolean | undefined;
4
- isRtl: boolean;
5
- };
6
- export declare const StorybookViewOptionsContext: React.Context<StorybookViewOptions>;
7
- export {};
@@ -1,6 +0,0 @@
1
- import type { PerseusDependencies, PerseusDependenciesV2 } from "../types";
2
- export declare const testDependencies: PerseusDependencies;
3
- export declare const testDependenciesV2: PerseusDependenciesV2;
4
- export declare const storybookDependenciesV2: PerseusDependenciesV2;
5
- export declare const cypressTestDependencies: PerseusDependencies;
6
- export declare const cypressDependenciesV2: PerseusDependenciesV2;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- type Props = {
3
- children: React.ReactElement;
4
- /**
5
- * Whether we need to offset the keypad to account for the footer.
6
- */
7
- hasFooter?: boolean;
8
- };
9
- declare const TestKeypadContextWrapper: ({ children, hasFooter, }: Props) => React.ReactElement;
10
- export default TestKeypadContextWrapper;
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import "@khanacademy/mathjax-renderer/src/css/mathjax.css";
3
- import "@khanacademy/mathjax-renderer/src/css/safari-hacks.css";
4
- import "@khanacademy/mathjax-renderer/src/css/selectable.css";
5
- type Props = {
6
- children: string;
7
- onRender?: (root?: any) => unknown;
8
- };
9
- export declare function TestMathjax({ children: tex, onRender }: Props): React.JSX.Element;
10
- export {};
@@ -1,6 +0,0 @@
1
- import type { APIOptions } from "../types";
2
- /**
3
- * Merges the active Storybook feature flags (from the toolbar) into the given
4
- * apiOptions. Story-level flags take priority over toolbar-level flags.
5
- */
6
- export declare function useStorybookApiOptions(apiOptions?: APIOptions): APIOptions;
@@ -1,7 +0,0 @@
1
- import * as React from "react";
2
- import type { UserInputMap } from "@khanacademy/perseus-core";
3
- type Props = {
4
- userInput: UserInputMap;
5
- };
6
- export default function UserInputUI({ userInput }: Props): React.JSX.Element;
7
- export {};
@@ -1,27 +0,0 @@
1
- type WaitOptions = {
2
- /**
3
- * The time in milliseconds to wait on each wait.
4
- * Defaults to 0. Any number less than 0 will be treated as 0.
5
- */
6
- delay?: number;
7
- /**
8
- * The number of times to wait.
9
- * Defaults to 1. Any number below 1 will be treated as 1.
10
- */
11
- count?: number;
12
- };
13
- /**
14
- * Wait for the given delay as many times as indicated.
15
- *
16
- * This will throw if jest.useRealTimers() is not used.
17
- */
18
- export declare const wait: (options?: WaitOptions) => Promise<void>;
19
- /**
20
- * Waits for the initial Graphie render.
21
- *
22
- * @returns a Promise<void> that resolves when the Graphie graph has renderred.
23
- * The behaviour is undefined if there are multiple Graphies on the page (which
24
- * is unlikely in tests).
25
- */
26
- export declare function waitForInitialGraphieRender(): Promise<void>;
27
- export {};
package/dist/testing.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Entry-point for tools to support testing
3
- */
4
- export { testDependenciesV2 } from "./testing/test-dependencies";
5
- export { default as SplitView } from "./testing/split-view";