@khanacademy/perseus 11.0.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 +33 -0
- package/dist/es/index.css +0 -2
- package/dist/es/index.js +21 -4
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +0 -2
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/__testdata__/article-renderer.testdata.ts +2 -1
- package/src/mixins/provide-keypad.tsx +5 -0
- package/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap +5 -5
- package/src/styles/articles.less +0 -1
- package/src/styles/widgets/image.less +0 -1
- package/src/widgets/__stories__/test-keypad-context-wrapper.tsx +5 -0
- package/src/widgets/__tests__/__snapshots__/group.test.tsx.snap +5 -5
- package/src/widgets/__tests__/__snapshots__/image.test.ts.snap +2 -0
- package/src/widgets/__tests__/__snapshots__/radio.test.ts.snap +28 -28
- package/src/widgets/expression.tsx +5 -0
- package/src/widgets/image.tsx +12 -2
- package/src/widgets/radio/choice.tsx +2 -1
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
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
|
+
|
|
28
|
+
## 11.1.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- 8dc86906: Ensure that radio widget choices can scroll horizontally, but not vertically.
|
|
33
|
+
Previously, unnecessary vertical scrollbars appeared on some choices containing
|
|
34
|
+
MathJax elements.
|
|
35
|
+
|
|
3
36
|
## 11.0.0
|
|
4
37
|
|
|
5
38
|
### Major 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
|
};
|
|
@@ -22719,7 +22724,8 @@ const Choice = function Choice(props) {
|
|
|
22719
22724
|
display: "flex",
|
|
22720
22725
|
flexDirection: "row",
|
|
22721
22726
|
opacity: showDimmed ? 0.5 : 1.0,
|
|
22722
|
-
|
|
22727
|
+
overflowX: "auto",
|
|
22728
|
+
overflowY: "hidden"
|
|
22723
22729
|
}
|
|
22724
22730
|
}, /*#__PURE__*/React.createElement("div", {
|
|
22725
22731
|
className: "perseus-sr-only"
|
|
@@ -26705,7 +26711,10 @@ class ImageWidget extends React.Component {
|
|
|
26705
26711
|
// Aphrodite.
|
|
26706
26712
|
const minWidth = isImageFullWidth ? null : "0 !important";
|
|
26707
26713
|
titleAndCaption = /*#__PURE__*/React.createElement("figcaption", {
|
|
26708
|
-
className: className
|
|
26714
|
+
className: className,
|
|
26715
|
+
style: {
|
|
26716
|
+
maxWidth: backgroundImage.width
|
|
26717
|
+
}
|
|
26709
26718
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26710
26719
|
style: {
|
|
26711
26720
|
// @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
|
|
@@ -26734,7 +26743,10 @@ class ImageWidget extends React.Component {
|
|
|
26734
26743
|
}
|
|
26735
26744
|
if (this.props.caption) {
|
|
26736
26745
|
caption = /*#__PURE__*/React.createElement("figcaption", {
|
|
26737
|
-
className: "perseus-image-caption"
|
|
26746
|
+
className: "perseus-image-caption",
|
|
26747
|
+
style: {
|
|
26748
|
+
maxWidth: backgroundImage.width
|
|
26749
|
+
}
|
|
26738
26750
|
}, /*#__PURE__*/React.createElement(Renderer, {
|
|
26739
26751
|
content: this.props.caption,
|
|
26740
26752
|
apiOptions: apiOptions,
|
|
@@ -44405,7 +44417,12 @@ const ProvideKeypad = {
|
|
|
44405
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...'.
|
|
44406
44418
|
,
|
|
44407
44419
|
style: _this.props.keypadStyle,
|
|
44408
|
-
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
|
+
}
|
|
44409
44426
|
}), _this._keypadContainer);
|
|
44410
44427
|
}
|
|
44411
44428
|
},
|