@khanacademy/perseus 85.1.3 → 85.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.
@@ -105,6 +105,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<Pick<SharedRenderer
105
105
  isArticle?: boolean;
106
106
  onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
107
107
  showAlignmentOptions?: boolean;
108
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
108
109
  readOnly?: boolean;
109
110
  editingDisabled?: boolean;
110
111
  answerableCallback?: (arg1: boolean) => unknown;
@@ -128,7 +129,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<Pick<SharedRenderer
128
129
  isMobile?: boolean;
129
130
  isMobileApp?: boolean;
130
131
  hintProgressColor?: string;
131
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
132
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
132
133
  }> | undefined;
133
134
  linterContext?: PerseusLinter.LinterContextProps | undefined;
134
135
  onRendered?: ((isRendered: boolean) => void) | undefined;
@@ -7,6 +7,7 @@ declare const DEFAULT_FEATURE_FLAGS: Record<"perseus-test-flag-1" | "perseus-tes
7
7
  export declare function getFeatureFlags(overrides?: Partial<typeof DEFAULT_FEATURE_FLAGS>): {
8
8
  "perseus-renderer-upgrade": boolean;
9
9
  "desmos-calculator": boolean;
10
+ "article-extras": boolean;
10
11
  "perseus-test-flag-1": boolean;
11
12
  "perseus-test-flag-2": boolean;
12
13
  };
@@ -16,6 +16,7 @@ export declare const useItemRenderer: (item: PerseusItem, apiOptions?: APIOption
16
16
  isArticle?: boolean;
17
17
  onFocusChange?: (newFocusPath: import("..").FocusPath, oldFocusPath: import("..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
18
18
  showAlignmentOptions?: boolean;
19
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
19
20
  readOnly?: boolean;
20
21
  editingDisabled?: boolean;
21
22
  answerableCallback?: (arg1: boolean) => unknown;
@@ -34,7 +35,7 @@ export declare const useItemRenderer: (item: PerseusItem, apiOptions?: APIOption
34
35
  }>) => void;
35
36
  isMobileApp?: boolean;
36
37
  hintProgressColor?: string;
37
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
38
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
38
39
  };
39
40
  toggleMobile: (isMobile: boolean) => void;
40
41
  toggleRtl: (isRtl: boolean) => void;
package/dist/types.d.ts CHANGED
@@ -104,6 +104,7 @@ export type APIOptions = Readonly<{
104
104
  isArticle?: boolean;
105
105
  onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
106
106
  showAlignmentOptions?: boolean;
107
+ renderExtras?: (answerArea: PerseusAnswerArea, widgetId: string) => React.ReactNode;
107
108
  /**
108
109
  * A boolean that indicates whether the associated problem has been
109
110
  * answered correctly and should no longer be interactive.
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  isArticle?: boolean;
22
22
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
23
23
  showAlignmentOptions?: boolean;
24
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
24
25
  readOnly?: boolean;
25
26
  editingDisabled?: boolean;
26
27
  answerableCallback?: (arg1: boolean) => unknown;
@@ -44,7 +45,7 @@ declare const _default: {
44
45
  isMobile?: boolean;
45
46
  isMobileApp?: boolean;
46
47
  hintProgressColor?: string;
47
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
48
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
48
49
  }> & {
49
50
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
50
51
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
@@ -30,6 +30,7 @@ declare class InteractiveGraph extends React.Component<Props> {
30
30
  isArticle?: boolean;
31
31
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
32
32
  showAlignmentOptions?: boolean;
33
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
33
34
  readOnly?: boolean;
34
35
  editingDisabled?: boolean;
35
36
  answerableCallback?: (arg1: boolean) => unknown;
@@ -53,7 +54,7 @@ declare class InteractiveGraph extends React.Component<Props> {
53
54
  isMobile?: boolean;
54
55
  isMobileApp?: boolean;
55
56
  hintProgressColor?: string;
56
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
57
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
57
58
  }> & {
58
59
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
59
60
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
@@ -42,6 +42,7 @@ declare class MockWidgetComponent extends React.Component<Props> implements Widg
42
42
  isArticle?: boolean;
43
43
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
44
44
  showAlignmentOptions?: boolean;
45
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
45
46
  readOnly?: boolean;
46
47
  editingDisabled?: boolean;
47
48
  answerableCallback?: (arg1: boolean) => unknown;
@@ -65,7 +66,7 @@ declare class MockWidgetComponent extends React.Component<Props> implements Widg
65
66
  isMobile?: boolean;
66
67
  isMobileApp?: boolean;
67
68
  hintProgressColor?: string;
68
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
69
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
69
70
  }> & {
70
71
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
71
72
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  isArticle?: boolean;
22
22
  onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
23
23
  showAlignmentOptions?: boolean;
24
+ renderExtras?: (answerArea: import("@khanacademy/perseus-core").PerseusAnswerArea, widgetId: string) => React.ReactNode;
24
25
  readOnly?: boolean;
25
26
  editingDisabled?: boolean;
26
27
  answerableCallback?: (arg1: boolean) => unknown;
@@ -44,7 +45,7 @@ declare const _default: {
44
45
  isMobile?: boolean;
45
46
  isMobileApp?: boolean;
46
47
  hintProgressColor?: string;
47
- flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
48
+ flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator" | "article-extras", boolean>;
48
49
  }> & {
49
50
  baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
50
51
  isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
package/dist/widgets.d.ts CHANGED
@@ -13,7 +13,13 @@ export declare const registerWidgets: (widgetArr: ReadonlyArray<WidgetExports>)
13
13
  */
14
14
  export declare const replaceWidget: (type: string, replacementType: string) => void;
15
15
  export declare const replaceDeprecatedWidgets: () => void;
16
- export declare const registerEditors: (editorsToRegister: ReadonlyArray<Editor>) => void;
16
+ /**
17
+ * Register widget editors, keyed by the type of widget each one edits.
18
+ *
19
+ * The keys are widget types as they appear in Perseus content (eg. `radio`),
20
+ * which is what `getEditor` looks up when the editor page renders a widget.
21
+ */
22
+ export declare const registerEditors: (editorsToRegister: Record<string, Editor>) => void;
17
23
  /**
18
24
  *
19
25
  * @param type - the widget that you are trying to replace
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": "85.1.3",
6
+ "version": "85.2.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -45,12 +45,12 @@
45
45
  "uuid": "^10.0.0",
46
46
  "jquery": "^2.1.1",
47
47
  "@khanacademy/kas": "2.2.6",
48
- "@khanacademy/keypad-context": "3.2.87",
49
- "@khanacademy/kmath": "2.4.46",
50
- "@khanacademy/perseus-core": "38.0.1",
51
- "@khanacademy/perseus-linter": "5.2.0",
52
- "@khanacademy/perseus-score": "8.12.19",
53
- "@khanacademy/math-input": "27.0.9",
48
+ "@khanacademy/keypad-context": "3.2.88",
49
+ "@khanacademy/kmath": "2.4.47",
50
+ "@khanacademy/math-input": "27.0.10",
51
+ "@khanacademy/perseus-core": "38.1.0",
52
+ "@khanacademy/perseus-linter": "5.2.1",
53
+ "@khanacademy/perseus-score": "8.12.20",
54
54
  "@khanacademy/perseus-utils": "2.1.5",
55
55
  "@khanacademy/pure-markdown": "2.3.2",
56
56
  "@khanacademy/simple-markdown": "3.0.1"