@khanacademy/perseus 11.1.0 → 11.3.0
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 +36 -0
- package/dist/error-boundary.d.ts +1 -0
- package/dist/es/index.css +0 -2
- package/dist/es/index.js +27 -7
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +0 -2
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/__testdata__/article-renderer.testdata.ts +2 -1
- package/src/error-boundary.tsx +5 -1
- package/src/mixins/provide-keypad.tsx +5 -0
- package/src/renderer.tsx +4 -1
- 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
|
});
|
|
@@ -17786,7 +17791,8 @@ class ErrorBoundary extends React__namespace.Component {
|
|
|
17786
17791
|
Log.error("Perseus error boundary caught error", Errors.Internal, {
|
|
17787
17792
|
cause: error,
|
|
17788
17793
|
loggedMetadata: {
|
|
17789
|
-
|
|
17794
|
+
componentStack: info.componentStack,
|
|
17795
|
+
...this.props.metadata
|
|
17790
17796
|
}
|
|
17791
17797
|
});
|
|
17792
17798
|
}
|
|
@@ -19406,7 +19412,11 @@ class Renderer extends React__namespace.Component {
|
|
|
19406
19412
|
// filtered out in this.render(), so we shouldn't have to
|
|
19407
19413
|
// worry about using this widget key and ref:
|
|
19408
19414
|
return /*#__PURE__*/React__namespace.createElement(ErrorBoundary, {
|
|
19409
|
-
key: "container:" + id
|
|
19415
|
+
key: "container:" + id,
|
|
19416
|
+
metadata: {
|
|
19417
|
+
widget_type: type,
|
|
19418
|
+
widget_id: id
|
|
19419
|
+
}
|
|
19410
19420
|
}, /*#__PURE__*/React__namespace.createElement(WidgetContainer, {
|
|
19411
19421
|
ref: "container:" + id,
|
|
19412
19422
|
type: type,
|
|
@@ -26895,7 +26905,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26895
26905
|
// Aphrodite.
|
|
26896
26906
|
const minWidth = isImageFullWidth ? null : "0 !important";
|
|
26897
26907
|
titleAndCaption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26898
|
-
className: className
|
|
26908
|
+
className: className,
|
|
26909
|
+
style: {
|
|
26910
|
+
maxWidth: backgroundImage.width
|
|
26911
|
+
}
|
|
26899
26912
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26900
26913
|
style: {
|
|
26901
26914
|
// @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
|
|
@@ -26924,7 +26937,10 @@ class ImageWidget extends React__namespace.Component {
|
|
|
26924
26937
|
}
|
|
26925
26938
|
if (this.props.caption) {
|
|
26926
26939
|
caption = /*#__PURE__*/React__namespace.createElement("figcaption", {
|
|
26927
|
-
className: "perseus-image-caption"
|
|
26940
|
+
className: "perseus-image-caption",
|
|
26941
|
+
style: {
|
|
26942
|
+
maxWidth: backgroundImage.width
|
|
26943
|
+
}
|
|
26928
26944
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
26929
26945
|
content: this.props.caption,
|
|
26930
26946
|
apiOptions: apiOptions,
|
|
@@ -44676,7 +44692,12 @@ const ProvideKeypad = {
|
|
|
44676
44692
|
// @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
44693
|
,
|
|
44678
44694
|
style: _this.props.keypadStyle,
|
|
44679
|
-
useV2Keypad: apiOptions.useV2Keypad
|
|
44695
|
+
useV2Keypad: apiOptions.useV2Keypad,
|
|
44696
|
+
onAnalyticsEvent: async () => {
|
|
44697
|
+
// Intentionally left empty. This component is
|
|
44698
|
+
// deprecated and so we don't want/need to instrument
|
|
44699
|
+
// it.
|
|
44700
|
+
}
|
|
44680
44701
|
}), _this._keypadContainer);
|
|
44681
44702
|
}
|
|
44682
44703
|
},
|