@khanacademy/perseus 20.0.2 → 20.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/prop-check-box.d.ts +2 -0
- package/dist/es/index.css +16 -1
- package/dist/es/index.js +188 -128
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +16 -1
- package/dist/index.js +182 -126
- package/dist/index.js.map +1 -1
- 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",
|
|
@@ -17931,33 +17934,33 @@ class Lint extends React__namespace.Component {
|
|
|
17931
17934
|
let warningText;
|
|
17932
17935
|
let warningTextStyle;
|
|
17933
17936
|
if (this.props.severity === Severity.Error) {
|
|
17934
|
-
severityStyle = styles$
|
|
17937
|
+
severityStyle = styles$C.indicatorError;
|
|
17935
17938
|
warningText = "Error";
|
|
17936
|
-
warningTextStyle = styles$
|
|
17939
|
+
warningTextStyle = styles$C.publishBlockingError;
|
|
17937
17940
|
} else if (this.props.severity === Severity.Warning) {
|
|
17938
|
-
severityStyle = styles$
|
|
17941
|
+
severityStyle = styles$C.indicatorWarning;
|
|
17939
17942
|
warningText = "Warning";
|
|
17940
|
-
warningTextStyle = styles$
|
|
17943
|
+
warningTextStyle = styles$C.warning;
|
|
17941
17944
|
} else {
|
|
17942
|
-
severityStyle = styles$
|
|
17945
|
+
severityStyle = styles$C.indicatorGuideline;
|
|
17943
17946
|
warningText = "Recommendation";
|
|
17944
|
-
warningTextStyle = styles$
|
|
17947
|
+
warningTextStyle = styles$C.warning;
|
|
17945
17948
|
}
|
|
17946
17949
|
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
17947
17950
|
href: `https://khanacademy.org/r/linter-rules#${this.props.ruleName}`,
|
|
17948
17951
|
target: "lint-help-window",
|
|
17949
17952
|
className: aphrodite.css(style)
|
|
17950
17953
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17951
|
-
className: aphrodite.css(styles$
|
|
17954
|
+
className: aphrodite.css(styles$C.indicator, severityStyle)
|
|
17952
17955
|
}, this.props.severity === 1 && /*#__PURE__*/React__namespace.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17953
|
-
className: aphrodite.css(styles$
|
|
17956
|
+
className: aphrodite.css(styles$C.tooltip, tooltipAbove && styles$C.tooltipAbove)
|
|
17954
17957
|
}, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React__namespace.createElement("p", {
|
|
17955
17958
|
key: i,
|
|
17956
|
-
className: aphrodite.css(styles$
|
|
17959
|
+
className: aphrodite.css(styles$C.tooltipParagraph)
|
|
17957
17960
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17958
17961
|
className: aphrodite.css(warningTextStyle)
|
|
17959
17962
|
}, warningText, ":", " "), m)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17960
|
-
className: aphrodite.css(styles$
|
|
17963
|
+
className: aphrodite.css(styles$C.tail, tooltipAbove && styles$C.tailAbove)
|
|
17961
17964
|
})));
|
|
17962
17965
|
};
|
|
17963
17966
|
|
|
@@ -17985,20 +17988,20 @@ class Lint extends React__namespace.Component {
|
|
|
17985
17988
|
}
|
|
17986
17989
|
if (blockHighlight) {
|
|
17987
17990
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17988
|
-
className: aphrodite.css(styles$
|
|
17989
|
-
}, this.renderLink(styles$
|
|
17991
|
+
className: aphrodite.css(styles$C.lintContainer, styles$C.lintContainerBlock)
|
|
17992
|
+
}, this.renderLink(styles$C.radioWidgetHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17990
17993
|
}
|
|
17991
17994
|
if (inline) {
|
|
17992
17995
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17993
|
-
className: aphrodite.css(styles$
|
|
17994
|
-
}, this.renderLink(styles$
|
|
17996
|
+
className: aphrodite.css(styles$C.lintContainer)
|
|
17997
|
+
}, this.renderLink(styles$C.inlineHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17995
17998
|
}
|
|
17996
17999
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
17997
|
-
className: aphrodite.css(styles$
|
|
17998
|
-
}, this.renderLink(styles$
|
|
18000
|
+
className: aphrodite.css(styles$C.lintContainer)
|
|
18001
|
+
}, this.renderLink(styles$C.hoverTarget), /*#__PURE__*/React__namespace.createElement("div", null, children));
|
|
17999
18002
|
}
|
|
18000
18003
|
}
|
|
18001
|
-
const styles$
|
|
18004
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
18002
18005
|
// This is the class of the outermost element.
|
|
18003
18006
|
// We use relative positioning so that the lint indicator can be
|
|
18004
18007
|
// positioned absolutely relative to the position of the linty container.
|
|
@@ -20122,7 +20125,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20122
20125
|
};
|
|
20123
20126
|
const mobileInnerStyle = {
|
|
20124
20127
|
...innerStyle,
|
|
20125
|
-
...styles$
|
|
20128
|
+
...styles$B.mobileZoomableParentFix
|
|
20126
20129
|
};
|
|
20127
20130
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20128
20131
|
key: state.key,
|
|
@@ -20259,7 +20262,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20259
20262
|
};
|
|
20260
20263
|
const mobileInnerStyle = {
|
|
20261
20264
|
...innerStyle,
|
|
20262
|
-
...styles$
|
|
20265
|
+
...styles$B.mobileZoomableParentFix
|
|
20263
20266
|
};
|
|
20264
20267
|
const wrappedOutput = /*#__PURE__*/React__namespace.createElement("div", {
|
|
20265
20268
|
style: {
|
|
@@ -20767,7 +20770,7 @@ class Renderer extends React__namespace.Component {
|
|
|
20767
20770
|
return this.lastRenderedMarkdown;
|
|
20768
20771
|
}
|
|
20769
20772
|
}
|
|
20770
|
-
const styles$
|
|
20773
|
+
const styles$B = {
|
|
20771
20774
|
mobileZoomableParentFix: {
|
|
20772
20775
|
// NOTE(abdul): There is an issue where transform animations will
|
|
20773
20776
|
// cause the Zoomable component to disappear when running on the
|
|
@@ -21702,10 +21705,10 @@ class InputNumber extends React__namespace.Component {
|
|
|
21702
21705
|
// Note: This is _very_ similar to what `numeric-input.jsx` does. If
|
|
21703
21706
|
// you modify this, double-check if you also need to modify that
|
|
21704
21707
|
// component.
|
|
21705
|
-
const inputStyles = [styles$
|
|
21708
|
+
const inputStyles = [styles$A.default, this.props.size === "small" ? styles$A.small : null, this.props.rightAlign ? styles$A.rightAlign : styles$A.leftAlign];
|
|
21706
21709
|
// Unanswered
|
|
21707
21710
|
if (rubric && !this.props.currentValue) {
|
|
21708
|
-
inputStyles.push(styles$
|
|
21711
|
+
inputStyles.push(styles$A.answerStateUnanswered);
|
|
21709
21712
|
}
|
|
21710
21713
|
return /*#__PURE__*/React__namespace.createElement(InputWithExamples
|
|
21711
21714
|
// eslint-disable-next-line react/no-string-refs
|
|
@@ -21844,7 +21847,7 @@ class InputNumber extends React__namespace.Component {
|
|
|
21844
21847
|
return answerString;
|
|
21845
21848
|
}
|
|
21846
21849
|
}
|
|
21847
|
-
const styles$
|
|
21850
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
21848
21851
|
default: {
|
|
21849
21852
|
width: 80,
|
|
21850
21853
|
height: "auto"
|
|
@@ -22833,7 +22836,7 @@ const FocusRing = function (props) {
|
|
|
22833
22836
|
};
|
|
22834
22837
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
22835
22838
|
"data-test-id": "focus-ring",
|
|
22836
|
-
className: aphrodite.css(styles$
|
|
22839
|
+
className: aphrodite.css(styles$z.ring),
|
|
22837
22840
|
style: style
|
|
22838
22841
|
}, children);
|
|
22839
22842
|
};
|
|
@@ -22842,7 +22845,7 @@ FocusRing.defaultProps = {
|
|
|
22842
22845
|
color: kaGreen$1,
|
|
22843
22846
|
multipleSelect: false
|
|
22844
22847
|
};
|
|
22845
|
-
const styles$
|
|
22848
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
22846
22849
|
ring: {
|
|
22847
22850
|
margin: "auto",
|
|
22848
22851
|
display: "inline-block",
|
|
@@ -22879,7 +22882,7 @@ function getChoiceLetter(pos) {
|
|
|
22879
22882
|
}
|
|
22880
22883
|
|
|
22881
22884
|
const CHOICE_ICON_SIZE = 24;
|
|
22882
|
-
const styles$
|
|
22885
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
22883
22886
|
iconWrapper: {
|
|
22884
22887
|
display: "inline-block",
|
|
22885
22888
|
position: "relative"
|
|
@@ -22902,7 +22905,7 @@ const CrossOutLine = function (props) {
|
|
|
22902
22905
|
width: CROSS_OUT_LINE_SIZE,
|
|
22903
22906
|
height: CROSS_OUT_LINE_SIZE,
|
|
22904
22907
|
viewBox: `0 0 ${CROSS_OUT_LINE_SIZE} ${CROSS_OUT_LINE_SIZE}`,
|
|
22905
|
-
className: aphrodite.css(styles$
|
|
22908
|
+
className: aphrodite.css(styles$x.crossOutLine),
|
|
22906
22909
|
"data-test-id": "choice-icon__cross-out-line"
|
|
22907
22910
|
}, /*#__PURE__*/React__namespace.createElement("line", {
|
|
22908
22911
|
// The line stretches from the bottom-left to top-right.
|
|
@@ -22917,7 +22920,7 @@ const CrossOutLine = function (props) {
|
|
|
22917
22920
|
strokeLinecap: "round"
|
|
22918
22921
|
}));
|
|
22919
22922
|
};
|
|
22920
|
-
const styles$
|
|
22923
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
22921
22924
|
crossOutLine: {
|
|
22922
22925
|
// Center the icon within the container.
|
|
22923
22926
|
position: "absolute",
|
|
@@ -22998,7 +23001,7 @@ const ChoiceIcon = function (props) {
|
|
|
22998
23001
|
} = props;
|
|
22999
23002
|
const dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct);
|
|
23000
23003
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23001
|
-
className: aphrodite.css(styles$
|
|
23004
|
+
className: aphrodite.css(styles$y.iconWrapper)
|
|
23002
23005
|
}, /*#__PURE__*/React__namespace.createElement(FocusRing, {
|
|
23003
23006
|
color: Color__default["default"].blue,
|
|
23004
23007
|
visible: focused || hovered,
|
|
@@ -23007,13 +23010,13 @@ const ChoiceIcon = function (props) {
|
|
|
23007
23010
|
// @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
23011
|
style: dynamicStyles,
|
|
23009
23012
|
"data-test-id": "choice-icon__library-choice-icon",
|
|
23010
|
-
className: aphrodite.css(styles$
|
|
23013
|
+
className: aphrodite.css(styles$w.circle, showCorrectness && correct && styles$w.circleCorrect, showCorrectness && !correct && styles$w.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$w.circleIncorrectAnswered)
|
|
23011
23014
|
// used in BaseRadio editMode to check
|
|
23012
23015
|
// if we actually clicked on the radio icon
|
|
23013
23016
|
,
|
|
23014
23017
|
"data-is-radio-icon": true
|
|
23015
23018
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
23016
|
-
className: aphrodite.css(styles$
|
|
23019
|
+
className: aphrodite.css(styles$w.innerWrapper)
|
|
23017
23020
|
}, /*#__PURE__*/React__namespace.createElement(ChoiceInner, {
|
|
23018
23021
|
pos: pos,
|
|
23019
23022
|
showCorrectness: showCorrectness,
|
|
@@ -23022,7 +23025,7 @@ const ChoiceIcon = function (props) {
|
|
|
23022
23025
|
color: dynamicStyles.borderColor
|
|
23023
23026
|
}));
|
|
23024
23027
|
};
|
|
23025
|
-
const styles$
|
|
23028
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
23026
23029
|
innerWrapper: {
|
|
23027
23030
|
width: CHOICE_ICON_SIZE,
|
|
23028
23031
|
height: CHOICE_ICON_SIZE,
|
|
@@ -23114,19 +23117,19 @@ const OptionStatus = function (props) {
|
|
|
23114
23117
|
}
|
|
23115
23118
|
let textStyle;
|
|
23116
23119
|
if (correct) {
|
|
23117
|
-
textStyle = styles$
|
|
23120
|
+
textStyle = styles$v.correct;
|
|
23118
23121
|
} else {
|
|
23119
23122
|
if (checked || previouslyAnswered) {
|
|
23120
|
-
textStyle = styles$
|
|
23123
|
+
textStyle = styles$v.incorrectAnswered;
|
|
23121
23124
|
} else {
|
|
23122
|
-
textStyle = styles$
|
|
23125
|
+
textStyle = styles$v.incorrect;
|
|
23123
23126
|
}
|
|
23124
23127
|
}
|
|
23125
23128
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23126
|
-
className: aphrodite.css(styles$
|
|
23129
|
+
className: aphrodite.css(styles$v.text, textStyle)
|
|
23127
23130
|
}, renderText(checked, correct, crossedOut));
|
|
23128
23131
|
};
|
|
23129
|
-
const styles$
|
|
23132
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
23130
23133
|
text: {
|
|
23131
23134
|
alignItems: "center",
|
|
23132
23135
|
display: "flex",
|
|
@@ -23200,8 +23203,8 @@ const Choice = function (props) {
|
|
|
23200
23203
|
crossedOut: updatedCrossedOut
|
|
23201
23204
|
});
|
|
23202
23205
|
}
|
|
23203
|
-
const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$
|
|
23204
|
-
const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$
|
|
23206
|
+
const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$u.description));
|
|
23207
|
+
const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$u.rationale));
|
|
23205
23208
|
|
|
23206
23209
|
// We want to show the choices as dimmed out when the choices are disabled.
|
|
23207
23210
|
// However, we don't want to do this when we're in review mode in the
|
|
@@ -23372,7 +23375,7 @@ const Choice = function (props) {
|
|
|
23372
23375
|
"data-test-id": `perseus-radio-rationale-content-${pos}`
|
|
23373
23376
|
}, rationale));
|
|
23374
23377
|
};
|
|
23375
|
-
const styles$
|
|
23378
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
23376
23379
|
description: {
|
|
23377
23380
|
display: "inline-block",
|
|
23378
23381
|
width: "100%"
|
|
@@ -23564,10 +23567,10 @@ const BaseRadio = function (props) {
|
|
|
23564
23567
|
const isMobile = apiOptions.isMobile;
|
|
23565
23568
|
const firstChoiceHighlighted = choices[0].highlighted;
|
|
23566
23569
|
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$
|
|
23570
|
+
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));
|
|
23571
|
+
const instructionsClassName = classNames__default["default"]("instructions", aphrodite.css(styles$t.instructions, isMobile && styles$t.instructionsMobile));
|
|
23569
23572
|
const instructions = getInstructionsText(multipleSelect, countChoices, numCorrect);
|
|
23570
|
-
const responsiveClassName = aphrodite.css(styles$
|
|
23573
|
+
const responsiveClassName = aphrodite.css(styles$t.responsiveFieldset);
|
|
23571
23574
|
const fieldset = /*#__PURE__*/React__namespace.createElement("fieldset", {
|
|
23572
23575
|
className: `perseus-widget-radio-fieldset ${responsiveClassName}`
|
|
23573
23576
|
}, /*#__PURE__*/React__namespace.createElement("legend", {
|
|
@@ -23618,7 +23621,7 @@ const BaseRadio = function (props) {
|
|
|
23618
23621
|
const aphroditeClassName = checked => {
|
|
23619
23622
|
// Whether or not to show correctness borders
|
|
23620
23623
|
// for this choice and the next choice.
|
|
23621
|
-
return aphrodite.css(sharedStyles.aboveScratchpad, styles$
|
|
23624
|
+
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
23625
|
};
|
|
23623
23626
|
|
|
23624
23627
|
// HACK(abdulrahman): Preloads the selection-state
|
|
@@ -23692,14 +23695,14 @@ const BaseRadio = function (props) {
|
|
|
23692
23695
|
// Allow for horizontal scrolling if content is too wide, which may be
|
|
23693
23696
|
// an issue especially on phones.
|
|
23694
23697
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
23695
|
-
className: aphrodite.css(styles$
|
|
23698
|
+
className: aphrodite.css(styles$t.responsiveContainer)
|
|
23696
23699
|
}, fieldset);
|
|
23697
23700
|
};
|
|
23698
23701
|
BaseRadio.defaultProps = {
|
|
23699
23702
|
editMode: false,
|
|
23700
23703
|
multipleSelect: false
|
|
23701
23704
|
};
|
|
23702
|
-
const styles$
|
|
23705
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
23703
23706
|
instructions: {
|
|
23704
23707
|
display: "block",
|
|
23705
23708
|
color: gray17,
|
|
@@ -24358,9 +24361,9 @@ class Categorizer extends React__namespace.Component {
|
|
|
24358
24361
|
indexedItems = Util.shuffle(indexedItems, this.props.problemNum);
|
|
24359
24362
|
}
|
|
24360
24363
|
const table = /*#__PURE__*/React__namespace.createElement("table", {
|
|
24361
|
-
className: "categorizer-table " + aphrodite.css(styles$
|
|
24364
|
+
className: "categorizer-table " + aphrodite.css(styles$s.mobileTable)
|
|
24362
24365
|
}, /*#__PURE__*/React__namespace.createElement("thead", null, /*#__PURE__*/React__namespace.createElement("tr", null, /*#__PURE__*/React__namespace.createElement("td", {
|
|
24363
|
-
className: aphrodite.css(styles$
|
|
24366
|
+
className: aphrodite.css(styles$s.emptyHeaderCell)
|
|
24364
24367
|
}), this.props.categories.map((category, i) => {
|
|
24365
24368
|
// Array index is the correct key here, as that's
|
|
24366
24369
|
// how category grading actually works -- no way
|
|
@@ -24368,7 +24371,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24368
24371
|
// middle. (If we later add that, this should be
|
|
24369
24372
|
// fixed.)
|
|
24370
24373
|
return /*#__PURE__*/React__namespace.createElement("th", {
|
|
24371
|
-
className: aphrodite.css(styles$
|
|
24374
|
+
className: aphrodite.css(styles$s.header),
|
|
24372
24375
|
key: i
|
|
24373
24376
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
24374
24377
|
content: category,
|
|
@@ -24388,7 +24391,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24388
24391
|
})), self.props.categories.map((catName, catNum) => {
|
|
24389
24392
|
const selected = self.props.values[itemNum] === catNum;
|
|
24390
24393
|
return /*#__PURE__*/React__namespace.createElement("td", {
|
|
24391
|
-
className: "category " + aphrodite.css(styles$
|
|
24394
|
+
className: "category " + aphrodite.css(styles$s.cell),
|
|
24392
24395
|
key: catNum
|
|
24393
24396
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24394
24397
|
className: ClassNames.INTERACTIVE,
|
|
@@ -24403,7 +24406,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24403
24406
|
onChange: () => this.onChange(itemNum, catNum),
|
|
24404
24407
|
onClick: e => e.stopPropagation()
|
|
24405
24408
|
}), !isMobile && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24406
|
-
className: aphrodite.css(styles$
|
|
24409
|
+
className: aphrodite.css(styles$s.radioSpan, selected && styles$s.checkedRadioSpan, this.props.static && selected && styles$s.staticCheckedRadioSpan)
|
|
24407
24410
|
}, selected ? /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircle) : /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircleThin))));
|
|
24408
24411
|
}));
|
|
24409
24412
|
/* eslint-enable max-len */
|
|
@@ -24415,7 +24418,7 @@ class Categorizer extends React__namespace.Component {
|
|
|
24415
24418
|
"categorizer-container": true,
|
|
24416
24419
|
"static-mode": this.props.static
|
|
24417
24420
|
});
|
|
24418
|
-
const inlineStyles = this.props.apiOptions.isMobile ? [styles$
|
|
24421
|
+
const inlineStyles = this.props.apiOptions.isMobile ? [styles$s.fullBleedContainer] : [];
|
|
24419
24422
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24420
24423
|
className: extraClassNames + " " + aphrodite.css(...inlineStyles)
|
|
24421
24424
|
}, table);
|
|
@@ -24464,7 +24467,7 @@ const pageMargin = 16;
|
|
|
24464
24467
|
|
|
24465
24468
|
// Stylesheets aren't directly testable
|
|
24466
24469
|
/* c8 ignore next */
|
|
24467
|
-
const styles$
|
|
24470
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
24468
24471
|
mobileTable: {
|
|
24469
24472
|
[mediaQueries.smOrSmaller]: {
|
|
24470
24473
|
minWidth: "auto"
|
|
@@ -24727,7 +24730,7 @@ class CSProgram extends React__namespace.Component {
|
|
|
24727
24730
|
// creator "went wild".
|
|
24728
24731
|
// http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
|
|
24729
24732
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24730
|
-
className: aphrodite.css(styles$
|
|
24733
|
+
className: aphrodite.css(styles$r.widthOverride, styleContainer && styles$r.container)
|
|
24731
24734
|
}, /*#__PURE__*/React__namespace.createElement("iframe", {
|
|
24732
24735
|
sandbox: sandboxOptions,
|
|
24733
24736
|
src: url,
|
|
@@ -24737,7 +24740,7 @@ class CSProgram extends React__namespace.Component {
|
|
|
24737
24740
|
}));
|
|
24738
24741
|
}
|
|
24739
24742
|
}
|
|
24740
|
-
const styles$
|
|
24743
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
24741
24744
|
// Override the inherited width from the perseus paragraph class
|
|
24742
24745
|
// 820 is minimum width for 420px editor and 400px canvas
|
|
24743
24746
|
widthOverride: {
|
|
@@ -24785,7 +24788,7 @@ class Definition extends React__namespace.Component {
|
|
|
24785
24788
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.Popover, {
|
|
24786
24789
|
content: /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
|
|
24787
24790
|
color: "white",
|
|
24788
|
-
style: styles$
|
|
24791
|
+
style: styles$q.tooltipBody,
|
|
24789
24792
|
closeButtonVisible: true
|
|
24790
24793
|
}, /*#__PURE__*/React__namespace.createElement(Renderer, {
|
|
24791
24794
|
apiOptions: this.props.apiOptions,
|
|
@@ -24816,7 +24819,7 @@ class Definition extends React__namespace.Component {
|
|
|
24816
24819
|
});
|
|
24817
24820
|
}
|
|
24818
24821
|
}
|
|
24819
|
-
const styles$
|
|
24822
|
+
const styles$q = {
|
|
24820
24823
|
tooltipBody: {
|
|
24821
24824
|
color: Color__default["default"].offBlack,
|
|
24822
24825
|
fontSize: 20,
|
|
@@ -25017,15 +25020,15 @@ class Explanation extends React__namespace.Component {
|
|
|
25017
25020
|
const onClick = this._onClick;
|
|
25018
25021
|
if (isMobile) {
|
|
25019
25022
|
promptContainer = /*#__PURE__*/React__namespace.createElement("div", {
|
|
25020
|
-
className: aphrodite.css(styles$
|
|
25023
|
+
className: aphrodite.css(styles$p.linkContainer)
|
|
25021
25024
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
25022
|
-
className: aphrodite.css(styles$
|
|
25025
|
+
className: aphrodite.css(styles$p.mobileExplanationLink),
|
|
25023
25026
|
href: href,
|
|
25024
25027
|
onClick: onClick,
|
|
25025
25028
|
role: "button",
|
|
25026
25029
|
"aria-expanded": this.state.expanded
|
|
25027
25030
|
}, promptText), this.state.expanded && /*#__PURE__*/React__namespace.createElement("svg", {
|
|
25028
|
-
className: aphrodite.css(styles$
|
|
25031
|
+
className: aphrodite.css(styles$p.disclosureArrow)
|
|
25029
25032
|
}, /*#__PURE__*/React__namespace.createElement("polygon", {
|
|
25030
25033
|
style: {
|
|
25031
25034
|
fill: backgroundColor
|
|
@@ -25033,7 +25036,7 @@ class Explanation extends React__namespace.Component {
|
|
|
25033
25036
|
points: `0,${arrowHeight} ` + `${arrowWidth},${arrowHeight} ` + `${arrowWidth / 2},0`
|
|
25034
25037
|
})));
|
|
25035
25038
|
} else {
|
|
25036
|
-
const viewStyling = isArticle ? [styles$
|
|
25039
|
+
const viewStyling = isArticle ? [styles$p.explanationLink, styles$p.articleLink] : [styles$p.explanationLink, styles$p.exerciseLink];
|
|
25037
25040
|
promptContainer = /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
25038
25041
|
onClick: onClick,
|
|
25039
25042
|
"aria-expanded": this.state.expanded
|
|
@@ -25041,11 +25044,11 @@ class Explanation extends React__namespace.Component {
|
|
|
25041
25044
|
style: viewStyling
|
|
25042
25045
|
}, `[${promptText}]`));
|
|
25043
25046
|
}
|
|
25044
|
-
const expandedStyle = isMobile ? styles$
|
|
25047
|
+
const expandedStyle = isMobile ? styles$p.contentExpandedMobile : styles$p.contentExpanded;
|
|
25045
25048
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25046
|
-
className: aphrodite.css(styles$
|
|
25049
|
+
className: aphrodite.css(styles$p.container)
|
|
25047
25050
|
}, promptContainer, this.state.expanded && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25048
|
-
className: aphrodite.css(styles$
|
|
25051
|
+
className: aphrodite.css(styles$p.content, isMobile && styles$p.contentMobile, this.state.expanded && expandedStyle)
|
|
25049
25052
|
// eslint-disable-next-line react/no-string-refs
|
|
25050
25053
|
,
|
|
25051
25054
|
ref: "content"
|
|
@@ -25068,7 +25071,7 @@ const verticalContentPadding = 10;
|
|
|
25068
25071
|
const arrowWidth = 30;
|
|
25069
25072
|
const arrowHeight = 14;
|
|
25070
25073
|
const backgroundColor = gray95;
|
|
25071
|
-
const styles$
|
|
25074
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
25072
25075
|
container: {
|
|
25073
25076
|
display: "inline",
|
|
25074
25077
|
position: "relative"
|
|
@@ -25174,15 +25177,15 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25174
25177
|
onNextQuestion
|
|
25175
25178
|
} = this.props;
|
|
25176
25179
|
const answerBarStyle = {
|
|
25177
|
-
...styles$
|
|
25180
|
+
...styles$o.answerBar,
|
|
25178
25181
|
backgroundColor: answerBarState === "CORRECT" ? Color__default["default"].offWhite : "white",
|
|
25179
25182
|
// Center the "Correct!" message only when there's no next question
|
|
25180
25183
|
justifyContent: answerBarState === "CORRECT" && !onNextQuestion ? "center" : "space-between"
|
|
25181
25184
|
};
|
|
25182
25185
|
const message = answerBarState === "INCORRECT" ? /*#__PURE__*/React__namespace.createElement("span", {
|
|
25183
|
-
style: styles$
|
|
25186
|
+
style: styles$o.text
|
|
25184
25187
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25185
|
-
style: styles$
|
|
25188
|
+
style: styles$o.tryAgainIcon
|
|
25186
25189
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconTryAgain)), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25187
25190
|
style: {
|
|
25188
25191
|
marginLeft: 8
|
|
@@ -25201,7 +25204,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25201
25204
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25202
25205
|
style: answerBarStyle
|
|
25203
25206
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25204
|
-
style: styles$
|
|
25207
|
+
style: styles$o.text
|
|
25205
25208
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25206
25209
|
style: {
|
|
25207
25210
|
fontSize: 28,
|
|
@@ -25223,7 +25226,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
|
|
|
25223
25226
|
}
|
|
25224
25227
|
}
|
|
25225
25228
|
const fontSize = 17;
|
|
25226
|
-
const styles$
|
|
25229
|
+
const styles$o = {
|
|
25227
25230
|
answerBar: {
|
|
25228
25231
|
display: "flex",
|
|
25229
25232
|
alignItems: "center",
|
|
@@ -25423,7 +25426,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25423
25426
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'null'.
|
|
25424
25427
|
gradeStatus = i18n__namespace._("Incorrect");
|
|
25425
25428
|
}
|
|
25426
|
-
const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$
|
|
25429
|
+
const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$n.gradedGroupInSet) : aphrodite.css(styles$n.gradedGroup);
|
|
25427
25430
|
const classes = classNames__default["default"]({
|
|
25428
25431
|
[mobileClass]: apiOptions.isMobile,
|
|
25429
25432
|
"perseus-graded-group": true,
|
|
@@ -25442,7 +25445,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25442
25445
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25443
25446
|
className: classes
|
|
25444
25447
|
}, !!this.props.title && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25445
|
-
className: aphrodite.css(styles$
|
|
25448
|
+
className: aphrodite.css(styles$n.title)
|
|
25446
25449
|
}, this.props.title), /*#__PURE__*/React__namespace.createElement(Renderer, _extends({}, this.props, {
|
|
25447
25450
|
// eslint-disable-next-line react/no-string-refs
|
|
25448
25451
|
ref: "renderer",
|
|
@@ -25475,7 +25478,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25475
25478
|
}, 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
25479
|
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'number | undefined'.
|
|
25477
25480
|
tabIndex: "0",
|
|
25478
|
-
className: aphrodite.css(styles$
|
|
25481
|
+
className: aphrodite.css(styles$n.explanationTitle),
|
|
25479
25482
|
onClick: () => this.setState({
|
|
25480
25483
|
showHint: false
|
|
25481
25484
|
}),
|
|
@@ -25507,7 +25510,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25507
25510
|
showHint: true
|
|
25508
25511
|
});
|
|
25509
25512
|
},
|
|
25510
|
-
className: aphrodite.css(styles$
|
|
25513
|
+
className: aphrodite.css(styles$n.showHintLink)
|
|
25511
25514
|
}, i18n__namespace._("Explain"))), apiOptions.isMobile && answerBarState !== "HIDDEN" && /*#__PURE__*/React__namespace.createElement(GradedGroupAnswerBar, {
|
|
25512
25515
|
apiOptions: apiOptions,
|
|
25513
25516
|
answerBarState: answerBarState,
|
|
@@ -25519,7 +25522,7 @@ class GradedGroup extends React__namespace.Component {
|
|
|
25519
25522
|
const traverseChildWidgets$2 = function (props, traverseRenderer) {
|
|
25520
25523
|
return ___default["default"].extend({}, props, traverseRenderer(props));
|
|
25521
25524
|
};
|
|
25522
|
-
const styles$
|
|
25525
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
25523
25526
|
gradedGroupInSet: {
|
|
25524
25527
|
// Reset a few desktop-only styles that come from graded-group.less
|
|
25525
25528
|
marginLeft: 0,
|
|
@@ -25589,20 +25592,20 @@ class Indicators extends React__namespace.Component {
|
|
|
25589
25592
|
return /*#__PURE__*/React__namespace.createElement("ul", {
|
|
25590
25593
|
// reduntantly add class name for use in .less files--
|
|
25591
25594
|
// the styles object key gets hashed
|
|
25592
|
-
className: classNames__default["default"](aphrodite.css(styles$
|
|
25595
|
+
className: classNames__default["default"](aphrodite.css(styles$m.indicatorContainer), "indicatorContainer")
|
|
25593
25596
|
}, this.props.gradedGroups.map((_ref, i) => {
|
|
25594
25597
|
let {
|
|
25595
25598
|
title
|
|
25596
25599
|
} = _ref;
|
|
25597
25600
|
return /*#__PURE__*/React__namespace.createElement("li", {
|
|
25598
|
-
className: aphrodite.css(styles$
|
|
25601
|
+
className: aphrodite.css(styles$m.indicator),
|
|
25599
25602
|
key: title
|
|
25600
25603
|
}, /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
25601
25604
|
role: "button",
|
|
25602
25605
|
"aria-label": i18n__namespace._("Skip to %(title)s", {
|
|
25603
25606
|
title
|
|
25604
25607
|
}),
|
|
25605
|
-
style: styles$
|
|
25608
|
+
style: styles$m.indicatorButton,
|
|
25606
25609
|
onClick: () => this.props.onChangeCurrentGroup(i),
|
|
25607
25610
|
onKeyDown: e => this.handleKeyDown(e, i)
|
|
25608
25611
|
}, _ref2 => {
|
|
@@ -25612,9 +25615,9 @@ class Indicators extends React__namespace.Component {
|
|
|
25612
25615
|
pressed
|
|
25613
25616
|
} = _ref2;
|
|
25614
25617
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
25615
|
-
style: [styles$
|
|
25618
|
+
style: [styles$m.indicatorDot, (hovered || focused || pressed) && styles$m.indicatorDotFocused]
|
|
25616
25619
|
}, i === this.props.currentGroup && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
25617
|
-
style: styles$
|
|
25620
|
+
style: styles$m.indicatorDotActive
|
|
25618
25621
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25619
25622
|
className: aphrodite.css(a11y.srOnly)
|
|
25620
25623
|
}, i18n__namespace._("Current"))));
|
|
@@ -25690,7 +25693,7 @@ class GradedGroupSet extends React__namespace.Component {
|
|
|
25690
25693
|
} = getDependencies();
|
|
25691
25694
|
if (JIPT.useJIPT && this.props.gradedGroups.length > 1) {
|
|
25692
25695
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25693
|
-
className: aphrodite.css(styles$
|
|
25696
|
+
className: aphrodite.css(styles$m.container)
|
|
25694
25697
|
}, this.props.gradedGroups.map((gradedGroup, i) => {
|
|
25695
25698
|
return (
|
|
25696
25699
|
/*#__PURE__*/
|
|
@@ -25713,13 +25716,13 @@ class GradedGroupSet extends React__namespace.Component {
|
|
|
25713
25716
|
const numGroups = this.props.gradedGroups.length;
|
|
25714
25717
|
const handleNextQuestion = this.state.currentGroup < numGroups - 1 ? this.handleNextQuestion : null;
|
|
25715
25718
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25716
|
-
className: aphrodite.css(styles$
|
|
25719
|
+
className: aphrodite.css(styles$m.container)
|
|
25717
25720
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25718
|
-
className: aphrodite.css(styles$
|
|
25721
|
+
className: aphrodite.css(styles$m.top)
|
|
25719
25722
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25720
|
-
className: aphrodite.css(styles$
|
|
25723
|
+
className: aphrodite.css(styles$m.title)
|
|
25721
25724
|
}, currentGroup.title), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25722
|
-
className: aphrodite.css(styles$
|
|
25725
|
+
className: aphrodite.css(styles$m.spacer)
|
|
25723
25726
|
}), /*#__PURE__*/React__namespace.createElement(Indicators, {
|
|
25724
25727
|
currentGroup: this.state.currentGroup,
|
|
25725
25728
|
gradedGroups: this.props.gradedGroups,
|
|
@@ -25757,7 +25760,7 @@ var GradedGroupSet$1 = {
|
|
|
25757
25760
|
tracking: "all",
|
|
25758
25761
|
isLintable: true
|
|
25759
25762
|
};
|
|
25760
|
-
const styles$
|
|
25763
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
25761
25764
|
top: {
|
|
25762
25765
|
display: "flex",
|
|
25763
25766
|
flexDirection: "row"
|
|
@@ -25862,7 +25865,7 @@ class ButtonGroup extends React__namespace.Component {
|
|
|
25862
25865
|
id: "" + i,
|
|
25863
25866
|
ref: "button" + i,
|
|
25864
25867
|
key: "" + i,
|
|
25865
|
-
className: aphrodite.css(styles$
|
|
25868
|
+
className: aphrodite.css(styles$l.buttonStyle, button.value === value && styles$l.selectedStyle),
|
|
25866
25869
|
onClick: () => this.toggleSelect(button.value)
|
|
25867
25870
|
}, button.content || "" + button.value);
|
|
25868
25871
|
});
|
|
@@ -25875,7 +25878,7 @@ class ButtonGroup extends React__namespace.Component {
|
|
|
25875
25878
|
}, buttons);
|
|
25876
25879
|
}
|
|
25877
25880
|
}
|
|
25878
|
-
const styles$
|
|
25881
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
25879
25882
|
buttonStyle: {
|
|
25880
25883
|
backgroundColor: "white",
|
|
25881
25884
|
border: "1px solid #ccc",
|
|
@@ -28394,18 +28397,51 @@ const SegmentGraph = props => {
|
|
|
28394
28397
|
})));
|
|
28395
28398
|
};
|
|
28396
28399
|
const SegmentView = props => {
|
|
28397
|
-
const
|
|
28400
|
+
const {
|
|
28401
|
+
onMoveSegment,
|
|
28402
|
+
segment: [pt1, pt2]
|
|
28403
|
+
} = props;
|
|
28398
28404
|
const midpoint = mafs.vec.midpoint(pt1, pt2);
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
}
|
|
28405
|
+
const segment = React.useRef(null);
|
|
28406
|
+
const {
|
|
28407
|
+
dragging: isDraggingSegment
|
|
28408
|
+
} = mafs.useMovable({
|
|
28409
|
+
gestureTarget: segment,
|
|
28403
28410
|
point: midpoint,
|
|
28404
|
-
color: Color__default["default"].blue,
|
|
28405
28411
|
onMove: newPoint => {
|
|
28406
|
-
|
|
28412
|
+
onMoveSegment(mafs.vec.sub(newPoint, midpoint));
|
|
28413
|
+
},
|
|
28414
|
+
constrain: p => p
|
|
28415
|
+
});
|
|
28416
|
+
const {
|
|
28417
|
+
viewTransform,
|
|
28418
|
+
userTransform
|
|
28419
|
+
} = mafs.useTransformContext();
|
|
28420
|
+
const transform = mafs.vec.matrixMult(viewTransform, userTransform);
|
|
28421
|
+
const scaledPoint1 = mafs.vec.transform(pt1, transform);
|
|
28422
|
+
const scaledPoint2 = mafs.vec.transform(pt2, transform);
|
|
28423
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("g", {
|
|
28424
|
+
ref: segment,
|
|
28425
|
+
tabIndex: 0,
|
|
28426
|
+
className: "movable-segment",
|
|
28427
|
+
style: {
|
|
28428
|
+
cursor: isDraggingSegment ? "grabbing" : "grab"
|
|
28407
28429
|
}
|
|
28408
|
-
}
|
|
28430
|
+
}, /*#__PURE__*/React__namespace.createElement(SVGLine, {
|
|
28431
|
+
start: scaledPoint1,
|
|
28432
|
+
end: scaledPoint2,
|
|
28433
|
+
style: {
|
|
28434
|
+
stroke: "transparent",
|
|
28435
|
+
strokeWidth: 30
|
|
28436
|
+
}
|
|
28437
|
+
}), /*#__PURE__*/React__namespace.createElement(SVGLine, {
|
|
28438
|
+
start: scaledPoint1,
|
|
28439
|
+
end: scaledPoint2,
|
|
28440
|
+
style: {
|
|
28441
|
+
stroke: "var(--mafs-segment-stroke-color)",
|
|
28442
|
+
strokeWidth: "var(--mafs-segment-stroke-weight)"
|
|
28443
|
+
}
|
|
28444
|
+
})), /*#__PURE__*/React__namespace.createElement(mafs.MovablePoint, {
|
|
28409
28445
|
point: pt1,
|
|
28410
28446
|
color: Color__default["default"].blue,
|
|
28411
28447
|
onMove: newPoint => {
|
|
@@ -28419,6 +28455,20 @@ const SegmentView = props => {
|
|
|
28419
28455
|
}
|
|
28420
28456
|
}));
|
|
28421
28457
|
};
|
|
28458
|
+
function SVGLine(props) {
|
|
28459
|
+
const {
|
|
28460
|
+
start,
|
|
28461
|
+
end,
|
|
28462
|
+
style
|
|
28463
|
+
} = props;
|
|
28464
|
+
return /*#__PURE__*/React__namespace.createElement("line", {
|
|
28465
|
+
x1: start[0],
|
|
28466
|
+
y1: start[1],
|
|
28467
|
+
x2: end[0],
|
|
28468
|
+
y2: end[1],
|
|
28469
|
+
style: style
|
|
28470
|
+
});
|
|
28471
|
+
}
|
|
28422
28472
|
|
|
28423
28473
|
const renderLineLabel = (n, _ref) => {
|
|
28424
28474
|
let [min, max] = _ref;
|
|
@@ -28596,7 +28646,7 @@ const VisibleIcon = () => /*#__PURE__*/React__namespace.createElement("svg", {
|
|
|
28596
28646
|
width: "24",
|
|
28597
28647
|
height: "24",
|
|
28598
28648
|
viewBox: "0 0 24 24",
|
|
28599
|
-
className: aphrodite.css(styles$
|
|
28649
|
+
className: aphrodite.css(styles$k.icon)
|
|
28600
28650
|
}, /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
28601
28651
|
id: "a",
|
|
28602
28652
|
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 +28677,7 @@ const HiddenIcon = () => /*#__PURE__*/React__namespace.createElement("svg", {
|
|
|
28627
28677
|
width: "24",
|
|
28628
28678
|
height: "24",
|
|
28629
28679
|
viewBox: "0 0 24 24",
|
|
28630
|
-
className: aphrodite.css(styles$
|
|
28680
|
+
className: aphrodite.css(styles$k.icon)
|
|
28631
28681
|
}, /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
28632
28682
|
id: "a",
|
|
28633
28683
|
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 +28712,20 @@ const HUD = _ref => {
|
|
|
28662
28712
|
let state;
|
|
28663
28713
|
let icon;
|
|
28664
28714
|
if (enabled) {
|
|
28665
|
-
state = styles$
|
|
28715
|
+
state = styles$k.enabled;
|
|
28666
28716
|
icon = /*#__PURE__*/React__namespace.createElement(VisibleIcon, null);
|
|
28667
28717
|
} else {
|
|
28668
|
-
state = styles$
|
|
28718
|
+
state = styles$k.disabled;
|
|
28669
28719
|
icon = /*#__PURE__*/React__namespace.createElement(HiddenIcon, null);
|
|
28670
28720
|
}
|
|
28671
28721
|
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
28672
|
-
className: aphrodite.css(styles$
|
|
28722
|
+
className: aphrodite.css(styles$k.hud, fixedPosition && styles$k.hudFixedPosition, state),
|
|
28673
28723
|
onClick: e => {
|
|
28674
28724
|
onClick();
|
|
28675
28725
|
}
|
|
28676
28726
|
}, icon, message);
|
|
28677
28727
|
};
|
|
28678
|
-
const styles$
|
|
28728
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
28679
28729
|
hud: {
|
|
28680
28730
|
boxSizing: "border-box",
|
|
28681
28731
|
height: 36,
|
|
@@ -28739,7 +28789,7 @@ const triangleBeforeAfter = {
|
|
|
28739
28789
|
top: "0",
|
|
28740
28790
|
width: "0"
|
|
28741
28791
|
};
|
|
28742
|
-
const styles$
|
|
28792
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
28743
28793
|
infoTip: {
|
|
28744
28794
|
display: "inline-block",
|
|
28745
28795
|
marginLeft: "5px",
|
|
@@ -28780,7 +28830,6 @@ const styles$i = aphrodite.StyleSheet.create({
|
|
|
28780
28830
|
width: "240px"
|
|
28781
28831
|
}
|
|
28782
28832
|
});
|
|
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
28833
|
class InfoTip$1 extends React__namespace.Component {
|
|
28785
28834
|
state = {
|
|
28786
28835
|
hover: false
|
|
@@ -28797,23 +28846,22 @@ class InfoTip$1 extends React__namespace.Component {
|
|
|
28797
28846
|
};
|
|
28798
28847
|
render() {
|
|
28799
28848
|
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,
|
|
28849
|
+
className: aphrodite.css(styles$j.infoTip)
|
|
28850
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28806
28851
|
onMouseEnter: this.handleMouseEnter,
|
|
28807
28852
|
onMouseLeave: this.handleMouseLeave
|
|
28808
|
-
}
|
|
28809
|
-
|
|
28853
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
28854
|
+
size: "small",
|
|
28855
|
+
icon: questionIcon__default["default"]
|
|
28856
|
+
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28857
|
+
className: aphrodite.css(styles$j.infoTipContainer),
|
|
28810
28858
|
style: {
|
|
28811
28859
|
display: this.state.hover ? "block" : "none"
|
|
28812
28860
|
}
|
|
28813
28861
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28814
|
-
className: aphrodite.css(styles$
|
|
28862
|
+
className: aphrodite.css(styles$j.infoTipTriangle)
|
|
28815
28863
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28816
|
-
className: aphrodite.css(styles$
|
|
28864
|
+
className: aphrodite.css(styles$j.verticalShadow, styles$j.infoTipContentContainer)
|
|
28817
28865
|
}, this.props.children)));
|
|
28818
28866
|
}
|
|
28819
28867
|
}
|
|
@@ -28885,7 +28933,7 @@ class MultiButtonGroup extends React__namespace.Component {
|
|
|
28885
28933
|
id: "" + i,
|
|
28886
28934
|
key: "" + i,
|
|
28887
28935
|
ref: "button" + i,
|
|
28888
|
-
className: aphrodite.css(styles$
|
|
28936
|
+
className: aphrodite.css(styles$i.buttonStyle, selected && styles$i.selectedStyle),
|
|
28889
28937
|
onClick: () => this.toggleSelect(button.value)
|
|
28890
28938
|
}, button.content || "" + button.value);
|
|
28891
28939
|
});
|
|
@@ -28897,7 +28945,7 @@ class MultiButtonGroup extends React__namespace.Component {
|
|
|
28897
28945
|
}, buttons);
|
|
28898
28946
|
}
|
|
28899
28947
|
}
|
|
28900
|
-
const styles$
|
|
28948
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
28901
28949
|
buttonStyle: {
|
|
28902
28950
|
backgroundColor: "white",
|
|
28903
28951
|
border: "1px solid #ccc",
|
|
@@ -29162,11 +29210,12 @@ const PropCheckBox = createReactClass__default["default"]({
|
|
|
29162
29210
|
},
|
|
29163
29211
|
render: function () {
|
|
29164
29212
|
const propName = this.propName();
|
|
29165
|
-
return /*#__PURE__*/React__namespace.createElement("label",
|
|
29166
|
-
|
|
29213
|
+
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29214
|
+
className: aphrodite.css(styles$h.labeledCheckbox)
|
|
29215
|
+
}, this._labelAlignLeft() && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, null, this.props.label), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
29167
29216
|
checked: this.props[propName],
|
|
29168
29217
|
onChange: this.toggle
|
|
29169
|
-
}), !this._labelAlignLeft() && this.props.label);
|
|
29218
|
+
}), !this._labelAlignLeft() && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, null, this.props.label));
|
|
29170
29219
|
},
|
|
29171
29220
|
toggle: function () {
|
|
29172
29221
|
const propName = this.propName();
|
|
@@ -29175,6 +29224,13 @@ const PropCheckBox = createReactClass__default["default"]({
|
|
|
29175
29224
|
this.props.onChange(changes);
|
|
29176
29225
|
}
|
|
29177
29226
|
});
|
|
29227
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
29228
|
+
labeledCheckbox: {
|
|
29229
|
+
display: "flex",
|
|
29230
|
+
flexDirection: "row",
|
|
29231
|
+
alignItems: "center"
|
|
29232
|
+
}
|
|
29233
|
+
});
|
|
29178
29234
|
|
|
29179
29235
|
const truth = () => true;
|
|
29180
29236
|
|
|
@@ -41311,7 +41367,7 @@ const init = function (options) {
|
|
|
41311
41367
|
|
|
41312
41368
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
41313
41369
|
const libName = "@khanacademy/perseus";
|
|
41314
|
-
const libVersion = "20.0
|
|
41370
|
+
const libVersion = "20.1.0";
|
|
41315
41371
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41316
41372
|
|
|
41317
41373
|
const apiVersion = {
|