@khanacademy/perseus 11.1.0 → 11.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @khanacademy/perseus
2
2
 
3
+ ## 11.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a383823d: Bump @khanacademy/wonder-stuff-core to v1.5.1 (which adds needed support for `isTruthy` helper function)
8
+ - Updated dependencies [a383823d]
9
+ - @khanacademy/math-input@12.0.1
10
+ - @khanacademy/perseus-linter@0.3.3
11
+ - @khanacademy/pure-markdown@0.2.5
12
+
13
+ ## 11.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 9ff8a575: Fix image widget caption styling
18
+ - 1b618343: Add new Perseus analytics event: 'perseus:expression-focused'. This event is fired any time the expression widget input box receives focus.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [fa5f463b]
23
+ - Updated dependencies [fa1bb6b4]
24
+ - Updated dependencies [6d8ede65]
25
+ - Updated dependencies [3afc0da2]
26
+ - @khanacademy/math-input@12.0.0
27
+
3
28
  ## 11.1.0
4
29
 
5
30
  ### Minor Changes
package/dist/es/index.css CHANGED
@@ -1607,7 +1607,6 @@ body.mobile ul.inequalities-one-line-radios > li {
1607
1607
  font-size: 14px;
1608
1608
  line-height: 19px;
1609
1609
  margin: 16px auto 42px;
1610
- max-width: 455px;
1611
1610
  text-align: left;
1612
1611
  }
1613
1612
  .framework-perseus.perseus-article:not(.perseus-mobile) .paragraph.perseus-paragraph-full-width {
@@ -2807,7 +2806,6 @@ body.mobile .categorizer-container td.category input[type="radio"] + span:active
2807
2806
  }
2808
2807
  .perseus-image-widget .perseus-image-caption {
2809
2808
  color: rgba(33, 36, 44, 0.7);
2810
- max-width: 420px;
2811
2809
  padding-left: 16px;
2812
2810
  position: relative;
2813
2811
  top: -12px;
package/dist/es/index.js CHANGED
@@ -2552,6 +2552,11 @@ class Expression extends React.Component {
2552
2552
  this.props.trackInteraction();
2553
2553
  };
2554
2554
  this._handleFocus = () => {
2555
+ this.props.analytics.onAnalyticsEvent({
2556
+ type: "perseus:expression-focused",
2557
+ payload: null
2558
+ });
2559
+
2555
2560
  /* c8 ignore next */
2556
2561
  this.props.onFocus([]);
2557
2562
  };
@@ -26706,7 +26711,10 @@ class ImageWidget extends React.Component {
26706
26711
  // Aphrodite.
26707
26712
  const minWidth = isImageFullWidth ? null : "0 !important";
26708
26713
  titleAndCaption = /*#__PURE__*/React.createElement("figcaption", {
26709
- className: className
26714
+ className: className,
26715
+ style: {
26716
+ maxWidth: backgroundImage.width
26717
+ }
26710
26718
  }, /*#__PURE__*/React.createElement("div", {
26711
26719
  style: {
26712
26720
  // @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
@@ -26735,7 +26743,10 @@ class ImageWidget extends React.Component {
26735
26743
  }
26736
26744
  if (this.props.caption) {
26737
26745
  caption = /*#__PURE__*/React.createElement("figcaption", {
26738
- className: "perseus-image-caption"
26746
+ className: "perseus-image-caption",
26747
+ style: {
26748
+ maxWidth: backgroundImage.width
26749
+ }
26739
26750
  }, /*#__PURE__*/React.createElement(Renderer, {
26740
26751
  content: this.props.caption,
26741
26752
  apiOptions: apiOptions,
@@ -44406,7 +44417,12 @@ const ProvideKeypad = {
44406
44417
  // @ts-expect-error - TS2339 - Property 'props' does not exist on type '{ readonly propTypes: { readonly apiOptions: React.PropType<{ customKeypad?: boolean | undefined; nativeKeypadProxy?: ((...a: readonly any[]) => unknown) | undefined; }>; readonly keypadStyle: Requireable<any>; }; readonly getInitialState: () => { ...; }; readonly componentDidMount: () => void; readonly componentWil...'.
44407
44418
  ,
44408
44419
  style: _this.props.keypadStyle,
44409
- useV2Keypad: apiOptions.useV2Keypad
44420
+ useV2Keypad: apiOptions.useV2Keypad,
44421
+ onAnalyticsEvent: async () => {
44422
+ // Intentionally left empty. This component is
44423
+ // deprecated and so we don't want/need to instrument
44424
+ // it.
44425
+ }
44410
44426
  }), _this._keypadContainer);
44411
44427
  }
44412
44428
  },