@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 +25 -0
- package/dist/es/index.css +0 -2
- package/dist/es/index.js +19 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +0 -2
- package/dist/index.js +19 -3
- 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/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__/image.test.ts.snap +2 -0
- package/src/widgets/expression.tsx +5 -0
- package/src/widgets/image.tsx +12 -2
- 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
|
});
|
|
@@ -26895,7 +26900,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26895
26900
|
// Aphrodite.
|
|
26896
26901
|
const minWidth = isImageFullWidth ? null : "0 !important";
|
|
26897
26902
|
titleAndCaption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26898
|
-
className: className
|
|
26903
|
+
className: className,
|
|
26904
|
+
style: {
|
|
26905
|
+
maxWidth: backgroundImage.width
|
|
26906
|
+
}
|
|
26899
26907
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26900
26908
|
style: {
|
|
26901
26909
|
// @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
|
|
@@ -26924,7 +26932,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26924
26932
|
}
|
|
26925
26933
|
if (this.props.caption) {
|
|
26926
26934
|
caption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26927
|
-
className: "perseus-image-caption"
|
|
26935
|
+
className: "perseus-image-caption",
|
|
26936
|
+
style: {
|
|
26937
|
+
maxWidth: backgroundImage.width
|
|
26938
|
+
}
|
|
26928
26939
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
26929
26940
|
content: this.props.caption,
|
|
26930
26941
|
apiOptions: apiOptions,
|
|
@@ -44676,7 +44687,12 @@ const ProvideKeypad = {
|
|
|
44676
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...'.
|
|
44677
44688
|
,
|
|
44678
44689
|
style: _this.props.keypadStyle,
|
|
44679
|
-
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
|
+
}
|
|
44680
44696
|
}), _this._keypadContainer);
|
|
44681
44697
|
}
|
|
44682
44698
|
},
|