@khanacademy/perseus-editor 2.15.5 → 2.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/es/index.js +190 -329
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +190 -338
- package/dist/index.js.map +1 -1
- package/dist/widgets/interaction-editor/function-editor.d.ts +19 -20
- package/dist/widgets/interaction-editor/interaction-editor.d.ts +23 -14
- package/dist/widgets/interaction-editor/label-editor.d.ts +15 -16
- package/dist/widgets/interaction-editor/line-editor.d.ts +23 -24
- package/dist/widgets/interaction-editor/mathquill-input.d.ts +12 -0
- package/dist/widgets/interaction-editor/movable-line-editor.d.ts +23 -26
- package/dist/widgets/interaction-editor/movable-point-editor.d.ts +18 -22
- package/dist/widgets/interaction-editor/parametric-editor.d.ts +21 -22
- package/dist/widgets/interaction-editor/point-editor.d.ts +13 -14
- package/dist/widgets/interaction-editor/rectangle-editor.d.ts +17 -18
- package/package.json +3 -2
- package/src/widgets/__stories__/interaction-editor.stories.tsx +17 -4
- package/src/widgets/interaction-editor/constraint-editor.tsx +9 -21
- package/src/widgets/interaction-editor/function-editor.tsx +26 -29
- package/src/widgets/interaction-editor/interaction-editor.tsx +24 -17
- package/src/widgets/interaction-editor/label-editor.tsx +20 -24
- package/src/widgets/interaction-editor/line-editor.tsx +30 -34
- package/src/widgets/interaction-editor/mathquill-input.tsx +81 -0
- package/src/widgets/interaction-editor/movable-line-editor.tsx +30 -34
- package/src/widgets/interaction-editor/movable-point-editor.tsx +23 -26
- package/src/widgets/interaction-editor/parametric-editor.tsx +28 -33
- package/src/widgets/interaction-editor/point-editor.tsx +17 -24
- package/src/widgets/interaction-editor/rectangle-editor.tsx +23 -32
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var classNames = require('classnames');
|
|
|
20
20
|
var kmath = require('@khanacademy/kmath');
|
|
21
21
|
var KAS = require('@khanacademy/kas');
|
|
22
22
|
var wonderStuffCore = require('@khanacademy/wonder-stuff-core');
|
|
23
|
+
var mathInput = require('@khanacademy/math-input');
|
|
23
24
|
var Spacing = require('@khanacademy/wonder-blocks-spacing');
|
|
24
25
|
var Typography = require('@khanacademy/wonder-blocks-typography');
|
|
25
26
|
var Button = require('@khanacademy/wonder-blocks-button');
|
|
@@ -64,7 +65,7 @@ var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n$1);
|
|
|
64
65
|
|
|
65
66
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
66
67
|
const libName = "@khanacademy/perseus-editor";
|
|
67
|
-
const libVersion = "2.15.
|
|
68
|
+
const libVersion = "2.15.7";
|
|
68
69
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
69
70
|
|
|
70
71
|
function _extends() {
|
|
@@ -258,13 +259,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
258
259
|
role: "button",
|
|
259
260
|
hideDefaultFocusRing: true,
|
|
260
261
|
"aria-label": title,
|
|
261
|
-
style: styles$
|
|
262
|
+
style: styles$g.button
|
|
262
263
|
}, _ref => {
|
|
263
264
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$c, icon);
|
|
264
265
|
});
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
|
-
const styles$
|
|
268
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
268
269
|
button: {
|
|
269
270
|
backgroundColor: Color__default["default"].gold,
|
|
270
271
|
margin: 2,
|
|
@@ -20787,19 +20788,19 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20787
20788
|
const {
|
|
20788
20789
|
showErrors
|
|
20789
20790
|
} = this.state;
|
|
20790
|
-
const iconStyle = showErrors ? styles$
|
|
20791
|
+
const iconStyle = showErrors ? styles$f.iconExpanded : styles$f.iconCollapsed;
|
|
20791
20792
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20792
|
-
style: styles$
|
|
20793
|
+
style: styles$f.errorContainer
|
|
20793
20794
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20794
|
-
style: styles$
|
|
20795
|
+
style: styles$f.title,
|
|
20795
20796
|
onClick: this.handleToggleTexErrors
|
|
20796
20797
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20797
20798
|
icon: caretRight__default["default"],
|
|
20798
20799
|
style: iconStyle
|
|
20799
20800
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20800
|
-
style: styles$
|
|
20801
|
+
style: styles$f.errorExplanation
|
|
20801
20802
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20802
|
-
style: styles$
|
|
20803
|
+
style: styles$f.error,
|
|
20803
20804
|
key: index
|
|
20804
20805
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20805
20806
|
style: {
|
|
@@ -20808,7 +20809,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20808
20809
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20809
20810
|
}
|
|
20810
20811
|
}
|
|
20811
|
-
const styles$
|
|
20812
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
20812
20813
|
title: {
|
|
20813
20814
|
backgroundColor: "#eee",
|
|
20814
20815
|
fontSize: "1.25em",
|
|
@@ -24820,12 +24821,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24820
24821
|
...otherProps
|
|
24821
24822
|
} = this.props;
|
|
24822
24823
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24823
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$e.baseButton, color === "green" && styles$e.green, color === "orange" && styles$e.orange),
|
|
24824
24825
|
onClick: onClick
|
|
24825
24826
|
}, otherProps), children);
|
|
24826
24827
|
}
|
|
24827
24828
|
}
|
|
24828
|
-
const styles$
|
|
24829
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
24829
24830
|
baseButton: {
|
|
24830
24831
|
top: "0",
|
|
24831
24832
|
fontSize: "11px",
|
|
@@ -25038,23 +25039,23 @@ const LeafContainer = _ref2 => {
|
|
|
25038
25039
|
} = _ref2;
|
|
25039
25040
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
25040
25041
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25041
|
-
className: aphrodite.css(styles$
|
|
25042
|
+
className: aphrodite.css(styles$d.containerHeader)
|
|
25042
25043
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
25043
25044
|
depth: path.length,
|
|
25044
|
-
className: aphrodite.css(styles$
|
|
25045
|
+
className: aphrodite.css(styles$d.containerTitle)
|
|
25045
25046
|
}, capitalize(name)));
|
|
25046
25047
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25047
|
-
className: aphrodite.css(styles$
|
|
25048
|
+
className: aphrodite.css(styles$d.container)
|
|
25048
25049
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25049
|
-
className: aphrodite.css(styles$
|
|
25050
|
+
className: aphrodite.css(styles$d.row, styles$d.rowHeading)
|
|
25050
25051
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25051
|
-
className: aphrodite.css(styles$
|
|
25052
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25052
25053
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
25054
|
+
className: "pod-title " + aphrodite.css(styles$d.containerHeader)
|
|
25054
25055
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25055
|
-
className: aphrodite.css(styles$
|
|
25056
|
+
className: aphrodite.css(styles$d.containerTitle)
|
|
25056
25057
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25057
|
-
className: aphrodite.css(styles$
|
|
25058
|
+
className: aphrodite.css(styles$d.columnRight)
|
|
25058
25059
|
}, previewHeading)), children);
|
|
25059
25060
|
};
|
|
25060
25061
|
const ArrayContainer = props => {
|
|
@@ -25067,11 +25068,11 @@ const ArrayContainer = props => {
|
|
|
25067
25068
|
actions
|
|
25068
25069
|
} = props;
|
|
25069
25070
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25070
|
-
className: aphrodite.css(styles$
|
|
25071
|
+
className: aphrodite.css(styles$d.container)
|
|
25071
25072
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25073
|
+
className: aphrodite.css(styles$d.columnLeft, styles$d.containerHeader)
|
|
25073
25074
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
|
-
className: aphrodite.css(styles$
|
|
25075
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25075
25076
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
25076
25077
|
href: "javascript:void 0",
|
|
25077
25078
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -25085,28 +25086,28 @@ const ObjectContainer = _ref3 => {
|
|
|
25085
25086
|
path
|
|
25086
25087
|
} = _ref3;
|
|
25087
25088
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
25088
|
-
className: aphrodite.css(styles$
|
|
25089
|
+
className: aphrodite.css(styles$d.containerHeader)
|
|
25089
25090
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
25090
25091
|
depth: path.length,
|
|
25091
|
-
className: aphrodite.css(styles$
|
|
25092
|
+
className: aphrodite.css(styles$d.containerTitle)
|
|
25092
25093
|
}, capitalize(name)), controls);
|
|
25093
25094
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25094
|
-
className: aphrodite.css(styles$
|
|
25095
|
+
className: aphrodite.css(styles$d.containerHeader, styles$d.previewCollectionHeader)
|
|
25095
25096
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
25096
25097
|
depth: path.length,
|
|
25097
|
-
className: aphrodite.css(styles$
|
|
25098
|
+
className: aphrodite.css(styles$d.containerTitle)
|
|
25098
25099
|
}, capitalize(name)));
|
|
25099
25100
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
25100
25101
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25101
|
-
className: aphrodite.css(styles$
|
|
25102
|
+
className: aphrodite.css(styles$d.container)
|
|
25102
25103
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
25103
|
-
className: aphrodite.css(styles$
|
|
25104
|
+
className: aphrodite.css(styles$d.row)
|
|
25104
25105
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25105
|
-
className: aphrodite.css(styles$
|
|
25106
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25106
25107
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25107
|
-
className: aphrodite.css(styles$
|
|
25108
|
+
className: aphrodite.css(styles$d.columnRight)
|
|
25108
25109
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25109
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
25110
|
+
className: aphrodite.css(path.length > 0 && styles$d.contentIndent)
|
|
25110
25111
|
}, children));
|
|
25111
25112
|
};
|
|
25112
25113
|
|
|
@@ -25226,11 +25227,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25226
25227
|
className: "framework-perseus"
|
|
25227
25228
|
}, lens(renderers).get(path));
|
|
25228
25229
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25229
|
-
className: aphrodite.css(styles$
|
|
25230
|
+
className: aphrodite.css(styles$d.row)
|
|
25230
25231
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25231
|
-
className: aphrodite.css(styles$
|
|
25232
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25232
25233
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25233
|
-
className: aphrodite.css(sticky && styles$
|
|
25234
|
+
className: aphrodite.css(sticky && styles$d.sticky)
|
|
25234
25235
|
},
|
|
25235
25236
|
/*#__PURE__*/
|
|
25236
25237
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25238,9 +25239,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25238
25239
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25239
25240
|
apiOptions: apiOptions
|
|
25240
25241
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25241
|
-
className: aphrodite.css(styles$
|
|
25242
|
+
className: aphrodite.css(styles$d.columnRight)
|
|
25242
25243
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25243
|
-
className: aphrodite.css(sticky && styles$
|
|
25244
|
+
className: aphrodite.css(sticky && styles$d.sticky)
|
|
25244
25245
|
}, preview))));
|
|
25245
25246
|
});
|
|
25246
25247
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25256,13 +25257,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25256
25257
|
className: "framework-perseus"
|
|
25257
25258
|
}, lens(renderers).get(path));
|
|
25258
25259
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25259
|
-
className: aphrodite.css(styles$
|
|
25260
|
+
className: aphrodite.css(styles$d.row)
|
|
25260
25261
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25261
|
-
className: aphrodite.css(styles$
|
|
25262
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25262
25263
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25263
|
-
className: aphrodite.css(sticky && styles$
|
|
25264
|
+
className: aphrodite.css(sticky && styles$d.sticky)
|
|
25264
25265
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25265
|
-
className: aphrodite.css(styles$
|
|
25266
|
+
className: aphrodite.css(styles$d.hintEditor),
|
|
25266
25267
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25267
25268
|
apiOptions: apiOptions,
|
|
25268
25269
|
showTitle: false,
|
|
@@ -25277,9 +25278,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25277
25278
|
isFirst: true,
|
|
25278
25279
|
isLast: true
|
|
25279
25280
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25280
|
-
className: aphrodite.css(styles$
|
|
25281
|
+
className: aphrodite.css(styles$d.columnRight)
|
|
25281
25282
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25282
|
-
className: aphrodite.css(sticky && styles$
|
|
25283
|
+
className: aphrodite.css(sticky && styles$d.sticky)
|
|
25283
25284
|
}, preview)));
|
|
25284
25285
|
});
|
|
25285
25286
|
const TagsNodeContent = props => {
|
|
@@ -25296,9 +25297,9 @@ const TagsNodeContent = props => {
|
|
|
25296
25297
|
return null;
|
|
25297
25298
|
}
|
|
25298
25299
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25299
|
-
className: aphrodite.css(styles$
|
|
25300
|
+
className: aphrodite.css(styles$d.columnLeft)
|
|
25300
25301
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25301
|
-
className: aphrodite.css(styles$
|
|
25302
|
+
className: aphrodite.css(styles$d.tagsEditor)
|
|
25302
25303
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25303
25304
|
value: data,
|
|
25304
25305
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25329,23 +25330,23 @@ const ArrayNodeContent = props => {
|
|
|
25329
25330
|
const subpath = path.concat(i);
|
|
25330
25331
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25331
25332
|
key: "moveArrayElementUp",
|
|
25332
|
-
className: aphrodite.css(styles$
|
|
25333
|
+
className: aphrodite.css(styles$d.control)
|
|
25333
25334
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25334
25335
|
color: "orange",
|
|
25335
25336
|
title: "Move up",
|
|
25336
25337
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25337
25338
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25338
|
-
className: aphrodite.css(styles$
|
|
25339
|
+
className: aphrodite.css(styles$d.verticalFlip)
|
|
25339
25340
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25340
25341
|
key: "moveArrayElementDown",
|
|
25341
|
-
className: aphrodite.css(styles$
|
|
25342
|
+
className: aphrodite.css(styles$d.control)
|
|
25342
25343
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25343
25344
|
color: "orange",
|
|
25344
25345
|
title: "Move down",
|
|
25345
25346
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25346
25347
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25347
25348
|
key: "removeArrayElement",
|
|
25348
|
-
className: aphrodite.css(styles$
|
|
25349
|
+
className: aphrodite.css(styles$d.control)
|
|
25349
25350
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25350
25351
|
color: "orange",
|
|
25351
25352
|
title: "Delete",
|
|
@@ -25353,7 +25354,7 @@ const ArrayNodeContent = props => {
|
|
|
25353
25354
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTrash$5)))];
|
|
25354
25355
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25355
25356
|
key: i,
|
|
25356
|
-
className: aphrodite.css(styles$
|
|
25357
|
+
className: aphrodite.css(styles$d.arrayElement, !elementIsLeaf && styles$d.arrayElementAndNotLeaf)
|
|
25357
25358
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25358
25359
|
key: i,
|
|
25359
25360
|
shape: shape.elementShape,
|
|
@@ -25379,7 +25380,7 @@ const ObjectNodeContent = props => {
|
|
|
25379
25380
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25380
25381
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25381
25382
|
key: subkey,
|
|
25382
|
-
className: aphrodite.css(styles$
|
|
25383
|
+
className: aphrodite.css(styles$d.objectElement)
|
|
25383
25384
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25384
25385
|
shape: shape.shape[subkey],
|
|
25385
25386
|
data: data[subkey],
|
|
@@ -25548,7 +25549,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25548
25549
|
}, this._renderContent());
|
|
25549
25550
|
}
|
|
25550
25551
|
}
|
|
25551
|
-
const styles$
|
|
25552
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
25552
25553
|
// This is used in a number of places throughout this file.
|
|
25553
25554
|
container: {},
|
|
25554
25555
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25700,47 +25701,47 @@ const StatefulArticleEditor = createReactClass__default["default"]({
|
|
|
25700
25701
|
screen
|
|
25701
25702
|
} = this.state;
|
|
25702
25703
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25703
|
-
style: styles$
|
|
25704
|
+
style: styles$c.controlBar
|
|
25704
25705
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25705
|
-
style: styles$
|
|
25706
|
+
style: styles$c.controls
|
|
25706
25707
|
}, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25707
25708
|
onClick: () => this.setState({
|
|
25708
25709
|
mode: "edit"
|
|
25709
25710
|
}),
|
|
25710
|
-
style: mode === "edit" ? styles$
|
|
25711
|
+
style: mode === "edit" ? styles$c.controlSelected : styles$c.control
|
|
25711
25712
|
}, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25712
25713
|
onClick: () => this.setState({
|
|
25713
25714
|
mode: "preview"
|
|
25714
25715
|
}),
|
|
25715
|
-
style: mode === "preview" ? styles$
|
|
25716
|
+
style: mode === "preview" ? styles$c.controlSelected : styles$c.control
|
|
25716
25717
|
}, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25717
25718
|
onClick: () => this.setState({
|
|
25718
25719
|
mode: "json"
|
|
25719
25720
|
}),
|
|
25720
|
-
style: mode === "json" ? styles$
|
|
25721
|
+
style: mode === "json" ? styles$c.controlSelected : styles$c.control
|
|
25721
25722
|
}, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25722
|
-
style: styles$
|
|
25723
|
+
style: styles$c.controls
|
|
25723
25724
|
}, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25724
25725
|
onClick: () => this.setState({
|
|
25725
25726
|
screen: "phone"
|
|
25726
25727
|
}),
|
|
25727
|
-
style: screen === "phone" ? styles$
|
|
25728
|
+
style: screen === "phone" ? styles$c.controlSelected : styles$c.control
|
|
25728
25729
|
}, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25729
25730
|
onClick: () => this.setState({
|
|
25730
25731
|
screen: "tablet"
|
|
25731
25732
|
}),
|
|
25732
|
-
style: screen === "tablet" ? styles$
|
|
25733
|
+
style: screen === "tablet" ? styles$c.controlSelected : styles$c.control
|
|
25733
25734
|
}, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25734
25735
|
onClick: () => this.setState({
|
|
25735
25736
|
screen: "desktop"
|
|
25736
25737
|
}),
|
|
25737
|
-
style: screen === "desktop" ? styles$
|
|
25738
|
+
style: screen === "desktop" ? styles$c.controlSelected : styles$c.control
|
|
25738
25739
|
}, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25739
|
-
style: styles$
|
|
25740
|
+
style: styles$c.editor
|
|
25740
25741
|
}, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
|
|
25741
25742
|
}
|
|
25742
25743
|
});
|
|
25743
|
-
const styles$
|
|
25744
|
+
const styles$c = {
|
|
25744
25745
|
controlBar: {
|
|
25745
25746
|
marginBottom: 25,
|
|
25746
25747
|
marginTop: 5
|
|
@@ -27272,10 +27273,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27272
27273
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27273
27274
|
className: "perseus-widget-row"
|
|
27274
27275
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
27275
|
-
className: aphrodite.css(styles$
|
|
27276
|
+
className: aphrodite.css(styles$b.title)
|
|
27276
27277
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
27277
27278
|
value: this.props.title,
|
|
27278
|
-
className: aphrodite.css(styles$
|
|
27279
|
+
className: aphrodite.css(styles$b.input)
|
|
27279
27280
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27280
27281
|
,
|
|
27281
27282
|
onChange: this.change("title")
|
|
@@ -27302,7 +27303,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27302
27303
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconPlus$2), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27303
27304
|
className: "perseus-hint-editor"
|
|
27304
27305
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27305
|
-
className: aphrodite.css(styles$
|
|
27306
|
+
className: aphrodite.css(styles$b.hintsTitle)
|
|
27306
27307
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor
|
|
27307
27308
|
// eslint-disable-next-line react/no-string-refs
|
|
27308
27309
|
, {
|
|
@@ -27345,7 +27346,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27345
27346
|
};
|
|
27346
27347
|
};
|
|
27347
27348
|
}
|
|
27348
|
-
const styles$
|
|
27349
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
27349
27350
|
title: {
|
|
27350
27351
|
fontSize: 18,
|
|
27351
27352
|
fontWeight: "bold"
|
|
@@ -28656,28 +28657,73 @@ class InputNumberEditor extends React__namespace.Component {
|
|
|
28656
28657
|
});
|
|
28657
28658
|
}
|
|
28658
28659
|
|
|
28660
|
+
/**
|
|
28661
|
+
* A simple Mathquill MathField input for the InteractionEditor.
|
|
28662
|
+
* Unlike our other uses of Mathquill, we're not using a keypad here;
|
|
28663
|
+
* it's just the input itself for use writing TeX.
|
|
28664
|
+
*/
|
|
28665
|
+
function MathquillInput(props) {
|
|
28666
|
+
const mathFieldWrapperRef = React.useRef(null);
|
|
28667
|
+
const mathFieldInstance = React.useRef();
|
|
28668
|
+
React.useEffect(() => {
|
|
28669
|
+
// If we have the mount for the input, but not the input
|
|
28670
|
+
// make a new Mathquill input
|
|
28671
|
+
if (mathFieldWrapperRef.current && !mathFieldInstance.current) {
|
|
28672
|
+
// Initialize MathQuill.MathField instance
|
|
28673
|
+
mathFieldInstance.current = mathInput.createMathField(mathFieldWrapperRef.current, baseConfig => ({
|
|
28674
|
+
...baseConfig,
|
|
28675
|
+
handlers: {
|
|
28676
|
+
edit: mathField => {
|
|
28677
|
+
// This handler is guaranteed to be called on change, but
|
|
28678
|
+
// unlike React it sometimes generates false positives.
|
|
28679
|
+
// One of these is on initialization (with an empty string
|
|
28680
|
+
// value), so we have to guard against that below.
|
|
28681
|
+
let value = mathField.latex();
|
|
28682
|
+
|
|
28683
|
+
// Provide a MathQuill-compatible way to generate the
|
|
28684
|
+
// not-equals sign without pasting unicode or typing TeX
|
|
28685
|
+
value = value.replace(/<>/g, "\\ne");
|
|
28686
|
+
if (props.value !== value) {
|
|
28687
|
+
props.onChange(value);
|
|
28688
|
+
}
|
|
28689
|
+
},
|
|
28690
|
+
upOutOf: mathField => {
|
|
28691
|
+
// This handler is called when the user presses the up
|
|
28692
|
+
// arrow key, but there is nowhere in the expression to go
|
|
28693
|
+
// up to (no numerator or exponent). For ease of use,
|
|
28694
|
+
// interpret this as an attempt to create an exponent.
|
|
28695
|
+
mathField.typedText("^");
|
|
28696
|
+
}
|
|
28697
|
+
}
|
|
28698
|
+
}));
|
|
28699
|
+
}
|
|
28700
|
+
});
|
|
28701
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28702
|
+
style: styles$a.outerWrapper
|
|
28703
|
+
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28704
|
+
ref: mathFieldWrapperRef,
|
|
28705
|
+
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28706
|
+
}));
|
|
28707
|
+
}
|
|
28708
|
+
const styles$a = aphrodite.StyleSheet.create({
|
|
28709
|
+
outerWrapper: {
|
|
28710
|
+
display: "inline-block",
|
|
28711
|
+
borderStyle: "solid",
|
|
28712
|
+
borderWidth: 1,
|
|
28713
|
+
borderColor: Color__default["default"].offBlack50,
|
|
28714
|
+
borderRadius: 3,
|
|
28715
|
+
background: Color__default["default"].white
|
|
28716
|
+
}
|
|
28717
|
+
});
|
|
28718
|
+
|
|
28659
28719
|
const {
|
|
28660
|
-
MathInput: MathInput$8,
|
|
28661
28720
|
NumberInput: NumberInput$g
|
|
28662
28721
|
} = perseus.components;
|
|
28663
28722
|
const {
|
|
28664
28723
|
getDependencies: getDependencies$8
|
|
28665
28724
|
} = perseus.Dependencies;
|
|
28666
|
-
//
|
|
28667
28725
|
// Editor for function plots
|
|
28668
|
-
//
|
|
28669
|
-
// TODO(eater): Factor this out
|
|
28670
|
-
//
|
|
28671
28726
|
class FunctionEditor extends React__namespace.Component {
|
|
28672
|
-
static propTypes = {
|
|
28673
|
-
...perseus.Changeable.propTypes,
|
|
28674
|
-
value: PropTypes__default["default"].string,
|
|
28675
|
-
rangeMin: PropTypes__default["default"].string,
|
|
28676
|
-
rangeMax: PropTypes__default["default"].string,
|
|
28677
|
-
color: PropTypes__default["default"].string,
|
|
28678
|
-
strokeDashArray: PropTypes__default["default"].string,
|
|
28679
|
-
strokeWidth: PropTypes__default["default"].number
|
|
28680
|
-
};
|
|
28681
28727
|
static defaultProps = {
|
|
28682
28728
|
value: "x",
|
|
28683
28729
|
rangeMin: "-10",
|
|
@@ -28702,30 +28748,21 @@ class FunctionEditor extends React__namespace.Component {
|
|
|
28702
28748
|
const {
|
|
28703
28749
|
TeX
|
|
28704
28750
|
} = getDependencies$8();
|
|
28705
|
-
const analyticsStub = {
|
|
28706
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
28707
|
-
};
|
|
28708
28751
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
28709
28752
|
className: "graph-settings"
|
|
28710
28753
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28711
28754
|
className: "perseus-widget-row"
|
|
28712
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, this.props.funcName + "(x)="), " ", /*#__PURE__*/React__namespace.createElement(
|
|
28713
|
-
buttonsVisible: "never",
|
|
28755
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, this.props.funcName + "(x)="), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28714
28756
|
value: this.props.value,
|
|
28715
|
-
onChange: this.change("value")
|
|
28716
|
-
analytics: analyticsStub
|
|
28757
|
+
onChange: this.change("value")
|
|
28717
28758
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28718
28759
|
className: "perseus-widget-row"
|
|
28719
|
-
}, "Range: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
28720
|
-
buttonsVisible: "never",
|
|
28760
|
+
}, "Range: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28721
28761
|
value: this.props.rangeMin,
|
|
28722
|
-
onChange: this.change("rangeMin")
|
|
28723
|
-
|
|
28724
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$8, {
|
|
28725
|
-
buttonsVisible: "never",
|
|
28762
|
+
onChange: this.change("rangeMin")
|
|
28763
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28726
28764
|
value: this.props.rangeMax,
|
|
28727
|
-
onChange: this.change("rangeMax")
|
|
28728
|
-
analytics: analyticsStub
|
|
28765
|
+
onChange: this.change("rangeMax")
|
|
28729
28766
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28730
28767
|
className: "perseus-widget-row"
|
|
28731
28768
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -28749,26 +28786,14 @@ class FunctionEditor extends React__namespace.Component {
|
|
|
28749
28786
|
}
|
|
28750
28787
|
|
|
28751
28788
|
const {
|
|
28752
|
-
MathInput: MathInput$7,
|
|
28753
28789
|
TextInput: TextInput$5
|
|
28754
28790
|
} = perseus.components;
|
|
28755
28791
|
const {
|
|
28756
28792
|
getDependencies: getDependencies$7
|
|
28757
28793
|
} = perseus.Dependencies;
|
|
28758
|
-
//
|
|
28759
28794
|
// Editor for labels
|
|
28760
|
-
//
|
|
28761
|
-
// TODO(eater): Factor this out maybe?
|
|
28762
28795
|
// TODO(eater): Add text direction
|
|
28763
|
-
//
|
|
28764
28796
|
class LabelEditor extends React__namespace.Component {
|
|
28765
|
-
static propTypes = {
|
|
28766
|
-
...perseus.Changeable.propTypes,
|
|
28767
|
-
color: PropTypes__default["default"].string,
|
|
28768
|
-
coordX: PropTypes__default["default"].string,
|
|
28769
|
-
coordY: PropTypes__default["default"].string,
|
|
28770
|
-
label: PropTypes__default["default"].string
|
|
28771
|
-
};
|
|
28772
28797
|
static defaultProps = {
|
|
28773
28798
|
coordX: "0",
|
|
28774
28799
|
coordY: "0",
|
|
@@ -28791,9 +28816,6 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28791
28816
|
const {
|
|
28792
28817
|
TeX
|
|
28793
28818
|
} = getDependencies$7();
|
|
28794
|
-
const analyticsStub = {
|
|
28795
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
28796
|
-
};
|
|
28797
28819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
28798
28820
|
className: "graph-settings"
|
|
28799
28821
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -28806,16 +28828,12 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28806
28828
|
}
|
|
28807
28829
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28808
28830
|
className: "perseus-widget-row"
|
|
28809
|
-
}, "Location: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
28810
|
-
buttonsVisible: "never",
|
|
28831
|
+
}, "Location: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28811
28832
|
value: this.props.coordX,
|
|
28812
|
-
onChange: this.change("coordX")
|
|
28813
|
-
|
|
28814
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$7, {
|
|
28815
|
-
buttonsVisible: "never",
|
|
28833
|
+
onChange: this.change("coordX")
|
|
28834
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28816
28835
|
value: this.props.coordY,
|
|
28817
|
-
onChange: this.change("coordY")
|
|
28818
|
-
analytics: analyticsStub
|
|
28836
|
+
onChange: this.change("coordY")
|
|
28819
28837
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28820
28838
|
className: "perseus-widget-row"
|
|
28821
28839
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -28826,29 +28844,13 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28826
28844
|
}
|
|
28827
28845
|
|
|
28828
28846
|
const {
|
|
28829
|
-
MathInput: MathInput$6,
|
|
28830
28847
|
NumberInput: NumberInput$f
|
|
28831
28848
|
} = perseus.components;
|
|
28832
28849
|
const {
|
|
28833
28850
|
getDependencies: getDependencies$6
|
|
28834
28851
|
} = perseus.Dependencies;
|
|
28835
|
-
//
|
|
28836
28852
|
// Editor for non-interactive line segments
|
|
28837
|
-
//
|
|
28838
|
-
// TODO(eater): Factor this out
|
|
28839
|
-
//
|
|
28840
28853
|
class LineEditor extends React__namespace.Component {
|
|
28841
|
-
static propTypes = {
|
|
28842
|
-
...perseus.Changeable.propTypes,
|
|
28843
|
-
startX: PropTypes__default["default"].string,
|
|
28844
|
-
startY: PropTypes__default["default"].string,
|
|
28845
|
-
endX: PropTypes__default["default"].string,
|
|
28846
|
-
endY: PropTypes__default["default"].string,
|
|
28847
|
-
color: PropTypes__default["default"].string,
|
|
28848
|
-
strokeDasharray: PropTypes__default["default"].string,
|
|
28849
|
-
arrows: PropTypes__default["default"].string,
|
|
28850
|
-
strokeWidth: PropTypes__default["default"].number
|
|
28851
|
-
};
|
|
28852
28854
|
static defaultProps = {
|
|
28853
28855
|
startX: "-5",
|
|
28854
28856
|
startY: "5",
|
|
@@ -28875,35 +28877,24 @@ class LineEditor extends React__namespace.Component {
|
|
|
28875
28877
|
const {
|
|
28876
28878
|
TeX
|
|
28877
28879
|
} = getDependencies$6();
|
|
28878
|
-
const analyticsStub = {
|
|
28879
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
28880
|
-
};
|
|
28881
28880
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
28882
28881
|
className: "graph-settings"
|
|
28883
28882
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28884
28883
|
className: "perseus-widget-row"
|
|
28885
|
-
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
28886
|
-
buttonsVisible: "never",
|
|
28884
|
+
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28887
28885
|
value: this.props.startX,
|
|
28888
|
-
onChange: this.change("startX")
|
|
28889
|
-
|
|
28890
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$6, {
|
|
28891
|
-
buttonsVisible: "never",
|
|
28886
|
+
onChange: this.change("startX")
|
|
28887
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28892
28888
|
value: this.props.startY,
|
|
28893
|
-
onChange: this.change("startY")
|
|
28894
|
-
analytics: analyticsStub
|
|
28889
|
+
onChange: this.change("startY")
|
|
28895
28890
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28896
28891
|
className: "perseus-widget-row"
|
|
28897
|
-
}, "End: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
28898
|
-
buttonsVisible: "never",
|
|
28892
|
+
}, "End: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28899
28893
|
value: this.props.endX,
|
|
28900
|
-
onChange: this.change("endX")
|
|
28901
|
-
|
|
28902
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$6, {
|
|
28903
|
-
buttonsVisible: "never",
|
|
28894
|
+
onChange: this.change("endX")
|
|
28895
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28904
28896
|
value: this.props.endY,
|
|
28905
|
-
onChange: this.change("endY")
|
|
28906
|
-
analytics: analyticsStub
|
|
28897
|
+
onChange: this.change("endY")
|
|
28907
28898
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28908
28899
|
className: "perseus-widget-row"
|
|
28909
28900
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -28931,7 +28922,6 @@ class LineEditor extends React__namespace.Component {
|
|
|
28931
28922
|
|
|
28932
28923
|
const {
|
|
28933
28924
|
ButtonGroup: ButtonGroup$2,
|
|
28934
|
-
MathInput: MathInput$5,
|
|
28935
28925
|
NumberInput: NumberInput$e
|
|
28936
28926
|
} = perseus.components;
|
|
28937
28927
|
class ConstraintEditor extends React__namespace.Component {
|
|
@@ -28951,9 +28941,6 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28951
28941
|
const {
|
|
28952
28942
|
TeX
|
|
28953
28943
|
} = perseus.Dependencies.getDependencies();
|
|
28954
|
-
const analyticsStub = {
|
|
28955
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
28956
|
-
};
|
|
28957
28944
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28958
28945
|
className: "perseus-widget-row"
|
|
28959
28946
|
}, "Constraint:", " ", /*#__PURE__*/React__namespace.createElement(ButtonGroup$2, {
|
|
@@ -28983,76 +28970,49 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28983
28970
|
className: "graph-settings"
|
|
28984
28971
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28985
28972
|
className: "perseus-widget-row"
|
|
28986
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "x="), " ", /*#__PURE__*/React__namespace.createElement(
|
|
28987
|
-
buttonsVisible: "never",
|
|
28973
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "x="), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28988
28974
|
value: this.props.constraintFn,
|
|
28989
|
-
onChange: this.change("constraintFn")
|
|
28990
|
-
analytics: analyticsStub
|
|
28975
|
+
onChange: this.change("constraintFn")
|
|
28991
28976
|
}))), this.props.constraint === "y" && /*#__PURE__*/React__namespace.createElement("div", {
|
|
28992
28977
|
className: "graph-settings"
|
|
28993
28978
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28994
28979
|
className: "perseus-widget-row"
|
|
28995
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "y="), " ", /*#__PURE__*/React__namespace.createElement(
|
|
28996
|
-
buttonsVisible: "never",
|
|
28980
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "y="), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
28997
28981
|
value: this.props.constraintFn,
|
|
28998
|
-
onChange: this.change("constraintFn")
|
|
28999
|
-
analytics: analyticsStub
|
|
28982
|
+
onChange: this.change("constraintFn")
|
|
29000
28983
|
}))), "Ensure these are set so nothing can be dragged off the canvas:", /*#__PURE__*/React__namespace.createElement("div", {
|
|
29001
28984
|
className: "perseus-widget-row"
|
|
29002
28985
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29003
28986
|
className: "perseus-widget-row"
|
|
29004
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "x \\in \\Large["), " ", /*#__PURE__*/React__namespace.createElement(
|
|
29005
|
-
buttonsVisible: "never",
|
|
28987
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "x \\in \\Large["), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29006
28988
|
value: this.props.constraintXMin,
|
|
29007
|
-
onChange: this.change("constraintXMin")
|
|
29008
|
-
|
|
29009
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ", "), " ", /*#__PURE__*/React__namespace.createElement(MathInput$5, {
|
|
29010
|
-
buttonsVisible: "never",
|
|
28989
|
+
onChange: this.change("constraintXMin")
|
|
28990
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ", "), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29011
28991
|
value: this.props.constraintXMax,
|
|
29012
|
-
onChange: this.change("constraintXMax")
|
|
29013
|
-
analytics: analyticsStub
|
|
28992
|
+
onChange: this.change("constraintXMax")
|
|
29014
28993
|
}), " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large]"))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29015
28994
|
className: "perseus-widget-row"
|
|
29016
28995
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29017
28996
|
className: "perseus-widget-row"
|
|
29018
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "y \\in \\Large["), " ", /*#__PURE__*/React__namespace.createElement(
|
|
29019
|
-
buttonsVisible: "never",
|
|
28997
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "y \\in \\Large["), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29020
28998
|
value: this.props.constraintYMin,
|
|
29021
|
-
onChange: this.change("constraintYMin")
|
|
29022
|
-
|
|
29023
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ", "), " ", /*#__PURE__*/React__namespace.createElement(MathInput$5, {
|
|
29024
|
-
buttonsVisible: "never",
|
|
28999
|
+
onChange: this.change("constraintYMin")
|
|
29000
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ", "), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29025
29001
|
value: this.props.constraintYMax,
|
|
29026
|
-
onChange: this.change("constraintYMax")
|
|
29027
|
-
analytics: analyticsStub
|
|
29002
|
+
onChange: this.change("constraintYMax")
|
|
29028
29003
|
}), " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large]"))));
|
|
29029
29004
|
}
|
|
29030
29005
|
}
|
|
29031
29006
|
|
|
29032
29007
|
const {
|
|
29033
|
-
MathInput: MathInput$4,
|
|
29034
29008
|
NumberInput: NumberInput$d
|
|
29035
29009
|
} = perseus.components;
|
|
29036
29010
|
const {
|
|
29037
29011
|
getDependencies: getDependencies$5
|
|
29038
29012
|
} = perseus.Dependencies;
|
|
29039
|
-
//
|
|
29040
29013
|
// Editor for interactive movable line segments
|
|
29041
|
-
//
|
|
29042
|
-
// TODO(eater): Factor this out
|
|
29043
29014
|
// TODO(eater): Rethink how constraints are represented
|
|
29044
|
-
//
|
|
29045
29015
|
class MovableLineEditor extends React__namespace.Component {
|
|
29046
|
-
static propTypes = {
|
|
29047
|
-
...perseus.Changeable.propTypes,
|
|
29048
|
-
startX: PropTypes__default["default"].string,
|
|
29049
|
-
startY: PropTypes__default["default"].string,
|
|
29050
|
-
endX: PropTypes__default["default"].string,
|
|
29051
|
-
endY: PropTypes__default["default"].string,
|
|
29052
|
-
constraint: PropTypes__default["default"].string,
|
|
29053
|
-
snap: PropTypes__default["default"].number,
|
|
29054
|
-
constraintFn: PropTypes__default["default"].string
|
|
29055
|
-
};
|
|
29056
29016
|
static defaultProps = {
|
|
29057
29017
|
startX: "-5",
|
|
29058
29018
|
startY: "5",
|
|
@@ -29061,6 +29021,7 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
29061
29021
|
constraint: "none",
|
|
29062
29022
|
snap: 0.5,
|
|
29063
29023
|
constraintFn: "0",
|
|
29024
|
+
// @ts-expect-error - TS2561
|
|
29064
29025
|
constraintXMin: "-10",
|
|
29065
29026
|
constraintXMax: "10",
|
|
29066
29027
|
constraintYMin: "-10",
|
|
@@ -29082,35 +29043,24 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
29082
29043
|
const {
|
|
29083
29044
|
TeX
|
|
29084
29045
|
} = getDependencies$5();
|
|
29085
|
-
const analyticsStub = {
|
|
29086
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
29087
|
-
};
|
|
29088
29046
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
29089
29047
|
className: "graph-settings"
|
|
29090
29048
|
}, "Initial position:", /*#__PURE__*/React__namespace.createElement("div", {
|
|
29091
29049
|
className: "perseus-widget-row"
|
|
29092
|
-
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29093
|
-
buttonsVisible: "never",
|
|
29050
|
+
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29094
29051
|
value: this.props.startX,
|
|
29095
|
-
onChange: this.change("startX")
|
|
29096
|
-
|
|
29097
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$4, {
|
|
29098
|
-
buttonsVisible: "never",
|
|
29052
|
+
onChange: this.change("startX")
|
|
29053
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29099
29054
|
value: this.props.startY,
|
|
29100
|
-
onChange: this.change("startY")
|
|
29101
|
-
analytics: analyticsStub
|
|
29055
|
+
onChange: this.change("startY")
|
|
29102
29056
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29103
29057
|
className: "perseus-widget-row"
|
|
29104
|
-
}, "End: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29105
|
-
buttonsVisible: "never",
|
|
29058
|
+
}, "End: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29106
29059
|
value: this.props.endX,
|
|
29107
|
-
onChange: this.change("endX")
|
|
29108
|
-
|
|
29109
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$4, {
|
|
29110
|
-
buttonsVisible: "never",
|
|
29060
|
+
onChange: this.change("endX")
|
|
29061
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29111
29062
|
value: this.props.endY,
|
|
29112
|
-
onChange: this.change("endY")
|
|
29113
|
-
analytics: analyticsStub
|
|
29063
|
+
onChange: this.change("endY")
|
|
29114
29064
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29115
29065
|
className: "perseus-widget-row"
|
|
29116
29066
|
}, "Start updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), /*#__PURE__*/React__namespace.createElement(NumberInput$d, {
|
|
@@ -29130,33 +29080,21 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
29130
29080
|
}
|
|
29131
29081
|
|
|
29132
29082
|
const {
|
|
29133
|
-
MathInput: MathInput$3,
|
|
29134
29083
|
NumberInput: NumberInput$c
|
|
29135
29084
|
} = perseus.components;
|
|
29136
29085
|
const {
|
|
29137
29086
|
getDependencies: getDependencies$4
|
|
29138
29087
|
} = perseus.Dependencies;
|
|
29139
|
-
//
|
|
29140
29088
|
// Editor for interactive movable points
|
|
29141
|
-
//
|
|
29142
|
-
// TODO(eater): Factor this out
|
|
29143
29089
|
// TODO(eater): Rethink how constraints are represented
|
|
29144
|
-
//
|
|
29145
29090
|
class MovablePointEditor extends React__namespace.Component {
|
|
29146
|
-
static propTypes = {
|
|
29147
|
-
...perseus.Changeable.propTypes,
|
|
29148
|
-
startX: PropTypes__default["default"].string,
|
|
29149
|
-
startY: PropTypes__default["default"].string,
|
|
29150
|
-
constraint: PropTypes__default["default"].string,
|
|
29151
|
-
snap: PropTypes__default["default"].number,
|
|
29152
|
-
constraintFn: PropTypes__default["default"].string
|
|
29153
|
-
};
|
|
29154
29091
|
static defaultProps = {
|
|
29155
29092
|
startX: "0",
|
|
29156
29093
|
startY: "0",
|
|
29157
29094
|
constraint: "none",
|
|
29158
29095
|
snap: 0.5,
|
|
29159
29096
|
constraintFn: "0",
|
|
29097
|
+
// @ts-expect-error - TS2561
|
|
29160
29098
|
constraintXMin: "-10",
|
|
29161
29099
|
constraintXMax: "10",
|
|
29162
29100
|
constraintYMin: "-10",
|
|
@@ -29178,23 +29116,16 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
29178
29116
|
const {
|
|
29179
29117
|
TeX
|
|
29180
29118
|
} = getDependencies$4();
|
|
29181
|
-
const analyticsStub = {
|
|
29182
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
29183
|
-
};
|
|
29184
29119
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
29185
29120
|
className: "graph-settings"
|
|
29186
29121
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29187
29122
|
className: "perseus-widget-row"
|
|
29188
|
-
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29189
|
-
buttonsVisible: "never",
|
|
29123
|
+
}, "Start: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29190
29124
|
value: this.props.startX,
|
|
29191
|
-
onChange: this.change("startX")
|
|
29192
|
-
|
|
29193
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$3, {
|
|
29194
|
-
buttonsVisible: "never",
|
|
29125
|
+
onChange: this.change("startX")
|
|
29126
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29195
29127
|
value: this.props.startY,
|
|
29196
|
-
onChange: this.change("startY")
|
|
29197
|
-
analytics: analyticsStub
|
|
29128
|
+
onChange: this.change("startY")
|
|
29198
29129
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29199
29130
|
className: "perseus-widget-row"
|
|
29200
29131
|
}, "Update ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$c, {
|
|
@@ -29206,28 +29137,13 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
29206
29137
|
}
|
|
29207
29138
|
|
|
29208
29139
|
const {
|
|
29209
|
-
MathInput: MathInput$2,
|
|
29210
29140
|
NumberInput: NumberInput$b
|
|
29211
29141
|
} = perseus.components;
|
|
29212
29142
|
const {
|
|
29213
29143
|
getDependencies: getDependencies$3
|
|
29214
29144
|
} = perseus.Dependencies;
|
|
29215
|
-
//
|
|
29216
29145
|
// Editor for parametric plots
|
|
29217
|
-
//
|
|
29218
|
-
// TODO(eater): Factor this out
|
|
29219
|
-
//
|
|
29220
29146
|
class ParametricEditor extends React__namespace.Component {
|
|
29221
|
-
static propTypes = {
|
|
29222
|
-
...perseus.Changeable.propTypes,
|
|
29223
|
-
x: PropTypes__default["default"].string,
|
|
29224
|
-
y: PropTypes__default["default"].string,
|
|
29225
|
-
rangeMin: PropTypes__default["default"].string,
|
|
29226
|
-
rangeMax: PropTypes__default["default"].string,
|
|
29227
|
-
color: PropTypes__default["default"].string,
|
|
29228
|
-
strokeDashArray: PropTypes__default["default"].string,
|
|
29229
|
-
strokeWidth: PropTypes__default["default"].number
|
|
29230
|
-
};
|
|
29231
29147
|
static defaultProps = {
|
|
29232
29148
|
x: "cos(t)",
|
|
29233
29149
|
y: "sin(t)",
|
|
@@ -29253,37 +29169,26 @@ class ParametricEditor extends React__namespace.Component {
|
|
|
29253
29169
|
const {
|
|
29254
29170
|
TeX
|
|
29255
29171
|
} = getDependencies$3();
|
|
29256
|
-
const analyticsStub = {
|
|
29257
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
29258
|
-
};
|
|
29259
29172
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
29260
29173
|
className: "graph-settings"
|
|
29261
29174
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29262
29175
|
className: "perseus-widget-row"
|
|
29263
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "X(t) ="), " ", /*#__PURE__*/React__namespace.createElement(
|
|
29264
|
-
buttonsVisible: "never",
|
|
29176
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "X(t) ="), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29265
29177
|
value: this.props.x,
|
|
29266
|
-
onChange: this.change("x")
|
|
29267
|
-
analytics: analyticsStub
|
|
29178
|
+
onChange: this.change("x")
|
|
29268
29179
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29269
29180
|
className: "perseus-widget-row"
|
|
29270
|
-
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "Y(t) ="), " ", /*#__PURE__*/React__namespace.createElement(
|
|
29271
|
-
buttonsVisible: "never",
|
|
29181
|
+
}, /*#__PURE__*/React__namespace.createElement(TeX, null, "Y(t) ="), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29272
29182
|
value: this.props.y,
|
|
29273
|
-
onChange: this.change("y")
|
|
29274
|
-
analytics: analyticsStub
|
|
29183
|
+
onChange: this.change("y")
|
|
29275
29184
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29276
29185
|
className: "perseus-widget-row"
|
|
29277
|
-
}, "Range: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29278
|
-
buttonsVisible: "never",
|
|
29186
|
+
}, "Range: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29279
29187
|
value: this.props.rangeMin,
|
|
29280
|
-
onChange: this.change("rangeMin")
|
|
29281
|
-
|
|
29282
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$2, {
|
|
29283
|
-
buttonsVisible: "never",
|
|
29188
|
+
onChange: this.change("rangeMin")
|
|
29189
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29284
29190
|
value: this.props.rangeMax,
|
|
29285
|
-
onChange: this.change("rangeMax")
|
|
29286
|
-
analytics: analyticsStub
|
|
29191
|
+
onChange: this.change("rangeMax")
|
|
29287
29192
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29288
29193
|
className: "perseus-widget-row"
|
|
29289
29194
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -29306,24 +29211,11 @@ class ParametricEditor extends React__namespace.Component {
|
|
|
29306
29211
|
}
|
|
29307
29212
|
}
|
|
29308
29213
|
|
|
29309
|
-
const {
|
|
29310
|
-
MathInput: MathInput$1
|
|
29311
|
-
} = perseus.components;
|
|
29312
29214
|
const {
|
|
29313
29215
|
getDependencies: getDependencies$2
|
|
29314
29216
|
} = perseus.Dependencies;
|
|
29315
|
-
//
|
|
29316
29217
|
// Editor for non-interactive points
|
|
29317
|
-
//
|
|
29318
|
-
// TODO(eater): Factor this out
|
|
29319
|
-
//
|
|
29320
29218
|
class PointEditor extends React__namespace.Component {
|
|
29321
|
-
static propTypes = {
|
|
29322
|
-
...perseus.Changeable.propTypes,
|
|
29323
|
-
coordX: PropTypes__default["default"].string,
|
|
29324
|
-
coordY: PropTypes__default["default"].string,
|
|
29325
|
-
color: PropTypes__default["default"].string
|
|
29326
|
-
};
|
|
29327
29219
|
static defaultProps = {
|
|
29328
29220
|
coordX: "0",
|
|
29329
29221
|
coordY: "0",
|
|
@@ -29345,23 +29237,16 @@ class PointEditor extends React__namespace.Component {
|
|
|
29345
29237
|
const {
|
|
29346
29238
|
TeX
|
|
29347
29239
|
} = getDependencies$2();
|
|
29348
|
-
const analyticsStub = {
|
|
29349
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
29350
|
-
};
|
|
29351
29240
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
29352
29241
|
className: "graph-settings"
|
|
29353
29242
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29354
29243
|
className: "perseus-widget-row"
|
|
29355
|
-
}, "Coordinate: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29356
|
-
buttonsVisible: "never",
|
|
29244
|
+
}, "Coordinate: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29357
29245
|
value: this.props.coordX,
|
|
29358
|
-
onChange: this.change("coordX")
|
|
29359
|
-
|
|
29360
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput$1, {
|
|
29361
|
-
buttonsVisible: "never",
|
|
29246
|
+
onChange: this.change("coordX")
|
|
29247
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29362
29248
|
value: this.props.coordY,
|
|
29363
|
-
onChange: this.change("coordY")
|
|
29364
|
-
analytics: analyticsStub
|
|
29249
|
+
onChange: this.change("coordY")
|
|
29365
29250
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29366
29251
|
className: "perseus-widget-row"
|
|
29367
29252
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -29371,26 +29256,11 @@ class PointEditor extends React__namespace.Component {
|
|
|
29371
29256
|
}
|
|
29372
29257
|
}
|
|
29373
29258
|
|
|
29374
|
-
const {
|
|
29375
|
-
MathInput
|
|
29376
|
-
} = perseus.components;
|
|
29377
29259
|
const {
|
|
29378
29260
|
getDependencies: getDependencies$1
|
|
29379
29261
|
} = perseus.Dependencies;
|
|
29380
|
-
//
|
|
29381
29262
|
// Editor for rectangles
|
|
29382
|
-
//
|
|
29383
|
-
// TODO(eater): Factor this out maybe?
|
|
29384
|
-
//
|
|
29385
29263
|
class RectangleEditor extends React__namespace.Component {
|
|
29386
|
-
static propTypes = {
|
|
29387
|
-
...perseus.Changeable.propTypes,
|
|
29388
|
-
color: PropTypes__default["default"].string,
|
|
29389
|
-
coordX: PropTypes__default["default"].string,
|
|
29390
|
-
coordY: PropTypes__default["default"].string,
|
|
29391
|
-
height: PropTypes__default["default"].string,
|
|
29392
|
-
width: PropTypes__default["default"].string
|
|
29393
|
-
};
|
|
29394
29264
|
static defaultProps = {
|
|
29395
29265
|
coordX: "-5",
|
|
29396
29266
|
coordY: "5",
|
|
@@ -29414,37 +29284,26 @@ class RectangleEditor extends React__namespace.Component {
|
|
|
29414
29284
|
const {
|
|
29415
29285
|
TeX
|
|
29416
29286
|
} = getDependencies$1();
|
|
29417
|
-
const analyticsStub = {
|
|
29418
|
-
onAnalyticsEvent: () => Promise.resolve()
|
|
29419
|
-
};
|
|
29420
29287
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
29421
29288
|
className: "graph-settings"
|
|
29422
29289
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
29423
29290
|
className: "perseus-widget-row"
|
|
29424
|
-
}, "Bottom left: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(
|
|
29425
|
-
buttonsVisible: "never",
|
|
29291
|
+
}, "Bottom left: ", /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large("), /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29426
29292
|
value: this.props.coordX,
|
|
29427
|
-
onChange: this.change("coordX")
|
|
29428
|
-
|
|
29429
|
-
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathInput, {
|
|
29430
|
-
buttonsVisible: "never",
|
|
29293
|
+
onChange: this.change("coordX")
|
|
29294
|
+
}), /*#__PURE__*/React__namespace.createElement(TeX, null, ","), " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29431
29295
|
value: this.props.coordY,
|
|
29432
|
-
onChange: this.change("coordY")
|
|
29433
|
-
analytics: analyticsStub
|
|
29296
|
+
onChange: this.change("coordY")
|
|
29434
29297
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29435
29298
|
className: "perseus-widget-row"
|
|
29436
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(
|
|
29437
|
-
buttonsVisible: "never",
|
|
29299
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29438
29300
|
value: this.props.width,
|
|
29439
|
-
onChange: this.change("width")
|
|
29440
|
-
analytics: analyticsStub
|
|
29301
|
+
onChange: this.change("width")
|
|
29441
29302
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29442
29303
|
className: "perseus-widget-row"
|
|
29443
|
-
}, "Height:", " ", /*#__PURE__*/React__namespace.createElement(
|
|
29444
|
-
buttonsVisible: "never",
|
|
29304
|
+
}, "Height:", " ", /*#__PURE__*/React__namespace.createElement(MathquillInput, {
|
|
29445
29305
|
value: this.props.height,
|
|
29446
|
-
onChange: this.change("height")
|
|
29447
|
-
analytics: analyticsStub
|
|
29306
|
+
onChange: this.change("height")
|
|
29448
29307
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
29449
29308
|
className: "perseus-widget-row"
|
|
29450
29309
|
}, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
|
|
@@ -29475,13 +29334,6 @@ const defaultInteractionProps = {
|
|
|
29475
29334
|
elements: []
|
|
29476
29335
|
};
|
|
29477
29336
|
class InteractionEditor extends React__namespace.Component {
|
|
29478
|
-
// TODO(eater): Make more better
|
|
29479
|
-
static propTypes = {
|
|
29480
|
-
...perseus.Changeable.propTypes,
|
|
29481
|
-
// eslint-disable-next-line react/forbid-prop-types
|
|
29482
|
-
elements: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
29483
|
-
graph: PropTypes__default["default"].objectOf(PropTypes__default["default"].any)
|
|
29484
|
-
};
|
|
29485
29337
|
static widgetName = "interaction";
|
|
29486
29338
|
static defaultProps = defaultInteractionProps;
|
|
29487
29339
|
state = {
|