@khanacademy/perseus 90.1.0 → 90.2.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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { B as ButtonGroup, G as Graphie, H as HUD, I as Icon, a as InlineIcon, M as MathInput, b as MultiButtonGroup, N as NumberInput, R as RangeInput, S as SvgImage, T as TextInput, r as registerWidgets, c as basicWidgets, e as extraWidgets, d as replaceDeprecatedWidgets, P as PerseusI18nContext, A as ApiOptions, C as ClassNames, j as jsxRuntimeExports, U as UserInputManager, f as Renderer, D as DependenciesContext, g as Util, h as getDependencies, J as JiptParagraphs, i as hintPaddingInlineStart, k as hintBorderWidth, m as mediaQueries, s as sharedStyles, l as context$1, n as getWidgetTypeByWidgetId, o as getWidgetExport, p as PerseusMarkdown, t as typeToButton, q as getEquationString, u as defaultPlotProps, v as chooseType, w as DEFAULT_GRAPHER_PROPS } from './chunk-register-all-widgets-for-testing-B94oNv6V.js';
2
- export { L as Categorizer, $ as Dependencies, E as Expression, X as GrapherWidget, z as InputNumber, O as InteractiveGraphWidget, a5 as KhanColors, a0 as Log, a1 as MathRenderingContext, Q as MatrixWidget, F as NumericInput, a3 as PerseusI18nContextProvider, W as PlotterWidget, K as Radio, V as TableWidget, x as Widgets, _ as bodyXsmallBold, a8 as containerSizeClass, ac as contentHasWidgetType, at as deriveUserInputFromSerializedState, af as getAbsoluteValueCoords, as as getAngleCoords, ag as getCircleCoords, ah as getExponentialCoords, a9 as getInteractiveBoxFromSizeClass, aj as getLineCoords, ak as getLinearSystemCoords, ai as getLogarithmCoords, al as getPointCoords, am as getPolygonCoords, ar as getQuadraticCoords, an as getSegmentCoords, ao as getSinusoidCoords, ap as getTangentCoords, aq as getVectorCoords, ad as getWidgetFromWidgetMap, ab as getWidgetSubTypeByWidgetId, ae as getWidgetsFromWidgetMap, Y as iconChevronDown, Z as iconTrash, a2 as interactiveSizes, aa as mathOnlyParser, au as parseDataFromJSONP, a6 as preprocessTex, a7 as registerAllWidgetsForTesting, a4 as usePerseusI18n, y as widgets } from './chunk-register-all-widgets-for-testing-B94oNv6V.js';
1
+ import { B as ButtonGroup, G as Graphie, H as HUD, I as Icon, a as InlineIcon, M as MathInput, b as MultiButtonGroup, N as NumberInput, R as RangeInput, S as SvgImage, T as TextInput, r as registerWidgets, c as basicWidgets, e as extraWidgets, d as replaceDeprecatedWidgets, P as PerseusI18nContext, A as ApiOptions, C as ClassNames, j as jsxRuntimeExports, U as UserInputManager, f as Renderer, D as DependenciesContext, g as Util, h as getDependencies, J as JiptParagraphs, i as hintPaddingInlineStart, k as hintBorderWidth, m as mediaQueries, s as sharedStyles, l as context$1, n as getWidgetTypeByWidgetId, o as getWidgetExport, p as PerseusMarkdown, t as typeToButton, q as getEquationString, u as defaultPlotProps, v as chooseType, w as DEFAULT_GRAPHER_PROPS } from './chunk-register-all-widgets-for-testing-BOJFm0ap.js';
2
+ export { L as Categorizer, $ as Dependencies, E as Expression, X as GrapherWidget, z as InputNumber, O as InteractiveGraphWidget, a5 as KhanColors, a0 as Log, a1 as MathRenderingContext, Q as MatrixWidget, F as NumericInput, a3 as PerseusI18nContextProvider, W as PlotterWidget, K as Radio, V as TableWidget, x as Widgets, _ as bodyXsmallBold, a8 as containerSizeClass, ac as contentHasWidgetType, at as deriveUserInputFromSerializedState, af as getAbsoluteValueCoords, as as getAngleCoords, ag as getCircleCoords, ah as getExponentialCoords, a9 as getInteractiveBoxFromSizeClass, aj as getLineCoords, ak as getLinearSystemCoords, ai as getLogarithmCoords, al as getPointCoords, am as getPolygonCoords, ar as getQuadraticCoords, an as getSegmentCoords, ao as getSinusoidCoords, ap as getTangentCoords, aq as getVectorCoords, ad as getWidgetFromWidgetMap, ab as getWidgetSubTypeByWidgetId, ae as getWidgetsFromWidgetMap, Y as iconChevronDown, Z as iconTrash, a2 as interactiveSizes, aa as mathOnlyParser, au as parseDataFromJSONP, a6 as preprocessTex, a7 as registerAllWidgetsForTesting, a4 as usePerseusI18n, y as widgets } from './chunk-register-all-widgets-for-testing-BOJFm0ap.js';
3
3
  import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
