@khanacademy/perseus 20.0.2 → 20.2.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/graph.d.ts +1 -2
- package/dist/components/prop-check-box.d.ts +2 -0
- package/dist/es/index.css +71 -2
- package/dist/es/index.js +305 -187
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +71 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +289 -176
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +1 -0
- package/dist/util.d.ts +1 -0
- package/dist/widgets/interactive-graphs/graph-locked-layer.d.ts +7 -0
- package/dist/widgets/interactive-graphs/movable-point.d.ts +8 -0
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -31,9 +31,11 @@ var Banner = require('@khanacademy/wonder-blocks-banner');
|
|
|
31
31
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
32
32
|
var debounce$1 = require('lodash.debounce');
|
|
33
33
|
var mafs = require('mafs');
|
|
34
|
+
var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
|
|
35
|
+
var questionIcon = require('@phosphor-icons/core/regular/question.svg');
|
|
36
|
+
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
34
37
|
var createReactClass = require('create-react-class');
|
|
35
38
|
var Switch = require('@khanacademy/wonder-blocks-switch');
|
|
36
|
-
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
37
39
|
var Pill = require('@khanacademy/wonder-blocks-pill');
|
|
38
40
|
var reactPopper = require('react-popper');
|
|
39
41
|
var Link = require('@khanacademy/wonder-blocks-link');
|
|
@@ -78,6 +80,7 @@ var SimpleMarkdown__default = /*#__PURE__*/_interopDefaultLegacy(SimpleMarkdown)
|
|
|
78
80
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
79
81
|
var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
|
|
80
82
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce$1);
|
|
83
|
+
var questionIcon__default = /*#__PURE__*/_interopDefaultLegacy(questionIcon);
|
|
81
84
|
var createReactClass__default = /*#__PURE__*/_interopDefaultLegacy(createReactClass);
|
|
82
85
|
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
83
86
|
var Pill__default = /*#__PURE__*/_interopDefaultLegacy(Pill);
|
|
@@ -294,7 +297,7 @@ class MathInput extends React__namespace.Component {
|
|
|
294
297
|
className = className + " " + this.props.className;
|
|
295
298
|
}
|
|
296
299
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
297
|
-
style: [styles$
|
|
300
|
+
style: [styles$D.outerWrapper, this.state.focused && styles$D.wrapperFocused, this.props.hasError && styles$D.wrapperError]
|
|
298
301
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
299
302
|
style: {
|
|
300
303
|
display: "flex",
|
|
@@ -325,7 +328,7 @@ class MathInput extends React__namespace.Component {
|
|
|
325
328
|
dismissEnabled: true,
|
|
326
329
|
content: () => /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
|
|
327
330
|
closeButtonVisible: true,
|
|
328
|
-
style: styles$
|
|
331
|
+
style: styles$D.popoverContent
|
|
329
332
|
}, /*#__PURE__*/React__namespace.createElement(mathInput.DesktopKeypad, _extends({
|
|
330
333
|
onAnalyticsEvent: this.props.analytics.onAnalyticsEvent,
|
|
331
334
|
extraKeys: this.props.extraKeys,
|
|
@@ -365,9 +368,9 @@ const MathInputIcon = _ref => {
|
|
|
365
368
|
color = Color__default["default"].offBlack;
|
|
366
369
|
break;
|
|
367
370
|
}
|
|
368
|
-
const dynamicClass = active || focused ? styles$
|
|
371
|
+
const dynamicClass = active || focused ? styles$D.iconActive : styles$D.iconInactive;
|
|
369
372
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
370
|
-
style: [styles$
|
|
373
|
+
style: [styles$D.iconContainer, dynamicClass]
|
|
371
374
|
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
372
375
|
xmlns: "http://www.w3.org/2000/svg",
|
|
373
376
|
width: "16",
|
|
@@ -412,7 +415,7 @@ const inputFocused = {
|
|
|
412
415
|
borderColor: Color__default["default"].blue,
|
|
413
416
|
margin: -1
|
|
414
417
|
};
|
|
415
|
-
const styles$
|
|
418
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
416
419
|
iconContainer: {
|
|
417
420
|
display: "flex",
|
|
418
421
|
justifyContent: "center",
|
|
@@ -2702,11 +2705,14 @@ function combineScores(scoreA, scoreB) {
|
|
|
2702
2705
|
}
|
|
2703
2706
|
});
|
|
2704
2707
|
}
|
|
2708
|
+
function isCorrect(score) {
|
|
2709
|
+
return score.type === "points" && score.earned >= score.total;
|
|
2710
|
+
}
|
|
2705
2711
|
function keScoreFromPerseusScore(score, guess, state) {
|
|
2706
2712
|
if (score.type === "points") {
|
|
2707
2713
|
return {
|
|
2708
2714
|
empty: false,
|
|
2709
|
-
correct: score
|
|
2715
|
+
correct: isCorrect(score),
|
|
2710
2716
|
message: score.message,
|
|
2711
2717
|
guess: guess,
|
|
2712
2718
|
state: state
|
|
@@ -14998,7 +15004,7 @@ const DEFAULT_STATE$1 = {
|
|
|
14998
15004
|
// TODO(benchristel): this is a memory leak. We add items to
|
|
14999
15005
|
// tooltipResetFunctions, but never remove them.
|
|
15000
15006
|
const tooltipResetFunctions = [];
|
|
15001
|
-
class MovablePoint$
|
|
15007
|
+
class MovablePoint$5 {
|
|
15002
15008
|
// @ts-expect-error - TS2564: Property 'prevState' has no initializer and is not definitely assigned in the constructor.
|
|
15003
15009
|
|
|
15004
15010
|
_listenerMap = {};
|
|
@@ -16126,10 +16132,10 @@ ___default["default"].extend(MovablePolygon.prototype, {
|
|
|
16126
16132
|
});
|
|
16127
16133
|
|
|
16128
16134
|
const Interactive2 = {
|
|
16129
|
-
MovablePoint: MovablePoint$
|
|
16135
|
+
MovablePoint: MovablePoint$5,
|
|
16130
16136
|
addMovablePoint: function (graphie, options) {
|
|
16131
16137
|
const movable = new Movable(graphie, {});
|
|
16132
|
-
return new MovablePoint$
|
|
16138
|
+
return new MovablePoint$5(graphie, movable, options);
|
|
16133
16139
|
},
|
|
16134
16140
|
MovableLine: MovableLine$3,
|
|
16135
16141
|
addMovableLine: function (graphie, options) {
|
|
@@ -16171,7 +16177,7 @@ const Interactive2 = {
|
|
|
16171
16177
|
}
|
|
16172
16178
|
};
|
|
16173
16179
|
|
|
16174
|
-
const MovablePoint$
|
|
16180
|
+
const MovablePoint$4 = GraphieClasses.createClass({
|
|
16175
16181
|
displayName: "MovablePoint",
|
|
16176
16182
|
movableProps: ["children"],
|
|
16177
16183
|
_getProps: function () {
|
|
@@ -16229,7 +16235,7 @@ const MovablePoint$3 = GraphieClasses.createClass({
|
|
|
16229
16235
|
});
|
|
16230
16236
|
|
|
16231
16237
|
// Include helper methods, such as MovablePoint.constrain.snap()
|
|
16232
|
-
___default["default"].extend(MovablePoint$
|
|
16238
|
+
___default["default"].extend(MovablePoint$4, Interactive2.MovablePoint);
|
|
16233
16239
|
const MovableLine$2 = GraphieClasses.createClass({
|
|
16234
16240
|
displayName: "MovableLine",
|
|
16235
16241
|
movableProps: ["children"],
|
|
@@ -16399,7 +16405,7 @@ var Movables = {
|
|
|
16399
16405
|
Label: Label$1,
|
|
16400
16406
|
Line: Line$2,
|
|
16401
16407
|
MovableLine: MovableLine$2,
|
|
16402
|
-
MovablePoint: MovablePoint$
|
|
16408
|
+
MovablePoint: MovablePoint$4,
|
|
16403
16409
|
Parabola: Parabola,
|
|
16404
16410
|
Path: Path,
|
|
16405
16411
|
Plot: Plot$2,
|
|
@@ -17931,33 +17937,33 @@ class Lint extends React__namespace.Component {
|
|
|
17931
17937
|
let warningText;
|
|
17932
17938
|
let warningTextStyle;
|
|
17933
17939
|
if (this.props.severity === Severity.Error) {
|
|
17934
|
-
severityStyle = styles$
|
|
17940
|
+
severityStyle = styles$C.indicatorError;
|
|
17935
17941
|
warningText = "Error";
|
|
17936
|
-
warningTextStyle = styles$
|
|
17942
|
+
warningTextStyle = styles$C.publishBlockingError;
|
|
17937
17943
|
} else if (this.props.severity === Severity.Warning) {
|
|
17938
|
-
severityStyle = styles$
|
|
17944
|
+
severityStyle = styles$C.indicatorWarning;
|
|
17939
17945
|
warningText = "Warning";
|
|
17940
|
-
warningTextStyle = styles$
|
|
17946
|
+
warningTextStyle = styles$C.warning;
|
|
17941
17947
|
} else {
|
|
17942
|
-
severityStyle = styles$
|
|
17948
|
+
severityStyle = styles$C.indicatorGuideline;
|
|
17943
17949
|
warningText = "Recommendation";
|
|
17944
|
-
warningTextStyle = styles$
|
|
17950
|
+
warningTextStyle = styles$C.warning;
|
|
17945
17951
|
}
|
|
17946
17952
|
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
17947
17953
|
href: `https://khanacademy.org/r/linter-rules#${this.props.ruleName}`,
|
|
17948
17954
|
target: "lint-help-window",
|
|
17949
17955
|
className: aphrodite.css(style)
|
|
17950
17956
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17951
|
-
className: aphrodite.css(styles$
|
|
17957
|
+
className: aphrodite.css(styles$C.indicator, severityStyle)
|
|
17952
17958
|
}, this.props.severity === 1 && /*#__PURE__*/React__namespace.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17953
|
-
className: aphrodite.css(styles$
|
|
17959
|
+
className: aphrodite.css(styles$C.tooltip, tooltipAbove && styles$C.tooltipAbove)
|
|
17954
17960
|
}, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React__namespace.createElement("p", {
|
|
17955
17961
|
key: i,
|
|
17956
|
-
className: aphrodite.css(styles$
|
|
17962
|
+
className: aphrodite.css(styles$C.tooltipParagraph)
|
|
17957
17963
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17958
17964
|
className: aphrodite.css(warningTextStyle)
|
|
17959
17965
|
}, warningText, ":", " "), m)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17960
|
-
className: aphrodite.css(styles$
|
|
17966
|
+
className: aphrodite.css(styles$C.tail, tooltipAbove && styles$C.tailAbove)
|
|
17961
17967
|
})));
|
|
17962
17968
|
};
|
|
17963
17969
|
|
|
@@ -17985,20 +17991,20 @@ class Lint extends React__namespace.Component {
|
|
|
17985
17991
|
}
|
|
17986
17992
|
if (blockHighlight) {
|
|
17987
17993
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17988
|
-
className: aphrodite.css(styles$
|
|
17989
|
-
}, this.renderLink(styles$
|
|
17994
|
+
className: aphrodite.css(styles$C.lintContainer, styles$C.lintContainerBlock)
|
|
17995
|
+
}, this.renderLink(styles$C.radioWidgetHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17990
17996
|
}
|
|
17991
17997
|
if (inline) {
|
|
17992
17998
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17993
|
-
className: aphrodite.css(styles$
|
|
17994
|
-
}, this.renderLink(styles$
|
|
17999
|
+
className: aphrodite.css(styles$C.lintContainer)
|
|
18000
|
+
}, this.renderLink(styles$C.inlineHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17995
18001
|
}
|
|
17996
18002
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
17997
|
-
className: aphrodite.css(styles$
|
|
17998
|
-
}, this.renderLink(styles$
|
|
18003
|
+
className: aphrodite.css(styles$C.lintContainer)
|
|
18004
|
+
}, this.renderLink(styles$C.hoverTarget), /*#__PURE__*/React__namespace.createElement("div", null, children));
|
|
17999
18005
|
}
|
|
18000
18006
|
}
|
|
18001
|
-
const styles$
|
|
18007
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
18002
18008
|
// This is the class of the outermost element.
|
|
18003
18009
|
// We use relative positioning so that the lint indicator can be
|
|
18004
18010
|
// positioned absolutely relative to the position of the linty container.
|
|
@@ -20122,7 +20128,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20122
20128
|
};
|
|
20123
20129
|
const mobileInnerStyle = {
|
|
20124
20130
|
...innerStyle,
|
|
20125
|
-
...styles$
|
|
20131
|
+
...styles$B.mobileZoomableParentFix
|
|
20126
20132
|
};
|
|
20127
20133
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20128
20134
|
key: state.key,
|
|
@@ -20259,7 +20265,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20259
20265
|
};
|
|
20260
20266
|
const mobileInnerStyle = {
|
|
20261
20267
|
...innerStyle,
|
|
20262
|
-
...styles$
|
|
20268
|
+
...styles$B.mobileZoomableParentFix
|
|
20263
20269
|
};
|
|
20264
20270
|
const wrappedOutput = /*#__PURE__*/React__namespace.createElement("div", {
|
|
20265
20271
|
style: {
|
|
@@ -20767,7 +20773,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20767
20773
|
return this.lastRenderedMarkdown;
|
|
20768
20774
|
}
|
|
20769
20775
|
}
|
|
20770
|
-
const styles$
|
|
20776
|
+
const styles$B = {
|
|
20771
20777
|
mobileZoomableParentFix: {
|
|
20772
20778
|
// NOTE(abdul): There is an issue where transform animations will
|
|
20773
20779
|
// cause the Zoomable component to disappear when running on the
|
|
@@ -21702,10 +21708,10 @@ class InputNumber extends React__namespace.Component {
|
|
|
21702
21708
|
// Note: This is _very_ similar to what `numeric-input.jsx` does. If
|
|
21703
21709
|
// you modify this, double-check if you also need to modify that
|
|
21704
21710
|
// component.
|
|
21705
|
-
const inputStyles = [styles$
|
|
21711
|
+
const inputStyles = [styles$A.default, this.props.size === "small" ? styles$A.small : null, this.props.rightAlign ? styles$A.rightAlign : styles$A.leftAlign];
|
|
21706
21712
|
// Unanswered
|
|
21707
21713
|
if (rubric && !this.props.currentValue) {
|
|
21708
|
-
inputStyles.push(styles$
|
|
21714
|
+
inputStyles.push(styles$A.answerStateUnanswered);
|
|
21709
21715
|
}
|
|
21710
21716
|
return /*#__PURE__*/React__namespace.createElement(InputWithExamples
|
|
21711
21717
|
// eslint-disable-next-line react/no-string-refs
|
|
@@ -21844,7 +21850,7 @@ class InputNumber extends React__namespace.Component {
|
|
|
21844
21850
|
return answerString;
|
|
21845
21851
|
}
|
|
21846
21852
|
}
|
|
21847
|
-
const styles$
|
|
21853
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
21848
21854
|
default: {
|
|
21849
21855
|
width: 80,
|
|
21850
21856
|
height: "auto"
|
|
@@ -22833,7 +22839,7 @@ const FocusRing = function (props) {
|
|
|
22833
22839
|
};
|
|
22834
22840
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
22835
22841
|
"data-test-id": "focus-ring",
|
|
22836
|
-
className: aphrodite.css(styles$
|
|
22842
|
+
className: aphrodite.css(styles$z.ring),
|
|
22837
22843
|
style: style
|
|
22838
22844
|
}, children);
|
|
22839
22845
|
};
|
|
@@ -22842,7 +22848,7 @@ FocusRing.defaultProps = {
|
|
|
22842
22848
|
color: kaGreen$1,
|
|
22843
22849
|
multipleSelect: false
|
|
22844
22850
|
};
|
|
22845
|
-
const styles$
|
|
22851
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
22846
22852
|
ring: {
|
|
22847
22853
|
margin: "auto",
|
|
22848
22854
|
display: "inline-block",
|
|
@@ -22879,7 +22885,7 @@ function getChoiceLetter(pos) {
|
|
|
22879
22885
|
}
|
|
22880
22886
|
|
|
22881
22887
|
const CHOICE_ICON_SIZE = 24;
|
|
22882
|
-
const styles$
|
|
22888
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
22883
22889
|
iconWrapper: {
|
|
22884
22890
|
display: "inline-block",
|
|
22885
22891
|
position: "relative"
|
|
@@ -22902,7 +22908,7 @@ const CrossOutLine = function (props) {
|
|
|
22902
22908
|
width: CROSS_OUT_LINE_SIZE,
|
|
22903
22909
|
height: CROSS_OUT_LINE_SIZE,
|
|
22904
22910
|
viewBox: `0 0 ${CROSS_OUT_LINE_SIZE} ${CROSS_OUT_LINE_SIZE}`,
|
|
22905
|
-
className: aphrodite.css(styles$
|
|
22911
|
+
className: aphrodite.css(styles$x.crossOutLine),
|
|
22906
22912
|
"data-test-id": "choice-icon__cross-out-line"
|
|
22907
22913
|
}, /*#__PURE__*/React__namespace.createElement("line", {
|
|
22908
22914
|
// The line stretches from the bottom-left to top-right.
|
|
@@ -22917,7 +22923,7 @@ const CrossOutLine = function (props) {
|
|
|
22917
22923
|
strokeLinecap: "round"
|
|
22918
22924
|
}));
|
|
22919
22925
|
};
|
|
22920
|
-
const styles$
|
|
22926
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
22921
22927
|
crossOutLine: {
|
|
22922
22928
|
// Center the icon within the container.
|
|
22923
22929
|
position: "absolute",
|
|
@@ -22998,7 +23004,7 @@ const ChoiceIcon = function (props) {
|
|
|
22998
23004
|
} = props;
|
|
22999
23005
|
const dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct);
|
|
23000
23006
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23001
|
-
className: aphrodite.css(styles$
|
|
23007
|
+
className: aphrodite.css(styles$y.iconWrapper)
|
|
23002
23008
|
}, /*#__PURE__*/React__namespace.createElement(FocusRing, {
|
|
23003
23009
|
color: Color__default["default"].blue,
|
|
23004
23010
|
visible: focused || hovered,
|
|
@@ -23007,13 +23013,13 @@ const ChoiceIcon = function (props) {
|
|
|
23007
23013
|
// @ts-expect-error - TS2322 - Type '{ backgroundColor: string | null | undefined; borderColor: string; color: string; borderRadius: number; }' is not assignable to type 'Properties<string | number, string & {}>'.
|
|
23008
23014
|
style: dynamicStyles,
|
|
23009
23015
|
"data-test-id": "choice-icon__library-choice-icon",
|
|
23010
|
-
className: aphrodite.css(styles$
|
|
23016
|
+
className: aphrodite.css(styles$w.circle, showCorrectness && correct && styles$w.circleCorrect, showCorrectness && !correct && styles$w.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$w.circleIncorrectAnswered)
|
|
23011
23017
|
// used in BaseRadio editMode to check
|
|
23012
23018
|
// if we actually clicked on the radio icon
|
|
23013
23019
|
,
|
|
23014
23020
|
"data-is-radio-icon": true
|
|
23015
23021
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
23016
|
-
className: aphrodite.css(styles$
|
|
23022
|
+
className: aphrodite.css(styles$w.innerWrapper)
|
|
23017
23023
|
}, /*#__PURE__*/React__namespace.createElement(ChoiceInner, {
|
|
23018
23024
|
pos: pos,
|
|
23019
23025
|
showCorrectness: showCorrectness,
|
|
@@ -23022,7 +23028,7 @@ const ChoiceIcon = function (props) {
|
|
|
23022
23028
|
color: dynamicStyles.borderColor
|
|
23023
23029
|
}));
|
|
23024
23030
|
};
|
|
23025
|
-
const styles$
|
|
23031
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
23026
23032
|
innerWrapper: {
|
|
23027
23033
|
width: CHOICE_ICON_SIZE,
|
|
23028
23034
|
height: CHOICE_ICON_SIZE,
|
|
@@ -23114,19 +23120,19 @@ const OptionStatus = function (props) {
|
|
|
23114
23120
|
}
|
|
23115
23121
|
let textStyle;
|
|
23116
23122
|
if (correct) {
|
|
23117
|
-
textStyle = styles$
|
|
23123
|
+
textStyle = styles$v.correct;
|
|
23118
23124
|
} else {
|
|
23119
23125
|
if (checked || previouslyAnswered) {
|
|
23120
|
-
textStyle = styles$
|
|
23126
|
+
textStyle = styles$v.incorrectAnswered;
|
|
23121
23127
|
} else {
|
|
23122
|
-
textStyle = styles$
|
|
23128
|
+
textStyle = styles$v.incorrect;
|
|
23123
23129
|
}
|
|
23124
23130
|
}
|
|
23125
23131
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23126
|
-
className: aphrodite.css(styles$
|
|
23132
|
+
className: aphrodite.css(styles$v.text, textStyle)
|
|
23127
23133
|
}, renderText(checked, correct, crossedOut));
|
|
23128
23134
|
};
|
|
23129
|
-
const styles$
|
|
23135
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
23130
23136
|
text: {
|
|
23131
23137
|
alignItems: "center",
|
|
23132
23138
|
display: "flex",
|
|
@@ -23200,8 +23206,8 @@ const Choice = function (props) {
|
|
|
23200
23206
|
crossedOut: updatedCrossedOut
|
|
23201
23207
|
});
|
|
23202
23208
|
}
|
|
23203
|
-
const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$
|
|
23204
|
-
const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$
|
|
23209
|
+
const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$u.description));
|
|
23210
|
+
const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$u.rationale));
|
|
23205
23211
|
|
|
23206
23212
|
// We want to show the choices as dimmed out when the choices are disabled.
|
|
23207
23213
|
// However, we don't want to do this when we're in review mode in the
|
|
@@ -23372,7 +23378,7 @@ const Choice = function (props) {
|
|
|
23372
23378
|
"data-test-id": `perseus-radio-rationale-content-${pos}`
|
|
23373
23379
|
}, rationale));
|
|
23374
23380
|
};
|
|
23375
|
-
const styles$
|
|
23381
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
23376
23382
|
description: {
|
|
23377
23383
|
display: "inline-block",
|
|
23378
23384
|
width: "100%"
|
|
@@ -23564,10 +23570,10 @@ const BaseRadio = function (props) {
|
|
|
23564
23570
|
const isMobile = apiOptions.isMobile;
|
|
23565
23571
|
const firstChoiceHighlighted = choices[0].highlighted;
|
|
23566
23572
|
const lastChoiceHighlighted = choices[choices.length - 1].highlighted;
|
|
23567
|
-
const className = classNames__default["default"]("perseus-widget-radio", !editMode && "perseus-rendered-radio", aphrodite.css(styles$
|
|
23568
|
-
const instructionsClassName = classNames__default["default"]("instructions", aphrodite.css(styles$
|
|
23573
|
+
const className = classNames__default["default"]("perseus-widget-radio", !editMode && "perseus-rendered-radio", aphrodite.css(styles$t.radio, styles$t.responsiveRadioContainer, firstChoiceHighlighted && isMobile && styles$t.radioContainerFirstHighlighted, lastChoiceHighlighted && isMobile && styles$t.radioContainerLastHighlighted));
|
|
23574
|
+
const instructionsClassName = classNames__default["default"]("instructions", aphrodite.css(styles$t.instructions, isMobile && styles$t.instructionsMobile));
|
|
23569
23575
|
const instructions = getInstructionsText(multipleSelect, countChoices, numCorrect);
|
|
23570
|
-
const responsiveClassName = aphrodite.css(styles$
|
|
23576
|
+
const responsiveClassName = aphrodite.css(styles$t.responsiveFieldset);
|
|
23571
23577
|
const fieldset = /*#__PURE__*/React__namespace.createElement("fieldset", {
|
|
23572
23578
|
className: `perseus-widget-radio-fieldset ${responsiveClassName}`
|
|
23573
23579
|
}, /*#__PURE__*/React__namespace.createElement("legend", {
|
|
@@ -23618,7 +23624,7 @@ const BaseRadio = function (props) {
|
|
|
23618
23624
|
const aphroditeClassName = checked => {
|
|
23619
23625
|
// Whether or not to show correctness borders
|
|
23620
23626
|
// for this choice and the next choice.
|
|
23621
|
-
return aphrodite.css(sharedStyles.aboveScratchpad, styles$
|
|
23627
|
+
return aphrodite.css(sharedStyles.aboveScratchpad, styles$t.item, styles$t.responsiveItem, checked && styles$t.selectedItem, checked && choice.highlighted && styles$t.aboveBackdrop, checked && choice.highlighted && apiOptions.isMobile && styles$t.aboveBackdropMobile, nextChoiceHighlighted && apiOptions.isMobile && styles$t.nextHighlighted);
|
|
23622
23628
|
};
|
|
23623
23629
|
|
|
23624
23630
|
// HACK(abdulrahman): Preloads the selection-state
|
|
@@ -23692,14 +23698,14 @@ const BaseRadio = function (props) {
|
|
|
23692
23698
|
// Allow for horizontal scrolling if content is too wide, which may be
|
|
23693
23699
|
// an issue especially on phones.
|
|
23694
23700
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23695
|
-
className: aphrodite.css(styles$
|
|
23701
|
+
className: aphrodite.css(styles$t.responsiveContainer)
|
|
23696
23702
|
}, fieldset);
|
|
23697
23703
|
};
|
|
23698
23704
|
BaseRadio.defaultProps = {
|
|
23699
23705
|
editMode: false,
|
|
23700
23706
|
multipleSelect: false
|
|
23701
23707
|
};
|
|
23702
|
-
const styles$
|
|
23708
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
23703
23709
|
instructions: {
|
|
23704
23710
|
display: "block",
|
|
23705
23711
|
color: gray17,
|
|
@@ -24358,9 +24364,9 @@ class Categorizer extends React__namespace.Component {
|
|
|
24358
24364
|
indexedItems = Util.shuffle(indexedItems, this.props.problemNum);
|
|
24359
24365
|
}
|
|
24360
24366
|
const table = /*#__PURE__*/React__namespace.createElement("table", {
|
|
24361
|
-
className: "categorizer-table " + aphrodite.css(styles$
|
|
24367
|
+
className: "categorizer-table " + aphrodite.css(styles$s.mobileTable)
|
|
24362
24368
|
}, /*#__PURE__*/React__namespace.createElement("thead", null, /*#__PURE__*/React__namespace.createElement("tr", null, /*#__PURE__*/React__namespace.createElement("td", {
|
|
24363
|
-
className: aphrodite.css(styles$
|
|
24369
|
+
className: aphrodite.css(styles$s.emptyHeaderCell)
|
|
24364
24370
|
}), this.props.categories.map((category, i) => {
|
|
24365
24371
|
// Array index is the correct key here, as that's
|
|
24366
24372
|
// how category grading actually works -- no way
|
|
@@ -24368,7 +24374,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24368
24374
|
// middle. (If we later add that, this should be
|
|
24369
24375
|
// fixed.)
|
|
24370
24376
|
return /*#__PURE__*/React__namespace.createElement("th", {
|
|
24371
|
-
className: aphrodite.css(styles$
|
|
24377
|
+
className: aphrodite.css(styles$s.header),
|
|
24372
24378
|
key: i
|
|
24373
24379
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
24374
24380
|
content: category,
|
|
@@ -24388,7 +24394,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24388
24394
|
})), self.props.categories.map((catName, catNum) => {
|
|
24389
24395
|
const selected = self.props.values[itemNum] === catNum;
|
|
24390
24396
|
return /*#__PURE__*/React__namespace.createElement("td", {
|
|
24391
|
-
className: "category " + aphrodite.css(styles$
|
|
24397
|
+
className: "category " + aphrodite.css(styles$s.cell),
|
|
24392
24398
|
key: catNum
|
|
24393
24399
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24394
24400
|
className: ClassNames.INTERACTIVE,
|
|
@@ -24403,7 +24409,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24403
24409
|
onChange: () => this.onChange(itemNum, catNum),
|
|
24404
24410
|
onClick: e => e.stopPropagation()
|
|
24405
24411
|
}), !isMobile && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24406
|
-
className: aphrodite.css(styles$
|
|
24412
|
+
className: aphrodite.css(styles$s.radioSpan, selected && styles$s.checkedRadioSpan, this.props.static && selected && styles$s.staticCheckedRadioSpan)
|
|
24407
24413
|
}, selected ? /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircle) : /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircleThin))));
|
|
24408
24414
|
}));
|
|
24409
24415
|
/* eslint-enable max-len */
|
|
@@ -24415,7 +24421,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24415
24421
|
"categorizer-container": true,
|
|
24416
24422
|
"static-mode": this.props.static
|
|
24417
24423
|
});
|
|
24418
|
-
const inlineStyles = this.props.apiOptions.isMobile ? [styles$
|
|
24424
|
+
const inlineStyles = this.props.apiOptions.isMobile ? [styles$s.fullBleedContainer] : [];
|
|
24419
24425
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24420
24426
|
className: extraClassNames + " " + aphrodite.css(...inlineStyles)
|
|
24421
24427
|
}, table);
|
|
@@ -24464,7 +24470,7 @@ const pageMargin = 16;
|
|
|
24464
24470
|
|
|
24465
24471
|
// Stylesheets aren't directly testable
|
|
24466
24472
|
/* c8 ignore next */
|
|
24467
|
-
const styles$
|
|
24473
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
24468
24474
|
mobileTable: {
|
|
24469
24475
|
[mediaQueries.smOrSmaller]: {
|
|
24470
24476
|
minWidth: "auto"
|
|
@@ -24727,7 +24733,7 @@ class CSProgram extends React__namespace.Component {
|
|
|
24727
24733
|
// creator "went wild".
|
|
24728
24734
|
// http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
|
|
24729
24735
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24730
|
-
className: aphrodite.css(styles$
|
|
24736
|
+
className: aphrodite.css(styles$r.widthOverride, styleContainer && styles$r.container)
|
|
24731
24737
|
}, /*#__PURE__*/React__namespace.createElement("iframe", {
|
|
24732
24738
|
sandbox: sandboxOptions,
|
|
24733
24739
|
src: url,
|
|
@@ -24737,7 +24743,7 @@ class CSProgram extends React__namespace.Component {
|
|
|
24737
24743
|
}));
|
|
24738
24744
|
}
|
|
24739
24745
|
}
|
|
24740
|
-
const styles$
|
|
24746
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
24741
24747
|
// Override the inherited width from the perseus paragraph class
|
|
24742
24748
|
// 820 is minimum width for 420px editor and 400px canvas
|
|
24743
24749
|
widthOverride: {
|
|
@@ -24785,7 +24791,7 @@ class Definition extends React__namespace.Component {
|
|
|
24785
24791
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.Popover, {
|
|
24786
24792
|
content: /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
|
|
24787
24793
|
color: "white",
|
|
24788
|
-
style: styles$
|
|
24794
|
+
style: styles$q.tooltipBody,
|
|
24789
24795
|
closeButtonVisible: true
|
|
24790
24796
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
24791
24797
|
apiOptions: this.props.apiOptions,
|
|
@@ -24816,7 +24822,7 @@ class Definition extends React__namespace.Component {
|
|
|
24816
24822
|
});
|
|
24817
24823
|
}
|
|
24818
24824
|
}
|
|
24819
|
-
const styles$
|
|
24825
|
+
const styles$q = {
|
|
24820
24826
|
tooltipBody: {
|
|
24821
24827
|
color: Color__default["default"].offBlack,
|
|
24822
24828
|
fontSize: 20,
|
|
@@ -25017,15 +25023,15 @@ class Explanation extends React__namespace.Component {
|
|
|
25017
25023
|
const onClick = this._onClick;
|
|
25018
25024
|
if (isMobile) {
|
|
25019
25025
|
promptContainer = /*#__PURE__*/React__namespace.createElement("div", {
|
|
25020
|
-
className: aphrodite.css(styles$
|
|
25026
|
+
className: aphrodite.css(styles$p.linkContainer)
|
|
25021
25027
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
25022
|
-
className: aphrodite.css(styles$
|
|
25028
|
+
className: aphrodite.css(styles$p.mobileExplanationLink),
|
|
25023
25029
|
href: href,
|
|
25024
25030
|
onClick: onClick,
|
|
25025
25031
|
role: "button",
|
|
25026
25032
|
"aria-expanded": this.state.expanded
|
|
25027
25033
|
}, promptText), this.state.expanded && /*#__PURE__*/React__namespace.createElement("svg", {
|
|
25028
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$p.disclosureArrow)
|
|
25029
25035
|
}, /*#__PURE__*/React__namespace.createElement("polygon", {
|
|
25030
25036
|
style: {
|
|
25031
25037
|
fill: backgroundColor
|
|
@@ -25033,7 +25039,7 @@ class Explanation extends React__namespace.Component {
|
|
|
25033
25039
|
points: `0,${arrowHeight} ` + `${arrowWidth},${arrowHeight} ` + `${arrowWidth / 2},0`
|
|
25034
25040
|
})));
|
|
25035
25041
|
} else {
|
|
25036
|
-
const viewStyling = isArticle ? [styles$
|
|
25042
|
+
const viewStyling = isArticle ? [styles$p.explanationLink, styles$p.articleLink] : [styles$p.explanationLink, styles$p.exerciseLink];
|
|
25037
25043
|
promptContainer = /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
25038
25044
|
onClick: onClick,
|
|
25039
25045
|
"aria-expanded": this.state.expanded
|
|
@@ -25041,11 +25047,11 @@ class Explanation extends React__namespace.Component {
|
|
|
25041
25047
|
style: viewStyling
|
|
25042
25048
|
}, `[${promptText}]`));
|
|
25043
25049
|
}
|
|
25044
|
-
const expandedStyle = isMobile ? styles$
|
|
25050
|
+
const expandedStyle = isMobile ? styles$p.contentExpandedMobile : styles$p.contentExpanded;
|
|
25045
25051
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25046
|
-
className: aphrodite.css(styles$
|
|
25052
|
+
className: aphrodite.css(styles$p.container)
|
|
25047
25053
|
}, promptContainer, this.state.expanded && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25048
|
-
className: aphrodite.css(styles$
|
|
25054
|
+
className: aphrodite.css(styles$p.content, isMobile && styles$p.contentMobile, this.state.expanded && expandedStyle)
|
|
25049
25055
|
// eslint-disable-next-line react/no-string-refs
|
|
25050
25056
|
,
|
|
25051
25057
|
ref: "content"
|
|
@@ -25068,7 +25074,7 @@ const verticalContentPadding = 10;
|
|
|
25068
25074
|
const arrowWidth = 30;
|
|
25069
25075
|
const arrowHeight = 14;
|
|
25070
25076
|
const backgroundColor = gray95;
|
|
25071
|
-
const styles$
|
|
25077
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
25072
25078
|
container: {
|
|
25073
25079
|
display: "inline",
|
|
25074
25080
|
position: "relative"
|
|
@@ -25174,15 +25180,15 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25174
25180
|
onNextQuestion
|
|
25175
25181
|
} = this.props;
|
|
25176
25182
|
const answerBarStyle = {
|
|
25177
|
-
...styles$
|
|
25183
|
+
...styles$o.answerBar,
|
|
25178
25184
|
backgroundColor: answerBarState === "CORRECT" ? Color__default["default"].offWhite : "white",
|
|
25179
25185
|
// Center the "Correct!" message only when there's no next question
|
|
25180
25186
|
justifyContent: answerBarState === "CORRECT" && !onNextQuestion ? "center" : "space-between"
|
|
25181
25187
|
};
|
|
25182
25188
|
const message = answerBarState === "INCORRECT" ? /*#__PURE__*/React__namespace.createElement("span", {
|
|
25183
|
-
style: styles$
|
|
25189
|
+
style: styles$o.text
|
|
25184
25190
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25185
|
-
style: styles$
|
|
25191
|
+
style: styles$o.tryAgainIcon
|
|
25186
25192
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconTryAgain)), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25187
25193
|
style: {
|
|
25188
25194
|
marginLeft: 8
|
|
@@ -25201,7 +25207,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25201
25207
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25202
25208
|
style: answerBarStyle
|
|
25203
25209
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25204
|
-
style: styles$
|
|
25210
|
+
style: styles$o.text
|
|
25205
25211
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25206
25212
|
style: {
|
|
25207
25213
|
fontSize: 28,
|
|
@@ -25223,7 +25229,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25223
25229
|
}
|
|
25224
25230
|
}
|
|
25225
25231
|
const fontSize = 17;
|
|
25226
|
-
const styles$
|
|
25232
|
+
const styles$o = {
|
|
25227
25233
|
answerBar: {
|
|
25228
25234
|
display: "flex",
|
|
25229
25235
|
alignItems: "center",
|
|
@@ -25423,7 +25429,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25423
25429
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'null'.
|
|
25424
25430
|
gradeStatus = i18n__namespace._("Incorrect");
|
|
25425
25431
|
}
|
|
25426
|
-
const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$
|
|
25432
|
+
const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$n.gradedGroupInSet) : aphrodite.css(styles$n.gradedGroup);
|
|
25427
25433
|
const classes = classNames__default["default"]({
|
|
25428
25434
|
[mobileClass]: apiOptions.isMobile,
|
|
25429
25435
|
"perseus-graded-group": true,
|
|
@@ -25442,7 +25448,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25442
25448
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25443
25449
|
className: classes
|
|
25444
25450
|
}, !!this.props.title && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25445
|
-
className: aphrodite.css(styles$
|
|
25451
|
+
className: aphrodite.css(styles$n.title)
|
|
25446
25452
|
}, this.props.title), /*#__PURE__*/React__namespace.createElement(Renderer, _extends({}, this.props, {
|
|
25447
25453
|
// eslint-disable-next-line react/no-string-refs
|
|
25448
25454
|
ref: "renderer",
|
|
@@ -25475,7 +25481,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25475
25481
|
}, i18n__namespace._("Next question")), this.props.hint && this.props.hint.content && (this.state.showHint ? /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
|
|
25476
25482
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'number | undefined'.
|
|
25477
25483
|
tabIndex: "0",
|
|
25478
|
-
className: aphrodite.css(styles$
|
|
25484
|
+
className: aphrodite.css(styles$n.explanationTitle),
|
|
25479
25485
|
onClick: () => this.setState({
|
|
25480
25486
|
showHint: false
|
|
25481
25487
|
}),
|
|
@@ -25507,7 +25513,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25507
25513
|
showHint: true
|
|
25508
25514
|
});
|
|
25509
25515
|
},
|
|
25510
|
-
className: aphrodite.css(styles$
|
|
25516
|
+
className: aphrodite.css(styles$n.showHintLink)
|
|
25511
25517
|
}, i18n__namespace._("Explain"))), apiOptions.isMobile && answerBarState !== "HIDDEN" && /*#__PURE__*/React__namespace.createElement(GradedGroupAnswerBar, {
|
|
25512
25518
|
apiOptions: apiOptions,
|
|
25513
25519
|
answerBarState: answerBarState,
|
|
@@ -25519,7 +25525,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25519
25525
|
const traverseChildWidgets$2 = function (props, traverseRenderer) {
|
|
25520
25526
|
return ___default["default"].extend({}, props, traverseRenderer(props));
|
|
25521
25527
|
};
|
|
25522
|
-
const styles$
|
|
25528
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
25523
25529
|
gradedGroupInSet: {
|
|
25524
25530
|
// Reset a few desktop-only styles that come from graded-group.less
|
|
25525
25531
|
marginLeft: 0,
|
|
@@ -25589,20 +25595,20 @@ class Indicators extends React__namespace.Component {
|
|
|
25589
25595
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
25590
25596
|
// reduntantly add class name for use in .less files--
|
|
25591
25597
|
// the styles object key gets hashed
|
|
25592
|
-
className: classNames__default["default"](aphrodite.css(styles$
|
|
25598
|
+
className: classNames__default["default"](aphrodite.css(styles$m.indicatorContainer), "indicatorContainer")
|
|
25593
25599
|
}, this.props.gradedGroups.map((_ref, i) => {
|
|
25594
25600
|
let {
|
|
25595
25601
|
title
|
|
25596
25602
|
} = _ref;
|
|
25597
25603
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
25598
|
-
className: aphrodite.css(styles$
|
|
25604
|
+
className: aphrodite.css(styles$m.indicator),
|
|
25599
25605
|
key: title
|
|
25600
25606
|
}, /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
25601
25607
|
role: "button",
|
|
25602
25608
|
"aria-label": i18n__namespace._("Skip to %(title)s", {
|
|
25603
25609
|
title
|
|
25604
25610
|
}),
|
|
25605
|
-
style: styles$
|
|
25611
|
+
style: styles$m.indicatorButton,
|
|
25606
25612
|
onClick: () => this.props.onChangeCurrentGroup(i),
|
|
25607
25613
|
onKeyDown: e => this.handleKeyDown(e, i)
|
|
25608
25614
|
}, _ref2 => {
|
|
@@ -25612,9 +25618,9 @@ class Indicators extends React__namespace.Component {
|
|
|
25612
25618
|
pressed
|
|
25613
25619
|
} = _ref2;
|
|
25614
25620
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
25615
|
-
style: [styles$
|
|
25621
|
+
style: [styles$m.indicatorDot, (hovered || focused || pressed) && styles$m.indicatorDotFocused]
|
|
25616
25622
|
}, i === this.props.currentGroup && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
25617
|
-
style: styles$
|
|
25623
|
+
style: styles$m.indicatorDotActive
|
|
25618
25624
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25619
25625
|
className: aphrodite.css(a11y.srOnly)
|
|
25620
25626
|
}, i18n__namespace._("Current"))));
|
|
@@ -25690,7 +25696,7 @@ class GradedGroupSet extends React__namespace.Component {
|
|
|
25690
25696
|
} = getDependencies();
|
|
25691
25697
|
if (JIPT.useJIPT && this.props.gradedGroups.length > 1) {
|
|
25692
25698
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25693
|
-
className: aphrodite.css(styles$
|
|
25699
|
+
className: aphrodite.css(styles$m.container)
|
|
25694
25700
|
}, this.props.gradedGroups.map((gradedGroup, i) => {
|
|
25695
25701
|
return (
|
|
25696
25702
|
/*#__PURE__*/
|
|
@@ -25713,13 +25719,13 @@ class GradedGroupSet extends React__namespace.Component {
|
|
|
25713
25719
|
const numGroups = this.props.gradedGroups.length;
|
|
25714
25720
|
const handleNextQuestion = this.state.currentGroup < numGroups - 1 ? this.handleNextQuestion : null;
|
|
25715
25721
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25716
|
-
className: aphrodite.css(styles$
|
|
25722
|
+
className: aphrodite.css(styles$m.container)
|
|
25717
25723
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25718
|
-
className: aphrodite.css(styles$
|
|
25724
|
+
className: aphrodite.css(styles$m.top)
|
|
25719
25725
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25720
|
-
className: aphrodite.css(styles$
|
|
25726
|
+
className: aphrodite.css(styles$m.title)
|
|
25721
25727
|
}, currentGroup.title), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25722
|
-
className: aphrodite.css(styles$
|
|
25728
|
+
className: aphrodite.css(styles$m.spacer)
|
|
25723
25729
|
}), /*#__PURE__*/React__namespace.createElement(Indicators, {
|
|
25724
25730
|
currentGroup: this.state.currentGroup,
|
|
25725
25731
|
gradedGroups: this.props.gradedGroups,
|
|
@@ -25757,7 +25763,7 @@ var GradedGroupSet$1 = {
|
|
|
25757
25763
|
tracking: "all",
|
|
25758
25764
|
isLintable: true
|
|
25759
25765
|
};
|
|
25760
|
-
const styles$
|
|
25766
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
25761
25767
|
top: {
|
|
25762
25768
|
display: "flex",
|
|
25763
25769
|
flexDirection: "row"
|
|
@@ -25862,7 +25868,7 @@ class ButtonGroup extends React__namespace.Component {
|
|
|
25862
25868
|
id: "" + i,
|
|
25863
25869
|
ref: "button" + i,
|
|
25864
25870
|
key: "" + i,
|
|
25865
|
-
className: aphrodite.css(styles$
|
|
25871
|
+
className: aphrodite.css(styles$l.buttonStyle, button.value === value && styles$l.selectedStyle),
|
|
25866
25872
|
onClick: () => this.toggleSelect(button.value)
|
|
25867
25873
|
}, button.content || "" + button.value);
|
|
25868
25874
|
});
|
|
@@ -25875,7 +25881,7 @@ class ButtonGroup extends React__namespace.Component {
|
|
|
25875
25881
|
}, buttons);
|
|
25876
25882
|
}
|
|
25877
25883
|
}
|
|
25878
|
-
const styles$
|
|
25884
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
25879
25885
|
buttonStyle: {
|
|
25880
25886
|
backgroundColor: "white",
|
|
25881
25887
|
border: "1px solid #ccc",
|
|
@@ -26479,7 +26485,7 @@ var util = /*#__PURE__*/Object.freeze({
|
|
|
26479
26485
|
});
|
|
26480
26486
|
|
|
26481
26487
|
// @ts-expect-error - TS2339 - Property 'MovablePoint' does not exist on type 'typeof Graphie'.
|
|
26482
|
-
const MovablePoint$
|
|
26488
|
+
const MovablePoint$3 = Graphie.MovablePoint;
|
|
26483
26489
|
// @ts-expect-error - TS2339 - Property 'MovableLine' does not exist on type 'typeof Graphie'.
|
|
26484
26490
|
const MovableLine$1 = Graphie.MovableLine;
|
|
26485
26491
|
function isFlipped(newCoord, oldCoord, line) {
|
|
@@ -26525,7 +26531,7 @@ class FunctionGrapher extends React__namespace.Component {
|
|
|
26525
26531
|
})();
|
|
26526
26532
|
render() {
|
|
26527
26533
|
const pointForCoord = (coord, i) => {
|
|
26528
|
-
return /*#__PURE__*/React__namespace.createElement(MovablePoint$
|
|
26534
|
+
return /*#__PURE__*/React__namespace.createElement(MovablePoint$3, {
|
|
26529
26535
|
key: i,
|
|
26530
26536
|
coord: coord,
|
|
26531
26537
|
static: this.props.static,
|
|
@@ -26662,7 +26668,7 @@ class FunctionGrapher extends React__namespace.Component {
|
|
|
26662
26668
|
}],
|
|
26663
26669
|
normalStyle: dashed,
|
|
26664
26670
|
highlightStyle: dashed
|
|
26665
|
-
}, ___default["default"].map(asymptote, (coord, i) => /*#__PURE__*/React__namespace.createElement(MovablePoint$
|
|
26671
|
+
}, ___default["default"].map(asymptote, (coord, i) => /*#__PURE__*/React__namespace.createElement(MovablePoint$3, {
|
|
26666
26672
|
key: `asymptoteCoord-${i}`,
|
|
26667
26673
|
coord: coord,
|
|
26668
26674
|
static: true,
|
|
@@ -27425,7 +27431,7 @@ const Label = Graphie.Label;
|
|
|
27425
27431
|
// @ts-expect-error - TS2339 - Property 'Line' does not exist on type 'typeof Graphie'.
|
|
27426
27432
|
const Line$1 = Graphie.Line;
|
|
27427
27433
|
// @ts-expect-error - TS2339 - Property 'MovablePoint' does not exist on type 'typeof Graphie'.
|
|
27428
|
-
const MovablePoint$
|
|
27434
|
+
const MovablePoint$2 = Graphie.MovablePoint;
|
|
27429
27435
|
// @ts-expect-error - TS2339 - Property 'MovableLine' does not exist on type 'typeof Graphie'.
|
|
27430
27436
|
const MovableLine = Graphie.MovableLine;
|
|
27431
27437
|
// @ts-expect-error - TS2339 - Property 'Plot' does not exist on type 'typeof Graphie'.
|
|
@@ -27679,7 +27685,7 @@ class Interaction extends React__namespace.Component {
|
|
|
27679
27685
|
return [coordX, coordY];
|
|
27680
27686
|
}];
|
|
27681
27687
|
if (element.options.constraint === "snap") {
|
|
27682
|
-
constraints.push(MovablePoint$
|
|
27688
|
+
constraints.push(MovablePoint$2.constraints.snap(element.options.snap));
|
|
27683
27689
|
} else if (element.options.constraint === "x") {
|
|
27684
27690
|
constraints.push(coord => {
|
|
27685
27691
|
return [
|
|
@@ -27701,7 +27707,7 @@ class Interaction extends React__namespace.Component {
|
|
|
27701
27707
|
// TODO(eater): foo_[xyz] are hacky non-props to
|
|
27702
27708
|
// get the component to update when constraints
|
|
27703
27709
|
// change
|
|
27704
|
-
return /*#__PURE__*/React__namespace.createElement(MovablePoint$
|
|
27710
|
+
return /*#__PURE__*/React__namespace.createElement(MovablePoint$2, {
|
|
27705
27711
|
key: element.key,
|
|
27706
27712
|
coord: [
|
|
27707
27713
|
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
|
|
@@ -27736,7 +27742,7 @@ class Interaction extends React__namespace.Component {
|
|
|
27736
27742
|
return [coordX, coordY];
|
|
27737
27743
|
}];
|
|
27738
27744
|
if (element.options.constraint === "snap") {
|
|
27739
|
-
constraints.push(MovablePoint$
|
|
27745
|
+
constraints.push(MovablePoint$2.constraints.snap(element.options.snap));
|
|
27740
27746
|
} else if (element.options.constraint === "x") {
|
|
27741
27747
|
constraints.push(coord => {
|
|
27742
27748
|
return [
|
|
@@ -27777,14 +27783,14 @@ class Interaction extends React__namespace.Component {
|
|
|
27777
27783
|
foo_x: element.options.constraint,
|
|
27778
27784
|
foo_y: element.options.constraintFn,
|
|
27779
27785
|
foo_z: element.options.snap
|
|
27780
|
-
}, /*#__PURE__*/React__namespace.createElement(MovablePoint$
|
|
27786
|
+
}, /*#__PURE__*/React__namespace.createElement(MovablePoint$2, {
|
|
27781
27787
|
coord: start,
|
|
27782
27788
|
static: true,
|
|
27783
27789
|
normalStyle: {
|
|
27784
27790
|
stroke: "none",
|
|
27785
27791
|
fill: "none"
|
|
27786
27792
|
}
|
|
27787
|
-
}), /*#__PURE__*/React__namespace.createElement(MovablePoint$
|
|
27793
|
+
}), /*#__PURE__*/React__namespace.createElement(MovablePoint$2, {
|
|
27788
27794
|
coord: end,
|
|
27789
27795
|
static: true,
|
|
27790
27796
|
normalStyle: {
|
|
@@ -28235,33 +28241,6 @@ class Graph extends React__namespace.Component {
|
|
|
28235
28241
|
allowScratchpad: true,
|
|
28236
28242
|
setDrawingAreaAvailable: this.props.setDrawingAreaAvailable
|
|
28237
28243
|
});
|
|
28238
|
-
|
|
28239
|
-
// Maybe move this out later
|
|
28240
|
-
if (this.props.lockedFigures) {
|
|
28241
|
-
for (const lockedFigure of this.props.lockedFigures) {
|
|
28242
|
-
switch (lockedFigure.type) {
|
|
28243
|
-
case "point":
|
|
28244
|
-
graphie.circle(
|
|
28245
|
-
// center
|
|
28246
|
-
lockedFigure.coord,
|
|
28247
|
-
// radius
|
|
28248
|
-
0.2,
|
|
28249
|
-
// style
|
|
28250
|
-
lockedFigure.style);
|
|
28251
|
-
break;
|
|
28252
|
-
default:
|
|
28253
|
-
/**
|
|
28254
|
-
* Devlopment-time future-proofing: This `never` should
|
|
28255
|
-
* fail during type-checking if we add a new locked
|
|
28256
|
-
* shape type and forget to handle it in any other
|
|
28257
|
-
* switch case here.
|
|
28258
|
-
*/
|
|
28259
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28260
|
-
lockedFigure.type;
|
|
28261
|
-
throw new Error(`Unknown locked shape type: ${lockedFigure.type}`);
|
|
28262
|
-
}
|
|
28263
|
-
}
|
|
28264
|
-
}
|
|
28265
28244
|
this._updateProtractor();
|
|
28266
28245
|
this._updateRuler();
|
|
28267
28246
|
|
|
@@ -28354,6 +28333,35 @@ class Graph extends React__namespace.Component {
|
|
|
28354
28333
|
}
|
|
28355
28334
|
}
|
|
28356
28335
|
|
|
28336
|
+
const GraphLockedLayer = props => {
|
|
28337
|
+
const {
|
|
28338
|
+
lockedFigures
|
|
28339
|
+
} = props;
|
|
28340
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, lockedFigures.map((figure, index) => {
|
|
28341
|
+
switch (figure.type) {
|
|
28342
|
+
case "point":
|
|
28343
|
+
const [x, y] = figure.coord;
|
|
28344
|
+
return /*#__PURE__*/React__namespace.createElement(mafs.Point, {
|
|
28345
|
+
key: `${figure.type}-${index}`,
|
|
28346
|
+
x: x,
|
|
28347
|
+
y: y,
|
|
28348
|
+
svgCircleProps: {
|
|
28349
|
+
style: figure.style
|
|
28350
|
+
}
|
|
28351
|
+
});
|
|
28352
|
+
}
|
|
28353
|
+
|
|
28354
|
+
/**
|
|
28355
|
+
* Devlopment-time future-proofing: This `never` should
|
|
28356
|
+
* fail during type-checking if we add a new locked
|
|
28357
|
+
* shape type and forget to handle it in any other
|
|
28358
|
+
* switch case here.
|
|
28359
|
+
*/
|
|
28360
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28361
|
+
throw new wonderStuffCore.UnreachableCaseError(figure.type);
|
|
28362
|
+
}));
|
|
28363
|
+
};
|
|
28364
|
+
|
|
28357
28365
|
const MOVE_CONTROL_POINT = "move-control-point";
|
|
28358
28366
|
function moveControlPoint(objectIndex, pointIndex, destination) {
|
|
28359
28367
|
return {
|
|
@@ -28372,6 +28380,59 @@ function moveSegment(segmentIndex, delta) {
|
|
|
28372
28380
|
};
|
|
28373
28381
|
}
|
|
28374
28382
|
|
|
28383
|
+
const MovablePoint$1 = props => {
|
|
28384
|
+
const hitboxRef = React.useRef(null);
|
|
28385
|
+
const {
|
|
28386
|
+
point,
|
|
28387
|
+
onMove
|
|
28388
|
+
} = props;
|
|
28389
|
+
const {
|
|
28390
|
+
dragging
|
|
28391
|
+
} = mafs.useMovable({
|
|
28392
|
+
gestureTarget: hitboxRef,
|
|
28393
|
+
point,
|
|
28394
|
+
onMove,
|
|
28395
|
+
constrain: p => p
|
|
28396
|
+
});
|
|
28397
|
+
const {
|
|
28398
|
+
viewTransform,
|
|
28399
|
+
userTransform
|
|
28400
|
+
} = mafs.useTransformContext();
|
|
28401
|
+
const transformToPx = mafs.vec.matrixMult(viewTransform, userTransform);
|
|
28402
|
+
const [x, y] = mafs.vec.transform(point, transformToPx);
|
|
28403
|
+
return /*#__PURE__*/React__namespace.createElement("g", {
|
|
28404
|
+
ref: hitboxRef,
|
|
28405
|
+
className: "movable-point",
|
|
28406
|
+
tabIndex: 0,
|
|
28407
|
+
style: {
|
|
28408
|
+
cursor: dragging ? "grabbing" : "grab",
|
|
28409
|
+
touchAction: "none",
|
|
28410
|
+
outline: "none",
|
|
28411
|
+
"--movable-point-color": Color__default["default"].blue
|
|
28412
|
+
}
|
|
28413
|
+
}, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
28414
|
+
className: "movable-point-hitbox",
|
|
28415
|
+
r: 30,
|
|
28416
|
+
cx: x,
|
|
28417
|
+
cy: y
|
|
28418
|
+
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
28419
|
+
className: "movable-point-halo",
|
|
28420
|
+
cx: x,
|
|
28421
|
+
cy: y
|
|
28422
|
+
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
28423
|
+
className: "movable-point-ring",
|
|
28424
|
+
cx: x,
|
|
28425
|
+
cy: y
|
|
28426
|
+
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
28427
|
+
className: "movable-point-center",
|
|
28428
|
+
cx: x,
|
|
28429
|
+
cy: y,
|
|
28430
|
+
style: {
|
|
28431
|
+
fill: Color__default["default"].blue
|
|
28432
|
+
}
|
|
28433
|
+
}));
|
|
28434
|
+
};
|
|
28435
|
+
|
|
28375
28436
|
const SegmentGraph = props => {
|
|
28376
28437
|
const {
|
|
28377
28438
|
dispatch
|
|
@@ -28394,31 +28455,76 @@ const SegmentGraph = props => {
|
|
|
28394
28455
|
})));
|
|
28395
28456
|
};
|
|
28396
28457
|
const SegmentView = props => {
|
|
28397
|
-
const
|
|
28458
|
+
const {
|
|
28459
|
+
onMoveSegment,
|
|
28460
|
+
segment: [pt1, pt2]
|
|
28461
|
+
} = props;
|
|
28398
28462
|
const midpoint = mafs.vec.midpoint(pt1, pt2);
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
}
|
|
28463
|
+
const segment = React.useRef(null);
|
|
28464
|
+
const {
|
|
28465
|
+
dragging: isDraggingSegment
|
|
28466
|
+
} = mafs.useMovable({
|
|
28467
|
+
gestureTarget: segment,
|
|
28403
28468
|
point: midpoint,
|
|
28404
|
-
color: Color__default["default"].blue,
|
|
28405
28469
|
onMove: newPoint => {
|
|
28406
|
-
|
|
28470
|
+
onMoveSegment(mafs.vec.sub(newPoint, midpoint));
|
|
28471
|
+
},
|
|
28472
|
+
constrain: p => p
|
|
28473
|
+
});
|
|
28474
|
+
const {
|
|
28475
|
+
viewTransform,
|
|
28476
|
+
userTransform
|
|
28477
|
+
} = mafs.useTransformContext();
|
|
28478
|
+
const transformToPx = mafs.vec.matrixMult(viewTransform, userTransform);
|
|
28479
|
+
const pt1Px = mafs.vec.transform(pt1, transformToPx);
|
|
28480
|
+
const pt2Px = mafs.vec.transform(pt2, transformToPx);
|
|
28481
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("g", {
|
|
28482
|
+
ref: segment,
|
|
28483
|
+
tabIndex: 0,
|
|
28484
|
+
className: "movable-segment",
|
|
28485
|
+
style: {
|
|
28486
|
+
cursor: isDraggingSegment ? "grabbing" : "grab"
|
|
28487
|
+
}
|
|
28488
|
+
}, /*#__PURE__*/React__namespace.createElement(SVGLine, {
|
|
28489
|
+
start: pt1Px,
|
|
28490
|
+
end: pt2Px,
|
|
28491
|
+
style: {
|
|
28492
|
+
stroke: "transparent",
|
|
28493
|
+
strokeWidth: 30
|
|
28494
|
+
}
|
|
28495
|
+
}), /*#__PURE__*/React__namespace.createElement(SVGLine, {
|
|
28496
|
+
start: pt1Px,
|
|
28497
|
+
end: pt2Px,
|
|
28498
|
+
style: {
|
|
28499
|
+
stroke: "var(--mafs-segment-stroke-color)",
|
|
28500
|
+
strokeWidth: "var(--mafs-segment-stroke-weight)"
|
|
28407
28501
|
}
|
|
28408
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
28502
|
+
})), /*#__PURE__*/React__namespace.createElement(MovablePoint$1, {
|
|
28409
28503
|
point: pt1,
|
|
28410
|
-
color: Color__default["default"].blue,
|
|
28411
28504
|
onMove: newPoint => {
|
|
28412
28505
|
props.onMovePoint(0, newPoint);
|
|
28413
28506
|
}
|
|
28414
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
28507
|
+
}), /*#__PURE__*/React__namespace.createElement(MovablePoint$1, {
|
|
28415
28508
|
point: pt2,
|
|
28416
|
-
color: Color__default["default"].blue,
|
|
28417
28509
|
onMove: newPoint => {
|
|
28418
28510
|
props.onMovePoint(1, newPoint);
|
|
28419
28511
|
}
|
|
28420
28512
|
}));
|
|
28421
28513
|
};
|
|
28514
|
+
function SVGLine(props) {
|
|
28515
|
+
const {
|
|
28516
|
+
start,
|
|
28517
|
+
end,
|
|
28518
|
+
style
|
|
28519
|
+
} = props;
|
|
28520
|
+
return /*#__PURE__*/React__namespace.createElement("line", {
|
|
28521
|
+
x1: start[0],
|
|
28522
|
+
y1: start[1],
|
|
28523
|
+
x2: end[0],
|
|
28524
|
+
y2: end[1],
|
|
28525
|
+
style: style
|
|
28526
|
+
});
|
|
28527
|
+
}
|
|
28422
28528
|
|
|
28423
28529
|
const renderLineLabel = (n, _ref) => {
|
|
28424
28530
|
let [min, max] = _ref;
|
|
@@ -28596,7 +28702,7 @@ const VisibleIcon = () => /*#__PURE__*/React__namespace.createElement("svg", {
|
|
|
28596
28702
|
width: "24",
|
|
28597
28703
|
height: "24",
|
|
28598
28704
|
viewBox: "0 0 24 24",
|
|
28599
|
-
className: aphrodite.css(styles$
|
|
28705
|
+
className: aphrodite.css(styles$k.icon)
|
|
28600
28706
|
}, /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
28601
28707
|
id: "a",
|
|
28602
28708
|
d: "M7.401 10.035c-1.424.748-2.599 1.905-3.544 " + "3.48a1 1 0 0 1-1.714-1.03C4.325 8.849 7.652 7 " + "12 7c4.348 0 7.675 1.848 9.857 5.486a1 1 0 0 " + "1-1.714 1.028c-.945-1.574-2.12-2.73-3.544-" + "3.48a5 5 0 1 1-9.198 0zM12 15a3 3 0 1 0 0-6 3 3 " + "0 0 0 0 6z"
|
|
@@ -28627,7 +28733,7 @@ const HiddenIcon = () => /*#__PURE__*/React__namespace.createElement("svg", {
|
|
|
28627
28733
|
width: "24",
|
|
28628
28734
|
height: "24",
|
|
28629
28735
|
viewBox: "0 0 24 24",
|
|
28630
|
-
className: aphrodite.css(styles$
|
|
28736
|
+
className: aphrodite.css(styles$k.icon)
|
|
28631
28737
|
}, /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
28632
28738
|
id: "a",
|
|
28633
28739
|
d: "M8.794 7.38C9.791 7.127 10.86 7 12 7c4.348 0 " + "7.675 1.848 9.857 5.486a1 1 0 0 1-1.714 " + "1.028c-.945-1.574-2.12-2.73-3.544-3.48.258." + "604.401 1.268.401 1.966 0 1.02-.305 " + "1.967-.828 2.757l2.535 2.536a1 1 0 0 " + "1-1.414 1.414l-12-12a1 1 0 0 1 " + "1.414-1.414L8.794 7.38zm5.914 5.913a3 3 0 0 " + "0-4.001-4.001l4 4.001zM6.072 8.486l2.976 " + "2.976a3 3 0 0 0 3.49 3.49l1.579 1.58A5 5 0 " + "0 1 7.4 10.035c-1.424.747-2.599 1.904-3.544 " + "3.478a1 1 0 0 1-1.714-1.028c1.049-1.75 " + "2.363-3.085 3.929-4z"
|
|
@@ -28662,20 +28768,20 @@ const HUD = _ref => {
|
|
|
28662
28768
|
let state;
|
|
28663
28769
|
let icon;
|
|
28664
28770
|
if (enabled) {
|
|
28665
|
-
state = styles$
|
|
28771
|
+
state = styles$k.enabled;
|
|
28666
28772
|
icon = /*#__PURE__*/React__namespace.createElement(VisibleIcon, null);
|
|
28667
28773
|
} else {
|
|
28668
|
-
state = styles$
|
|
28774
|
+
state = styles$k.disabled;
|
|
28669
28775
|
icon = /*#__PURE__*/React__namespace.createElement(HiddenIcon, null);
|
|
28670
28776
|
}
|
|
28671
28777
|
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
28672
|
-
className: aphrodite.css(styles$
|
|
28778
|
+
className: aphrodite.css(styles$k.hud, fixedPosition && styles$k.hudFixedPosition, state),
|
|
28673
28779
|
onClick: e => {
|
|
28674
28780
|
onClick();
|
|
28675
28781
|
}
|
|
28676
28782
|
}, icon, message);
|
|
28677
28783
|
};
|
|
28678
|
-
const styles$
|
|
28784
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
28679
28785
|
hud: {
|
|
28680
28786
|
boxSizing: "border-box",
|
|
28681
28787
|
height: 36,
|
|
@@ -28739,7 +28845,7 @@ const triangleBeforeAfter = {
|
|
|
28739
28845
|
top: "0",
|
|
28740
28846
|
width: "0"
|
|
28741
28847
|
};
|
|
28742
|
-
const styles$
|
|
28848
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
28743
28849
|
infoTip: {
|
|
28744
28850
|
display: "inline-block",
|
|
28745
28851
|
marginLeft: "5px",
|
|
@@ -28780,7 +28886,6 @@ const styles$i = aphrodite.StyleSheet.create({
|
|
|
28780
28886
|
width: "240px"
|
|
28781
28887
|
}
|
|
28782
28888
|
});
|
|
28783
|
-
const questionMark = "data:image/png;base64," + "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBB" + "ZG9iZSBJbWFnZVJlYWR5ccllPAAAA3NpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/" + "eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+" + "IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2Jl" + "IFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAg" + "ICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5" + "LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9" + "IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHht" + "bG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3Vy" + "Y2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHht" + "cE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo2N2M3NTAxYS04YmVlLTQ0M2Mt" + "YmRiNS04OGM2N2IxN2NhYzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUJCRTk4" + "Qjc4NjAwMTFFMzg3QUJDNEI4Mzk2QTRGQkQiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5p" + "aWQ6OUJCRTk4QjY4NjAwMTFFMzg3QUJDNEI4Mzk2QTRGQkQiIHhtcDpDcmVhdG9yVG9v" + "bD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRG" + "cm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NGE5ZDI0OTMtODk1NC00OGFkLTlh" + "MTgtZDAwM2MwYWNjNDJlIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY3Yzc1MDFh" + "LThiZWUtNDQzYy1iZGI1LTg4YzY3YjE3Y2FjMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4g" + "PC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pqm89uYAAADM" + "SURBVHjaXJA9DoJAEIUH1M4TUHIFsCMGen9OwCGw1YRGW2ntKel0exsojHIBC0ouQAyU" + "viFDstmXfNmZeS+zm7XSNCXRFiRgJf0bXIHixpbhGdxBBJYC1w/xaA424MhNEATkui71" + "fU9KqfEU78UbD9PdbJRlOdae55GmhIP+1NV1TcMwkOM41DSNHvRtMhTHMRVFQW3b6mOL" + "gx99kue5GRp/gIOZuZGvNpTNwjD8oliANU+qqqKu6/TQBdymN57AHjzBT+B6Jx79BRgA" + "vc49kQA4yxgAAAAASUVORK5CYII=";
|
|
28784
28889
|
class InfoTip$1 extends React__namespace.Component {
|
|
28785
28890
|
state = {
|
|
28786
28891
|
hover: false
|
|
@@ -28797,23 +28902,22 @@ class InfoTip$1 extends React__namespace.Component {
|
|
|
28797
28902
|
};
|
|
28798
28903
|
render() {
|
|
28799
28904
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
28800
|
-
className: aphrodite.css(styles$
|
|
28801
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
28802
|
-
alt: "",
|
|
28803
|
-
width: 10,
|
|
28804
|
-
height: 10,
|
|
28805
|
-
src: questionMark,
|
|
28905
|
+
className: aphrodite.css(styles$j.infoTip)
|
|
28906
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28806
28907
|
onMouseEnter: this.handleMouseEnter,
|
|
28807
28908
|
onMouseLeave: this.handleMouseLeave
|
|
28808
|
-
}
|
|
28809
|
-
|
|
28909
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
28910
|
+
size: "small",
|
|
28911
|
+
icon: questionIcon__default["default"]
|
|
28912
|
+
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28913
|
+
className: aphrodite.css(styles$j.infoTipContainer),
|
|
28810
28914
|
style: {
|
|
28811
28915
|
display: this.state.hover ? "block" : "none"
|
|
28812
28916
|
}
|
|
28813
28917
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28814
|
-
className: aphrodite.css(styles$
|
|
28918
|
+
className: aphrodite.css(styles$j.infoTipTriangle)
|
|
28815
28919
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28816
|
-
className: aphrodite.css(styles$
|
|
28920
|
+
className: aphrodite.css(styles$j.verticalShadow, styles$j.infoTipContentContainer)
|
|
28817
28921
|
}, this.props.children)));
|
|
28818
28922
|
}
|
|
28819
28923
|
}
|
|
@@ -28885,7 +28989,7 @@ class MultiButtonGroup extends React__namespace.Component {
|
|
|
28885
28989
|
id: "" + i,
|
|
28886
28990
|
key: "" + i,
|
|
28887
28991
|
ref: "button" + i,
|
|
28888
|
-
className: aphrodite.css(styles$
|
|
28992
|
+
className: aphrodite.css(styles$i.buttonStyle, selected && styles$i.selectedStyle),
|
|
28889
28993
|
onClick: () => this.toggleSelect(button.value)
|
|
28890
28994
|
}, button.content || "" + button.value);
|
|
28891
28995
|
});
|
|
@@ -28897,7 +29001,7 @@ class MultiButtonGroup extends React__namespace.Component {
|
|
|
28897
29001
|
}, buttons);
|
|
28898
29002
|
}
|
|
28899
29003
|
}
|
|
28900
|
-
const styles$
|
|
29004
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
28901
29005
|
buttonStyle: {
|
|
28902
29006
|
backgroundColor: "white",
|
|
28903
29007
|
border: "1px solid #ccc",
|
|
@@ -29162,11 +29266,12 @@ const PropCheckBox = createReactClass__default["default"]({
|
|
|
29162
29266
|
},
|
|
29163
29267
|
render: function () {
|
|
29164
29268
|
const propName = this.propName();
|
|
29165
|
-
return /*#__PURE__*/React__namespace.createElement("label",
|
|
29166
|
-
|
|
29269
|
+
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29270
|
+
className: aphrodite.css(styles$h.labeledCheckbox)
|
|
29271
|
+
}, this._labelAlignLeft() && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, null, this.props.label), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
29167
29272
|
checked: this.props[propName],
|
|
29168
29273
|
onChange: this.toggle
|
|
29169
|
-
}), !this._labelAlignLeft() && this.props.label);
|
|
29274
|
+
}), !this._labelAlignLeft() && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, null, this.props.label));
|
|
29170
29275
|
},
|
|
29171
29276
|
toggle: function () {
|
|
29172
29277
|
const propName = this.propName();
|
|
@@ -29175,6 +29280,13 @@ const PropCheckBox = createReactClass__default["default"]({
|
|
|
29175
29280
|
this.props.onChange(changes);
|
|
29176
29281
|
}
|
|
29177
29282
|
});
|
|
29283
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
29284
|
+
labeledCheckbox: {
|
|
29285
|
+
display: "flex",
|
|
29286
|
+
flexDirection: "row",
|
|
29287
|
+
alignItems: "center"
|
|
29288
|
+
}
|
|
29289
|
+
});
|
|
29178
29290
|
|
|
29179
29291
|
const truth = () => true;
|
|
29180
29292
|
|
|
@@ -29333,7 +29445,9 @@ const MafsGraph = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
|
|
|
29333
29445
|
zoom: false,
|
|
29334
29446
|
width: width,
|
|
29335
29447
|
height: height
|
|
29336
|
-
}, !legacyGrid && /*#__PURE__*/React__namespace.createElement(Grid, props),
|
|
29448
|
+
}, !legacyGrid && /*#__PURE__*/React__namespace.createElement(Grid, props), props.lockedFigures && /*#__PURE__*/React__namespace.createElement(GraphLockedLayer, {
|
|
29449
|
+
lockedFigures: props.lockedFigures
|
|
29450
|
+
}), renderGraph({
|
|
29337
29451
|
state,
|
|
29338
29452
|
dispatch
|
|
29339
29453
|
}))));
|
|
@@ -29512,7 +29626,7 @@ class InteractiveGraph extends React__namespace.Component {
|
|
|
29512
29626
|
this.sinusoid = null;
|
|
29513
29627
|
// eslint-disable-next-line react/no-string-refs
|
|
29514
29628
|
// @ts-expect-error - TS2339 - Property 'reset' does not exist on type 'ReactInstance'.
|
|
29515
|
-
this.refs.graph
|
|
29629
|
+
this.refs.graph?.reset();
|
|
29516
29630
|
};
|
|
29517
29631
|
setupGraphie = () => {
|
|
29518
29632
|
this.setTrashCanVisibility(0);
|
|
@@ -30588,8 +30702,7 @@ class InteractiveGraph extends React__namespace.Component {
|
|
|
30588
30702
|
onMouseDown: onMouseDown,
|
|
30589
30703
|
onGraphieUpdated: this.setGraphie,
|
|
30590
30704
|
setDrawingAreaAvailable: this.props.apiOptions.setDrawingAreaAvailable,
|
|
30591
|
-
isMobile: isMobile
|
|
30592
|
-
lockedFigures: this.props.lockedFigures
|
|
30705
|
+
isMobile: isMobile
|
|
30593
30706
|
}));
|
|
30594
30707
|
}
|
|
30595
30708
|
static getQuadraticCoefficients(coords) {
|
|
@@ -41311,7 +41424,7 @@ const init = function (options) {
|
|
|
41311
41424
|
|
|
41312
41425
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
41313
41426
|
const libName = "@khanacademy/perseus";
|
|
41314
|
-
const libVersion = "20.0
|
|
41427
|
+
const libVersion = "20.2.0";
|
|
41315
41428
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41316
41429
|
|
|
41317
41430
|
const apiVersion = {
|