@khanacademy/perseus 25.1.1 → 26.0.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/dist/components/fixed-to-responsive.d.ts +1 -1
- package/dist/components/hud.d.ts +2 -2
- package/dist/components/i18n-context.d.ts +1 -1
- package/dist/components/info-tip/info-tip.d.ts +1 -1
- package/dist/components/math-input.d.ts +1 -1
- package/dist/components/tooltip.d.ts +2 -2
- package/dist/es/index.css +2 -2
- package/dist/es/index.js +48 -12
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +48 -12
- package/dist/index.js.map +1 -1
- package/dist/util/react-render.d.ts +9 -1
- package/dist/widgets/deprecated-standin/index.d.ts +1 -1
- package/dist/widgets/expression.d.ts +4 -4
- package/dist/widgets/interactive-graph.d.ts +1 -1
- package/dist/widgets/interactive-graphs/backgrounds/axis-arrows.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/axis-labels.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/axis-tick-labels.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/grid.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/legacy-grid.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graph-locked-layer.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/angle.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/circle.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/components/angle-indicators.d.ts +3 -3
- package/dist/widgets/interactive-graphs/graphs/components/arrowhead.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/components/css-transform-wrapper.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +3 -3
- package/dist/widgets/interactive-graphs/graphs/components/movable-point.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/components/svg-line.d.ts +2 -1
- package/dist/widgets/interactive-graphs/graphs/components/text-label.d.ts +3 -2
- package/dist/widgets/interactive-graphs/graphs/components/vector.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graphs/linear-system.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/linear.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/point.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/polygon.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/ray.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/segment.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/sinusoid.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-ellipse.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-function.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-line.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-point.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-polygon.d.ts +2 -2
- package/dist/widgets/interactive-graphs/locked-figures/locked-vector.d.ts +2 -2
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -1
- package/dist/widgets/interactive-graphs/protractor.d.ts +2 -2
- package/dist/widgets/label-image/answer-choices.d.ts +2 -2
- package/dist/widgets/label-image/answer-pill.d.ts +2 -2
- package/dist/widgets/label-image/hide-answers-toggle.d.ts +1 -1
- package/dist/widgets/label-image/marker.d.ts +1 -1
- package/package.json +8 -8
|
@@ -23,6 +23,6 @@ declare class FixedToResponsive extends React.Component<Props, State> {
|
|
|
23
23
|
componentDidMount(): void;
|
|
24
24
|
componentWillUnmount(): void;
|
|
25
25
|
_cacheViewportSize: () => void;
|
|
26
|
-
render(): JSX.Element;
|
|
26
|
+
render(): React.JSX.Element;
|
|
27
27
|
}
|
|
28
28
|
export default FixedToResponsive;
|
package/dist/components/hud.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
message: string;
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
fixedPosition?: boolean;
|
|
7
7
|
};
|
|
8
|
-
declare const HUD: ({ message, enabled, onClick, fixedPosition }: Props) => JSX.Element;
|
|
8
|
+
declare const HUD: ({ message, enabled, onClick, fixedPosition }: Props) => React.JSX.Element;
|
|
9
9
|
export default HUD;
|
|
@@ -11,6 +11,6 @@ type I18nContextType = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const PerseusI18nContext: React.Context<I18nContextType>;
|
|
13
13
|
type Props = React.PropsWithChildren<I18nContextType>;
|
|
14
|
-
export declare function PerseusI18nContextProvider({ children, strings, locale }: Props): JSX.Element;
|
|
14
|
+
export declare function PerseusI18nContextProvider({ children, strings, locale }: Props): React.JSX.Element;
|
|
15
15
|
export declare const usePerseusI18n: () => I18nContextType;
|
|
16
16
|
export {};
|
|
@@ -2,5 +2,5 @@ import * as React from "react";
|
|
|
2
2
|
type Props = {
|
|
3
3
|
children: string | React.ReactElement | React.ReactElement[];
|
|
4
4
|
};
|
|
5
|
-
export declare const InfoTip: (props: Props) => JSX.Element;
|
|
5
|
+
export declare const InfoTip: (props: Props) => React.JSX.Element;
|
|
6
6
|
export default InfoTip;
|
|
@@ -66,8 +66,8 @@ declare class Tooltip extends React.Component<Props, State> {
|
|
|
66
66
|
componentDidMount(): void;
|
|
67
67
|
UNSAFE_componentWillReceiveProps(): void;
|
|
68
68
|
componentDidUpdate(): void;
|
|
69
|
-
_renderToolTipDiv(isTooltipAbove?: boolean): JSX.Element;
|
|
69
|
+
_renderToolTipDiv(isTooltipAbove?: boolean): React.JSX.Element;
|
|
70
70
|
_updateHeight(): void;
|
|
71
|
-
render(): JSX.Element;
|
|
71
|
+
render(): React.JSX.Element;
|
|
72
72
|
}
|
|
73
73
|
export default Tooltip;
|
package/dist/es/index.css
CHANGED
|
@@ -4148,11 +4148,11 @@ html body .mq-editable-field .mq-selection .mq-nthroot-container * {
|
|
|
4148
4148
|
/* `pointer-events: all` is needed to make the hit target the size of the
|
|
4149
4149
|
* entire <g> element and not just its visible subelements */
|
|
4150
4150
|
pointer-events: all;
|
|
4151
|
-
transition: transform 0.
|
|
4151
|
+
transition: transform 0.15s ease-out;
|
|
4152
4152
|
}
|
|
4153
4153
|
|
|
4154
4154
|
.MafsView .protractor-rotation-handle:hover {
|
|
4155
|
-
transform: scale(1.
|
|
4155
|
+
transform: scale(1.2);
|
|
4156
4156
|
}
|
|
4157
4157
|
|
|
4158
4158
|
.MafsView .protractor-rotation-handle-arrow-arc {
|
package/dist/es/index.js
CHANGED
|
@@ -8836,12 +8836,41 @@ class GraphBounds {
|
|
|
8836
8836
|
}
|
|
8837
8837
|
}
|
|
8838
8838
|
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8839
|
+
var createRoot;
|
|
8840
|
+
|
|
8841
|
+
var m = ReactDOM__default;
|
|
8842
|
+
if (process.env.NODE_ENV === 'production') {
|
|
8843
|
+
createRoot = m.createRoot;
|
|
8844
|
+
} else {
|
|
8845
|
+
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
8846
|
+
createRoot = function(c, o) {
|
|
8847
|
+
i.usingClientEntryPoint = true;
|
|
8848
|
+
try {
|
|
8849
|
+
return m.createRoot(c, o);
|
|
8850
|
+
} finally {
|
|
8851
|
+
i.usingClientEntryPoint = false;
|
|
8852
|
+
}
|
|
8853
|
+
};
|
|
8854
|
+
}
|
|
8855
|
+
|
|
8856
|
+
// We keep a cache of elements that have already had createRoot() called on
|
|
8857
|
+
// them. If we don't do this, React 18 warns every subsequent call:
|
|
8858
|
+
// > You are calling ReactDOMClient.createRoot() on a container that has
|
|
8859
|
+
// > already been passed to createRoot() before.
|
|
8860
|
+
//
|
|
8861
|
+
// Note that this cache uses a WeakMap<> so that the cache isn't causing a
|
|
8862
|
+
// memory leak (by retaining elements after they're released everywhere else).
|
|
8863
|
+
const reactRootCache = new WeakMap();
|
|
8864
|
+
|
|
8865
|
+
/**
|
|
8866
|
+
* Renders the given ReactNode inside the given container.
|
|
8867
|
+
* @param element The JSX to render
|
|
8868
|
+
* @param container The HTML elemetn to render into
|
|
8869
|
+
*
|
|
8870
|
+
* @deprecated this function is legacy and exists to support ancient code
|
|
8871
|
+
* paths. Do not use in new code.
|
|
8872
|
+
*/
|
|
8873
|
+
function render(element, container) {
|
|
8845
8874
|
/**
|
|
8846
8875
|
* `RenderStateRoot` is responsible for tracking whether it's
|
|
8847
8876
|
* the initial render or subsequent renders. It's used by
|
|
@@ -8851,9 +8880,15 @@ function render(element, container, callback) {
|
|
|
8851
8880
|
* components using that hook or those components will function
|
|
8852
8881
|
* correctly.
|
|
8853
8882
|
*/
|
|
8854
|
-
React.createElement(RenderStateRoot, {
|
|
8883
|
+
const children = /*#__PURE__*/React.createElement(RenderStateRoot, {
|
|
8855
8884
|
throwIfNested: false
|
|
8856
|
-
}, element)
|
|
8885
|
+
}, element);
|
|
8886
|
+
let root = reactRootCache.get(container);
|
|
8887
|
+
if (root == null) {
|
|
8888
|
+
root = createRoot(container);
|
|
8889
|
+
reactRootCache.set(container, root);
|
|
8890
|
+
}
|
|
8891
|
+
root.render(children);
|
|
8857
8892
|
}
|
|
8858
8893
|
|
|
8859
8894
|
function findChildOrAdd(elem, className) {
|
|
@@ -8905,6 +8940,7 @@ var Tex$1 = {
|
|
|
8905
8940
|
} = await getDependencies();
|
|
8906
8941
|
// We use createElement instead of JSX here because we can't name this file tex.tsx;
|
|
8907
8942
|
// that name is already taken.
|
|
8943
|
+
// eslint-disable-next-line import/no-deprecated
|
|
8908
8944
|
render( /*#__PURE__*/React.createElement(TeX, {
|
|
8909
8945
|
children: text,
|
|
8910
8946
|
onRender: callback
|
|
@@ -15305,6 +15341,7 @@ class MovablePoint$4 {
|
|
|
15305
15341
|
}
|
|
15306
15342
|
const showTrashTooltip = () => {
|
|
15307
15343
|
this._showTooltip(container => {
|
|
15344
|
+
// eslint-disable-next-line import/no-deprecated
|
|
15308
15345
|
render( /*#__PURE__*/React.createElement("span", {
|
|
15309
15346
|
style: {
|
|
15310
15347
|
fontSize: "2em"
|
|
@@ -17572,7 +17609,6 @@ class Tex extends React.Component {
|
|
|
17572
17609
|
super(props);
|
|
17573
17610
|
this._hasRendered = void 0;
|
|
17574
17611
|
this.handleRender = () => {
|
|
17575
|
-
this.props.onRender();
|
|
17576
17612
|
this.setState({
|
|
17577
17613
|
rendered: true
|
|
17578
17614
|
});
|
|
@@ -31793,7 +31829,7 @@ const renderGraph = props => {
|
|
|
31793
31829
|
dispatch: dispatch
|
|
31794
31830
|
});
|
|
31795
31831
|
default:
|
|
31796
|
-
|
|
31832
|
+
throw new UnreachableCaseError(type);
|
|
31797
31833
|
}
|
|
31798
31834
|
};
|
|
31799
31835
|
|
|
@@ -41802,6 +41838,7 @@ const rules = {
|
|
|
41802
41838
|
}, getInitialParseState()));
|
|
41803
41839
|
return {
|
|
41804
41840
|
ref: ref,
|
|
41841
|
+
// @ts-expect-error - TS2322- Type 'SingleASTNode[]' is not assignable to type 'ReactNode'.
|
|
41805
41842
|
refContent: refContent
|
|
41806
41843
|
};
|
|
41807
41844
|
},
|
|
@@ -44933,7 +44970,7 @@ const init = function init(options) {
|
|
|
44933
44970
|
|
|
44934
44971
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
44935
44972
|
const libName = "@khanacademy/perseus";
|
|
44936
|
-
const libVersion = "
|
|
44973
|
+
const libVersion = "26.0.0";
|
|
44937
44974
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
44938
44975
|
|
|
44939
44976
|
const apiVersion = {
|
|
@@ -45369,7 +45406,6 @@ class HintsRenderer extends React.Component {
|
|
|
45369
45406
|
}, apiOptions.isMobile && hintsVisible > 0 && /*#__PURE__*/React.createElement("div", {
|
|
45370
45407
|
className: css(styles$2.mobileHintStylesHintTitle, sharedStyles.responsiveLabel)
|
|
45371
45408
|
}, this.context.strings.hints), hints, showGetAnotherHint && /*#__PURE__*/React.createElement("button", {
|
|
45372
|
-
// @ts-expect-error - TS2322 - Type '{ children: Element[]; rel: string; className: string; onClick: (evt: MouseEvent<HTMLButtonElement, MouseEvent>) => void; }' is not assignable to type 'DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>'.
|
|
45373
45409
|
rel: "button",
|
|
45374
45410
|
className: css(styles$2.linkButton, styles$2.getAnotherHintButton, apiOptions.isMobile && styles$2.mobileHintStylesGetAnotherHintButton),
|
|
45375
45411
|
onClick: evt => {
|