@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/dist/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/index.js
CHANGED
|
@@ -2616,6 +2616,11 @@ class Expression extends React__namespace.Component {
|
|
|
2616
2616
|
this.props.trackInteraction();
|
|
2617
2617
|
});
|
|
2618
2618
|
_defineProperty(this, "_handleFocus", () => {
|
|
2619
|
+
this.props.analytics.onAnalyticsEvent({
|
|
2620
|
+
type: "perseus:expression-focused",
|
|
2621
|
+
payload: null
|
|
2622
|
+
});
|
|
2623
|
+
|
|
2619
2624
|
/* c8 ignore next */
|
|
2620
2625
|
this.props.onFocus([]);
|
|
2621
2626
|
});
|
|
@@ -22825,7 +22830,8 @@ const Choice = function (props) {
|
|
|
22825
22830
|
display: "flex",
|
|
22826
22831
|
flexDirection: "row",
|
|
22827
22832
|
opacity: showDimmed ? 0.5 : 1.0,
|
|
22828
|
-
|
|
22833
|
+
overflowX: "auto",
|
|
22834
|
+
overflowY: "hidden"
|
|
22829
22835
|
}
|
|
22830
22836
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
22831
22837
|
className: "perseus-sr-only"
|
|
@@ -26894,7 +26900,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26894
26900
|
// Aphrodite.
|
|
26895
26901
|
const minWidth = isImageFullWidth ? null : "0 !important";
|
|
26896
26902
|
titleAndCaption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26897
|
-
className: className
|
|
26903
|
+
className: className,
|
|
26904
|
+
style: {
|
|
26905
|
+
maxWidth: backgroundImage.width
|
|
26906
|
+
}
|
|
26898
26907
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26899
26908
|
style: {
|
|
26900
26909
|
// @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
|
|
@@ -26923,7 +26932,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26923
26932
|
}
|
|
26924
26933
|
if (this.props.caption) {
|
|
26925
26934
|
caption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26926
|
-
className: "perseus-image-caption"
|
|
26935
|
+
className: "perseus-image-caption",
|
|
26936
|
+
style: {
|
|
26937
|
+
maxWidth: backgroundImage.width
|
|
26938
|
+
}
|
|
26927
26939
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
26928
26940
|
content: this.props.caption,
|
|
26929
26941
|
apiOptions: apiOptions,
|
|
@@ -44675,7 +44687,12 @@ const ProvideKeypad = {
|
|
|
44675
44687
|
// @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...'.
|
|
44676
44688
|
,
|
|
44677
44689
|
style: _this.props.keypadStyle,
|
|
44678
|
-
useV2Keypad: apiOptions.useV2Keypad
|
|
44690
|
+
useV2Keypad: apiOptions.useV2Keypad,
|
|
44691
|
+
onAnalyticsEvent: async () => {
|
|
44692
|
+
// Intentionally left empty. This component is
|
|
44693
|
+
// deprecated and so we don't want/need to instrument
|
|
44694
|
+
// it.
|
|
44695
|
+
}
|
|
44679
44696
|
}), _this._keypadContainer);
|
|
44680
44697
|
}
|
|
44681
44698
|
},
|