4
4
  import * as React from 'react';
5
5
  import { createElement } from 'react';
@@ -86,7 +86,7 @@ var components = /*#__PURE__*/Object.freeze({
86
86
 
87
87
  const init=function(){registerWidgets(basicWidgets);registerWidgets(extraWidgets);replaceDeprecatedWidgets();};
88
88
 
89
- const libName="@khanacademy/perseus";const libVersion="90.1.0";addLibraryVersionToPerseusDebug(libName,libVersion);
89
+ const libName="@khanacademy/perseus";const libVersion="90.2.0";addLibraryVersionToPerseusDebug(libName,libVersion);
90
90
 
91
91
  const apiVersion={major:12,minor:0};
92
92
 
@@ -4,6 +4,7 @@ type Props = {
4
4
  translationIndex?: number;
5
5
  paragraphIndex?: number;
6
6
  children?: React.ReactNode;
7
+ inline?: boolean;
7
8
  };
8
- declare const QuestionParagraph: ({ className, translationIndex, paragraphIndex, children, }: Props) => React.ReactNode;
9
+ declare const QuestionParagraph: (props: Props) => React.ReactNode;
9
10
  export default QuestionParagraph;
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a7 as registerAllWidgetsForTesting, j as jsxRuntimeExports } from './chunk-register-all-widgets-for-testing-B94oNv6V.js';
1
+ import { a7 as registerAllWidgetsForTesting, j as jsxRuntimeExports } from './chunk-register-all-widgets-for-testing-BOJFm0ap.js';
2
2
  import React__default from 'react';
3
3
  import { View } from '@khanacademy/wonder-blocks-core';
4
4
  import { spacing } from '@khanacademy/wonder-blocks-tokens';
package/dist/util.d.ts CHANGED
@@ -35,6 +35,7 @@ type TouchHandlers = {
35
35
  * arrays of strings.
36
36
  */
37
37
  declare function inputPathsEqual(a?: ReadonlyArray<string> | null, b?: ReadonlyArray<string> | null): boolean;
38
+ export declare const isContentGraphie: (node: SingleASTNode) => boolean;
38
39
  /**
39
40
  * Some widgets render as inline content but CANNOT safely live
40
41
  * inside a paragraph (`<p>`). When this function returns true, the
@@ -1,110 +1,16 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  import type { MockWidgetOptions } from "./mock-widget-types";
3
3
  import type { WidgetProps, Widget } from "../../types";
4
- import type { MockWidgetPromptJSON } from "../../widget-ai-utils/mock-widget/prompt-utils";
5
4
  import type { PerseusMockWidgetUserInput } from "@khanacademy/perseus-score";
6
5
  type ExternalProps = WidgetProps<MockWidgetOptions, PerseusMockWidgetUserInput>;
7
- type Props = ExternalProps;
8
- /**
9
- * This is a Mock Perseus widget, which is used for our various rendering tests
10
- * both internally and in consuming projects. It is a simple widget that renders
11
- * an interactable input field, and allows the user to input a string value.
12
- *
13
- * Please use this widget for all tests that are not specifically testing the
14
- * functionality of a particular widget, such as testing the rendering components.
15
- * This allows us to more easily update our widget schemas and behaviour without needing to
16
- * update many different irrelevant tests across our codebases.
17
- *
18
- * You can register this widget for your tests by calling `registerWidget("mock-widget", MockWidget);`
19
- */
20
- declare class MockWidgetComponent extends React.Component<Props> implements Widget {
21
- inputRef: HTMLElement | null;
22
- getPromptJSON(): MockWidgetPromptJSON;
23
- focus: () => boolean;
24
- focusInputPath: () => void;
25
- blurInputPath: () => void;
26
- getInputPaths: () => ReadonlyArray<ReadonlyArray<string>>;
27
- handleChange: (newValue: string, cb?: () => unknown | null | undefined) => void;
28
- /**
29
- * @deprecated and likely very broken API
30
- * [LEMS-3185] do not trust serializedState
31
- */
32
- getSerializedState(): {
33
- currentValue: string;
34
- trackInteraction: (extraData?: Empty | undefined) => void;
35
- widgetId: string;
36
- widgetIndex: number;
37
- alignment: import("@khanacademy/perseus-core").Alignment | null | undefined;
38
- static: boolean | null | undefined;
39
- graded?: boolean | null;
40
- problemNum: number | null | undefined;
41
- apiOptions: Readonly<Readonly<{
42
- isArticle?: boolean;
43
- onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
44
- showAlignmentOptions?: boolean;
45
- renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
46
- readOnly?: boolean;
47
- editingDisabled?: boolean;
48
- answerableCallback?: (arg1: boolean) => unknown;
49
- getAnotherHint?: () => unknown;
50
- interactionCallback?: (widgetData: {
51
- [widgetId: string]: any;
52
- }) => void;
53
- imagePlaceholder?: React.ReactNode;
54
- widgetPlaceholder?: React.ReactNode;
55
- baseElements?: {
56
- Link: React.ComponentType<any>;
57
- };
58
- trackInteraction?: (args: {
59
- type: string;
60
- id: string;
61
- correct?: boolean;
62
- } & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
63
- visible: number;
64
- }>) => void;
65
- customKeypad?: boolean;
66
- isMobile?: boolean;
67
- isMobileApp?: boolean;
68
- hintProgressColor?: string;
69
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras" | "dnd-widget-fitb", boolean>;
70
- }> & {
71
- baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
72
- isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
73
- isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
74
- isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
75
- editingDisabled: NonNullable<import("../..").APIOptions["editingDisabled"]>;
76
- onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
77
- readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
78
- showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
79
- }>;
80
- keypadElement?: any;
81
- onFocus: (blurPath: import("../..").FocusPath) => void;
82
- onBlur: (blurPath: import("../..").FocusPath) => void;
83
- findWidgets: import("../../types").FindWidgetsFunction;
84
- reviewMode: boolean;
85
- isScorable: boolean;
86
- showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
87
- handleUserInput: (newUserInput: PerseusMockWidgetUserInput, cb?: () => void, silent?: boolean) => void;
88
- linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
89
- containerSizeClass: import("../../util/sizing-utils").SizeClass;
90
- value: string;
91
- };
92
- render(): React.ReactNode;
93
- }
94
- /**
95
- * @deprecated and likely a very broken API
96
- * [LEMS-3185] do not trust serializedState
97
- */
98
- declare function getUserInputFromSerializedState(serializedState: any): PerseusMockWidgetUserInput;
99
- declare function getStartUserInput(options: PerseusMockWidgetUserInput): {
6
+ declare function getStartUserInput(): {
100
7
  currentValue: string;
101
8
  };
102
9
  declare const _default: {
103
10
  name: string;
104
11
  displayName: string;
105
- widget: typeof MockWidgetComponent;
12
+ widget: React.ForwardRefExoticComponent<ExternalProps & React.RefAttributes<Widget>>;
106
13
  isLintable: true;
107
14
  getStartUserInput: typeof getStartUserInput;
108
- getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
109
15
  };
110
16
  export default _default;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core Perseus API (includes renderers and widgets)",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "90.1.0",
6
+ "version": "90.2.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -34,13 +34,13 @@
34
34
  "mafs": "0.19.0",
35
35
  "tiny-invariant": "1.3.1",
36
36
  "uuid": "^10.0.0",
37
- "@khanacademy/keypad-context": "6.0.2",
38
- "@khanacademy/kmath": "3.0.3",
39
- "@khanacademy/perseus-core": "41.0.0",
40
- "@khanacademy/math-input": "30.0.3",
41
37
  "@khanacademy/kas": "3.0.0",
42
- "@khanacademy/perseus-linter": "6.1.0",
43
- "@khanacademy/perseus-score": "9.0.3",
38
+ "@khanacademy/keypad-context": "6.0.3",
39
+ "@khanacademy/kmath": "3.0.4",
40
+ "@khanacademy/math-input": "30.0.4",
41
+ "@khanacademy/perseus-core": "41.1.0",
42
+ "@khanacademy/perseus-linter": "6.1.1",
43
+ "@khanacademy/perseus-score": "9.0.4",
44
44
  "@khanacademy/perseus-utils": "3.0.0",
45
45
  "@khanacademy/pure-markdown": "3.0.0",
46
46
  "@khanacademy/simple-markdown": "4.0.0"