@khanacademy/perseus 25.1.1 → 26.1.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 +55 -14
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +55 -14
- package/dist/index.js.map +1 -1
- package/dist/renderer.d.ts +8 -1
- package/dist/types.d.ts +1 -0
- package/dist/util/react-render.d.ts +9 -1
- package/dist/widget-container.d.ts +1 -1
- package/dist/widgets/deprecated-standin/index.d.ts +1 -1
- package/dist/widgets/expression.d.ts +6 -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 +2 -1
- package/dist/widgets/interactive-graphs/protractor.d.ts +2 -2
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -0
- 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 +10 -10
package/dist/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/index.js
CHANGED
|
@@ -618,6 +618,7 @@ class InnerMathInput extends React__namespace.Component {
|
|
|
618
618
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.Popover, {
|
|
619
619
|
opened: this.state.keypadOpen,
|
|
620
620
|
onClose: () => this.closeKeypad(),
|
|
621
|
+
portal: false,
|
|
621
622
|
dismissEnabled: true,
|
|
622
623
|
content: () => /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
|
|
623
624
|
closeButtonVisible: true,
|
|
@@ -834,7 +835,7 @@ const denylist = [
|
|
|
834
835
|
// (technically the renderer still adds them)
|
|
835
836
|
"key", "ref",
|
|
836
837
|
// added by src/renderer.jsx
|
|
837
|
-
"containerSizeClass", "widgetId", "onChange", "problemNum", "apiOptions", "questionCompleted", "findWidgets",
|
|
838
|
+
"containerSizeClass", "widgetId", "onChange", "problemNum", "apiOptions", "questionCompleted", "findWidgets", "hintMode",
|
|
838
839
|
// added by src/editor.jsx, for widgets removing themselves
|
|
839
840
|
// this is soooo not the right place for this, but alas.
|
|
840
841
|
"onRemove",
|
|
@@ -8934,12 +8935,41 @@ class GraphBounds {
|
|
|
8934
8935
|
}
|
|
8935
8936
|
}
|
|
8936
8937
|
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8938
|
+
var createRoot;
|
|
8939
|
+
|
|
8940
|
+
var m = ReactDOM__default["default"];
|
|
8941
|
+
if (process.env.NODE_ENV === 'production') {
|
|
8942
|
+
createRoot = m.createRoot;
|
|
8943
|
+
} else {
|
|
8944
|
+
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
8945
|
+
createRoot = function(c, o) {
|
|
8946
|
+
i.usingClientEntryPoint = true;
|
|
8947
|
+
try {
|
|
8948
|
+
return m.createRoot(c, o);
|
|
8949
|
+
} finally {
|
|
8950
|
+
i.usingClientEntryPoint = false;
|
|
8951
|
+
}
|
|
8952
|
+
};
|
|
8953
|
+
}
|
|
8954
|
+
|
|
8955
|
+
// We keep a cache of elements that have already had createRoot() called on
|
|
8956
|
+
// them. If we don't do this, React 18 warns every subsequent call:
|
|
8957
|
+
// > You are calling ReactDOMClient.createRoot() on a container that has
|
|
8958
|
+
// > already been passed to createRoot() before.
|
|
8959
|
+
//
|
|
8960
|
+
// Note that this cache uses a WeakMap<> so that the cache isn't causing a
|
|
8961
|
+
// memory leak (by retaining elements after they're released everywhere else).
|
|
8962
|
+
const reactRootCache = new WeakMap();
|
|
8963
|
+
|
|
8964
|
+
/**
|
|
8965
|
+
* Renders the given ReactNode inside the given container.
|
|
8966
|
+
* @param element The JSX to render
|
|
8967
|
+
* @param container The HTML elemetn to render into
|
|
8968
|
+
*
|
|
8969
|
+
* @deprecated this function is legacy and exists to support ancient code
|
|
8970
|
+
* paths. Do not use in new code.
|
|
8971
|
+
*/
|
|
8972
|
+
function render(element, container) {
|
|
8943
8973
|
/**
|
|
8944
8974
|
* `RenderStateRoot` is responsible for tracking whether it's
|
|
8945
8975
|
* the initial render or subsequent renders. It's used by
|
|
@@ -8949,9 +8979,15 @@ function render(element, container, callback) {
|
|
|
8949
8979
|
* components using that hook or those components will function
|
|
8950
8980
|
* correctly.
|
|
8951
8981
|
*/
|
|
8952
|
-
React__namespace.createElement(wonderBlocksCore.RenderStateRoot, {
|
|
8982
|
+
const children = /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.RenderStateRoot, {
|
|
8953
8983
|
throwIfNested: false
|
|
8954
|
-
}, element)
|
|
8984
|
+
}, element);
|
|
8985
|
+
let root = reactRootCache.get(container);
|
|
8986
|
+
if (root == null) {
|
|
8987
|
+
root = createRoot(container);
|
|
8988
|
+
reactRootCache.set(container, root);
|
|
8989
|
+
}
|
|
8990
|
+
root.render(children);
|
|
8955
8991
|
}
|
|
8956
8992
|
|
|
8957
8993
|
function findChildOrAdd(elem, className) {
|
|
@@ -9003,6 +9039,7 @@ var Tex$1 = {
|
|
|
9003
9039
|
} = await getDependencies();
|
|
9004
9040
|
// We use createElement instead of JSX here because we can't name this file tex.tsx;
|
|
9005
9041
|
// that name is already taken.
|
|
9042
|
+
// eslint-disable-next-line import/no-deprecated
|
|
9006
9043
|
render( /*#__PURE__*/React__namespace.createElement(TeX, {
|
|
9007
9044
|
children: text,
|
|
9008
9045
|
onRender: callback
|
|
@@ -15445,6 +15482,7 @@ class MovablePoint$4 {
|
|
|
15445
15482
|
}
|
|
15446
15483
|
const showTrashTooltip = () => {
|
|
15447
15484
|
this._showTooltip(container => {
|
|
15485
|
+
// eslint-disable-next-line import/no-deprecated
|
|
15448
15486
|
render( /*#__PURE__*/React__namespace.createElement("span", {
|
|
15449
15487
|
style: {
|
|
15450
15488
|
fontSize: "2em"
|
|
@@ -17741,7 +17779,6 @@ class Tex extends React__namespace.Component {
|
|
|
17741
17779
|
this._hasRendered = false;
|
|
17742
17780
|
}
|
|
17743
17781
|
handleRender = () => {
|
|
17744
|
-
this.props.onRender();
|
|
17745
17782
|
this.setState({
|
|
17746
17783
|
rendered: true
|
|
17747
17784
|
});
|
|
@@ -19753,6 +19790,7 @@ class Renderer extends React__namespace.Component {
|
|
|
19753
19790
|
findExternalWidgets: () => [],
|
|
19754
19791
|
alwaysUpdate: false,
|
|
19755
19792
|
reviewMode: false,
|
|
19793
|
+
hintMode: false,
|
|
19756
19794
|
serializedState: null,
|
|
19757
19795
|
onSerializedStateUpdated: () => {},
|
|
19758
19796
|
linterContext: PerseusLinter__namespace.linterContextDefault
|
|
@@ -20043,6 +20081,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20043
20081
|
onBlur: ___default["default"].partial(this._onWidgetBlur, id),
|
|
20044
20082
|
findWidgets: this.findWidgets,
|
|
20045
20083
|
reviewModeRubric: reviewModeRubric,
|
|
20084
|
+
hintMode: this.props.hintMode,
|
|
20046
20085
|
onChange: function (newProps, cb) {
|
|
20047
20086
|
let silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
20048
20087
|
_this._setWidgetProps(id, newProps, cb, silent);
|
|
@@ -32123,7 +32162,7 @@ const renderGraph = props => {
|
|
|
32123
32162
|
dispatch: dispatch
|
|
32124
32163
|
});
|
|
32125
32164
|
default:
|
|
32126
|
-
|
|
32165
|
+
throw new wonderStuffCore.UnreachableCaseError(type);
|
|
32127
32166
|
}
|
|
32128
32167
|
};
|
|
32129
32168
|
|
|
@@ -34478,7 +34517,8 @@ class InteractiveGraph extends React__namespace.Component {
|
|
|
34478
34517
|
gridStep: gridStep,
|
|
34479
34518
|
snapStep: snapStep,
|
|
34480
34519
|
box: box,
|
|
34481
|
-
showTooltips: !!this.props.showTooltips
|
|
34520
|
+
showTooltips: !!this.props.showTooltips,
|
|
34521
|
+
hintMode: this.props.hintMode
|
|
34482
34522
|
}));
|
|
34483
34523
|
}
|
|
34484
34524
|
return /*#__PURE__*/React__namespace.createElement(LegacyInteractiveGraph, _extends({
|
|
@@ -42163,6 +42203,7 @@ const rules = {
|
|
|
42163
42203
|
}, getInitialParseState()));
|
|
42164
42204
|
return {
|
|
42165
42205
|
ref: ref,
|
|
42206
|
+
// @ts-expect-error - TS2322- Type 'SingleASTNode[]' is not assignable to type 'ReactNode'.
|
|
42166
42207
|
refContent: refContent
|
|
42167
42208
|
};
|
|
42168
42209
|
},
|
|
@@ -45295,7 +45336,7 @@ const init = function (options) {
|
|
|
45295
45336
|
|
|
45296
45337
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
45297
45338
|
const libName = "@khanacademy/perseus";
|
|
45298
|
-
const libVersion = "
|
|
45339
|
+
const libVersion = "26.1.0";
|
|
45299
45340
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
45300
45341
|
|
|
45301
45342
|
const apiVersion = {
|
|
@@ -45543,6 +45584,7 @@ class HintRenderer extends React__namespace.Component {
|
|
|
45543
45584
|
// eslint-disable-next-line react/no-string-refs
|
|
45544
45585
|
, {
|
|
45545
45586
|
ref: "renderer",
|
|
45587
|
+
hintMode: true,
|
|
45546
45588
|
widgets: hint.widgets,
|
|
45547
45589
|
content: hint.content || "",
|
|
45548
45590
|
images: hint.images,
|
|
@@ -45738,7 +45780,6 @@ class HintsRenderer extends React__namespace.Component {
|
|
|
45738
45780
|
}, apiOptions.isMobile && hintsVisible > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
45739
45781
|
className: aphrodite.css(styles$2.mobileHintStylesHintTitle, sharedStyles.responsiveLabel)
|
|
45740
45782
|
}, this.context.strings.hints), hints, showGetAnotherHint && /*#__PURE__*/React__namespace.createElement("button", {
|
|
45741
|
-
// @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>'.
|
|
45742
45783
|
rel: "button",
|
|
45743
45784
|
className: aphrodite.css(styles$2.linkButton, styles$2.getAnotherHintButton, apiOptions.isMobile && styles$2.mobileHintStylesGetAnotherHintButton),
|
|
45744
45785
|
onClick: evt => {
|