@khanacademy/perseus 77.0.1 → 77.0.3

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.
@@ -134,6 +134,14 @@ export declare class Graphie {
134
134
  pageX?: number;
135
135
  pageY?: number;
136
136
  }>): Coord;
137
+ /**
138
+ * Lazily create a ResizeObserver on this.el so that when the container
139
+ * resizes (e.g. responsive images on window resize) the label margins,
140
+ * padding, and font-size are recalculated.
141
+ */
142
+ private _ensureResizeObserver;
143
+ private _recalculateLabels;
144
+ cleanup(): void;
137
145
  }
138
146
  type RangeSpecifier = [Interval, Interval] | Coord | number;
139
147
  export declare function normalizeRange(range: RangeSpecifier): [Interval, Interval];
@@ -1,4 +1,4 @@
1
- import { type PerseusWidget, type PerseusWidgetsMap } from "@khanacademy/perseus-core";
1
+ import { type PerseusWidget, type PerseusWidgetOptions, type PerseusWidgetsMap } from "@khanacademy/perseus-core";
2
2
  /**
3
3
  * Get a widget type by a widget's ID
4
4
  * (please don't derive type from ID)
@@ -8,6 +8,14 @@ import { type PerseusWidget, type PerseusWidgetsMap } from "@khanacademy/perseus
8
8
  * @returns {string} the widget type (ie "radio")
9
9
  */
10
10
  export declare function getWidgetTypeByWidgetId(widgetId: string, widgetMap: PerseusWidgetsMap): string | null;
11
+ /**
12
+ * Get the subtype of a widget based on its type and options.
13
+ *
14
+ * @param {string} widgetType the type of the widget (ie "radio", "interactive-graph")
15
+ * @param {Record<string, unknown>} widgetOptions the widget's options/props
16
+ * @returns {string | null} the widget subtype, or null if the widget type has no subtypes
17
+ */
18
+ export declare function getWidgetSubType(widgetType: string, widgetOptions: PerseusWidgetOptions): string | null;
11
19
  export declare function getWidgetSubTypeByWidgetId(widgetId: string, widgetMap: PerseusWidgetsMap): string | null;
12
20
  /**
13
21
  * Does the content have a specific type of widget?
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": "77.0.1",
6
+ "version": "77.0.3",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -42,15 +42,15 @@
42
42
  "tiny-invariant": "1.3.1",
43
43
  "uuid": "^10.0.0",
44
44
  "@khanacademy/kas": "2.2.1",
45
- "@khanacademy/perseus-core": "24.0.0",
46
- "@khanacademy/math-input": "26.4.11",
47
45
  "@khanacademy/keypad-context": "3.2.41",
46
+ "@khanacademy/math-input": "26.4.11",
47
+ "@khanacademy/perseus-core": "24.0.0",
48
48
  "@khanacademy/kmath": "2.3.1",
49
49
  "@khanacademy/perseus-linter": "4.9.1",
50
- "@khanacademy/perseus-score": "8.5.0",
51
50
  "@khanacademy/perseus-utils": "2.1.5",
52
51
  "@khanacademy/pure-markdown": "2.2.7",
53
- "@khanacademy/simple-markdown": "2.2.2"
52
+ "@khanacademy/simple-markdown": "2.2.2",
53
+ "@khanacademy/perseus-score": "8.5.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@khanacademy/wonder-blocks-announcer": "1.0.6",