@khanacademy/perseus 36.0.0 → 36.1.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.
@@ -23,10 +23,20 @@ declare function getAnswersFromWidgets(widgets: PerseusRenderer["widgets"]): Rea
23
23
  * @returns
24
24
  */
25
25
  declare function injectWidgets(content: string, widgets: PerseusRenderer["widgets"], widgetProps?: PerseusWidgetsMap): string;
26
+ /**
27
+ * Looks through widgets to identify images that do not have alt text.
28
+ *
29
+ * We pass in the fuller perseusRenderer object to allow for the possibility
30
+ * of expanding to include other img data from content & images in the future.
31
+ *
32
+ * @param {PerseusRenderer} perseusRenderer
33
+ * @returns a stringified list of {widgetId, imageUrl} for imgs that don't have alt text
34
+ */
35
+ declare function getImagesWithoutAltData(perseusRenderer: PerseusRenderer): string;
26
36
  export declare const isWrongAnswerSupported: (widgetIds: Array<string>, widgetMap: PerseusWidgetsMap) => boolean;
27
37
  export declare const shouldHaveIndividualAnswer: (widgetId: string, widgetMap: PerseusWidgetsMap) => boolean;
28
38
  export declare const getAnswerFromUserInput: (widgetType: string, userInput: any) => any;
29
39
  export declare const getCorrectAnswerForWidgetId: (widgetId: string, itemData: PerseusItem) => string | undefined;
30
40
  export declare const isWidgetIdInContent: (perseusItem: PerseusItem, widgetId: string) => boolean;
31
41
  export declare const getValidWidgetIds: (perseusItem: PerseusItem) => Array<string>;
32
- export { getAnswersFromWidgets, injectWidgets };
42
+ export { getAnswersFromWidgets, getImagesWithoutAltData, injectWidgets };
@@ -11,5 +11,5 @@ type Props = {
11
11
  constrain?: KeyboardMovementConstraint;
12
12
  onFocusChange?: (event: React.FocusEvent, isFocused: boolean) => unknown;
13
13
  };
14
- export declare const MovablePoint: (props: Props) => React.JSX.Element;
14
+ export declare const MovablePoint: React.ForwardRefExoticComponent<Props & React.RefAttributes<SVGGElement | null>>;
15
15
  export {};
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": "36.0.0",
6
+ "version": "36.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -40,14 +40,14 @@
40
40
  "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
41
41
  },
42
42
  "dependencies": {
43
- "@khanacademy/kas": "^0.3.12",
44
- "@khanacademy/keypad-context": "^1.0.1",
45
- "@khanacademy/kmath": "^0.1.13",
46
- "@khanacademy/math-input": "^21.0.2",
47
- "@khanacademy/perseus-core": "1.5.0",
48
- "@khanacademy/perseus-linter": "^1.2.0",
49
- "@khanacademy/pure-markdown": "^0.3.8",
50
- "@khanacademy/simple-markdown": "^0.13.1",
43
+ "@khanacademy/kas": "^0.3.13",
44
+ "@khanacademy/keypad-context": "^1.0.2",
45
+ "@khanacademy/kmath": "^0.1.14",
46
+ "@khanacademy/math-input": "^21.0.3",
47
+ "@khanacademy/perseus-core": "1.5.1",
48
+ "@khanacademy/perseus-linter": "^1.2.1",
49
+ "@khanacademy/pure-markdown": "^0.3.9",
50
+ "@khanacademy/simple-markdown": "^0.13.2",
51
51
  "@types/classnames": "2.2.0",
52
52
  "@use-gesture/react": "^10.2.27",
53
53
  "mafs": "0.19.0",