@khanacademy/perseus-editor 11.0.2 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/graph-locked-figures/locked-figure-select.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings-actions.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figures-section.d.ts +0 -1
- package/dist/components/start-coords-circle.d.ts +11 -0
- package/dist/components/start-coords-quadratic.d.ts +8 -0
- package/dist/components/start-coords-sinusoid.d.ts +8 -0
- package/dist/components/util.d.ts +3 -1
- package/dist/es/index.js +443 -211
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +442 -207
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +128 -140
- package/package.json +3 -3
package/dist/es/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { addLibraryVersionToPerseusDebug, PerseusError, Errors } from '@khanacademy/perseus-core';
|
|
2
|
-
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, getLinearSystemCoords, getSegmentCoords, getLineCoords, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
|
|
2
|
+
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, getQuadraticCoords, getSinusoidCoords, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useRef, useEffect } from 'react';
|
|
5
5
|
import _ from 'underscore';
|
|
6
6
|
import createReactClass from 'create-react-class';
|
|
7
7
|
import Clickable from '@khanacademy/wonder-blocks-clickable';
|
|
8
|
-
import { color, spacing } from '@khanacademy/wonder-blocks-tokens';
|
|
8
|
+
import { color, spacing, font } from '@khanacademy/wonder-blocks-tokens';
|
|
9
9
|
import { StyleSheet, css } from 'aphrodite';
|
|
10
10
|
import $ from 'jquery';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
@@ -37,7 +37,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
|
|
|
37
37
|
|
|
38
38
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
39
39
|
const libName = "@khanacademy/perseus-editor";
|
|
40
|
-
const libVersion = "11.0
|
|
40
|
+
const libVersion = "11.2.0";
|
|
41
41
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
42
42
|
|
|
43
43
|
function _extends() {
|
|
@@ -227,7 +227,7 @@ class SectionControlButton extends React.Component {
|
|
|
227
227
|
role: "button",
|
|
228
228
|
hideDefaultFocusRing: true,
|
|
229
229
|
"aria-label": title,
|
|
230
|
-
style: styles$
|
|
230
|
+
style: styles$L.button
|
|
231
231
|
}, ({
|
|
232
232
|
hovered,
|
|
233
233
|
focused,
|
|
@@ -235,7 +235,7 @@ class SectionControlButton extends React.Component {
|
|
|
235
235
|
}) => /*#__PURE__*/React.createElement(InlineIcon$a, icon));
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const styles$
|
|
238
|
+
const styles$L = StyleSheet.create({
|
|
239
239
|
button: {
|
|
240
240
|
backgroundColor: color.gold,
|
|
241
241
|
margin: 2,
|
|
@@ -20740,13 +20740,13 @@ class WidgetSelect extends React.Component {
|
|
|
20740
20740
|
* that collapse a region.
|
|
20741
20741
|
*/
|
|
20742
20742
|
function ToggleableCaret(props) {
|
|
20743
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20743
|
+
const iconStyle = props.isExpanded ? styles$K.expanded : styles$K.collapsed;
|
|
20744
20744
|
return /*#__PURE__*/React.createElement(PhosphorIcon, {
|
|
20745
20745
|
icon: caretRight,
|
|
20746
20746
|
style: iconStyle
|
|
20747
20747
|
});
|
|
20748
20748
|
}
|
|
20749
|
-
const styles$
|
|
20749
|
+
const styles$K = StyleSheet.create({
|
|
20750
20750
|
collapsed: {
|
|
20751
20751
|
transition: ".15s"
|
|
20752
20752
|
},
|
|
@@ -20779,16 +20779,16 @@ class TexErrorView extends React.Component {
|
|
|
20779
20779
|
showErrors
|
|
20780
20780
|
} = this.state;
|
|
20781
20781
|
return /*#__PURE__*/React.createElement(View, {
|
|
20782
|
-
style: styles$
|
|
20782
|
+
style: styles$J.errorContainer
|
|
20783
20783
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20784
|
-
style: styles$
|
|
20784
|
+
style: styles$J.title,
|
|
20785
20785
|
onClick: this.handleToggleTexErrors
|
|
20786
20786
|
}, /*#__PURE__*/React.createElement(ToggleableCaret, {
|
|
20787
20787
|
isExpanded: showErrors
|
|
20788
20788
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React.createElement(View, {
|
|
20789
|
-
style: styles$
|
|
20789
|
+
style: styles$J.errorExplanation
|
|
20790
20790
|
}, "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.createElement(View, {
|
|
20791
|
-
style: styles$
|
|
20791
|
+
style: styles$J.error,
|
|
20792
20792
|
key: index
|
|
20793
20793
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20794
20794
|
style: {
|
|
@@ -20797,7 +20797,7 @@ class TexErrorView extends React.Component {
|
|
|
20797
20797
|
}, e.math), /*#__PURE__*/React.createElement(View, null, e.message))));
|
|
20798
20798
|
}
|
|
20799
20799
|
}
|
|
20800
|
-
const styles$
|
|
20800
|
+
const styles$J = StyleSheet.create({
|
|
20801
20801
|
title: {
|
|
20802
20802
|
backgroundColor: "#eee",
|
|
20803
20803
|
fontSize: "1.25em",
|
|
@@ -24591,7 +24591,7 @@ class SimpleButton extends React.Component {
|
|
|
24591
24591
|
} = _this$props,
|
|
24592
24592
|
otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);
|
|
24593
24593
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24594
|
-
className: css(styles$
|
|
24594
|
+
className: css(styles$I.baseButton, color === "green" && styles$I.green, color === "orange" && styles$I.orange),
|
|
24595
24595
|
onClick: onClick
|
|
24596
24596
|
}, otherProps), children);
|
|
24597
24597
|
}
|
|
@@ -24606,7 +24606,7 @@ SimpleButton.defaultProps = {
|
|
|
24606
24606
|
color: "green",
|
|
24607
24607
|
onClick: () => {}
|
|
24608
24608
|
};
|
|
24609
|
-
const styles$
|
|
24609
|
+
const styles$I = StyleSheet.create({
|
|
24610
24610
|
baseButton: {
|
|
24611
24611
|
top: "0",
|
|
24612
24612
|
fontSize: "11px",
|
|
@@ -24826,23 +24826,23 @@ const LeafContainer = ({
|
|
|
24826
24826
|
}) => {
|
|
24827
24827
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24828
24828
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React.createElement("div", {
|
|
24829
|
-
className: css(styles$
|
|
24829
|
+
className: css(styles$H.containerHeader)
|
|
24830
24830
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24831
24831
|
depth: path.length,
|
|
24832
|
-
className: css(styles$
|
|
24832
|
+
className: css(styles$H.containerTitle)
|
|
24833
24833
|
}, capitalize(name)));
|
|
24834
24834
|
return /*#__PURE__*/React.createElement("div", {
|
|
24835
|
-
className: css(styles$
|
|
24835
|
+
className: css(styles$H.container)
|
|
24836
24836
|
}, /*#__PURE__*/React.createElement("span", {
|
|
24837
|
-
className: css(styles$
|
|
24837
|
+
className: css(styles$H.row, styles$H.rowHeading)
|
|
24838
24838
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24839
|
-
className: css(styles$
|
|
24839
|
+
className: css(styles$H.columnLeft)
|
|
24840
24840
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24841
|
-
className: "pod-title " + css(styles$
|
|
24841
|
+
className: "pod-title " + css(styles$H.containerHeader)
|
|
24842
24842
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24843
|
-
className: css(styles$
|
|
24843
|
+
className: css(styles$H.containerTitle)
|
|
24844
24844
|
}, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
|
|
24845
|
-
className: css(styles$
|
|
24845
|
+
className: css(styles$H.columnRight)
|
|
24846
24846
|
}, previewHeading)), children);
|
|
24847
24847
|
};
|
|
24848
24848
|
const ArrayContainer = props => {
|
|
@@ -24855,11 +24855,11 @@ const ArrayContainer = props => {
|
|
|
24855
24855
|
actions
|
|
24856
24856
|
} = props;
|
|
24857
24857
|
return /*#__PURE__*/React.createElement("div", {
|
|
24858
|
-
className: css(styles$
|
|
24858
|
+
className: css(styles$H.container)
|
|
24859
24859
|
}, controls && /*#__PURE__*/React.createElement("div", {
|
|
24860
|
-
className: css(styles$
|
|
24860
|
+
className: css(styles$H.columnLeft, styles$H.containerHeader)
|
|
24861
24861
|
}, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
24862
|
-
className: css(styles$
|
|
24862
|
+
className: css(styles$H.columnLeft)
|
|
24863
24863
|
}, /*#__PURE__*/React.createElement("a", {
|
|
24864
24864
|
href: "javascript:void 0",
|
|
24865
24865
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24872,28 +24872,28 @@ const ObjectContainer = ({
|
|
|
24872
24872
|
path
|
|
24873
24873
|
}) => {
|
|
24874
24874
|
const headingEditor = /*#__PURE__*/React.createElement("div", {
|
|
24875
|
-
className: css(styles$
|
|
24875
|
+
className: css(styles$H.containerHeader)
|
|
24876
24876
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24877
24877
|
depth: path.length,
|
|
24878
|
-
className: css(styles$
|
|
24878
|
+
className: css(styles$H.containerTitle)
|
|
24879
24879
|
}, capitalize(name)), controls);
|
|
24880
24880
|
const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
|
|
24881
|
-
className: css(styles$
|
|
24881
|
+
className: css(styles$H.containerHeader, styles$H.previewCollectionHeader)
|
|
24882
24882
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24883
24883
|
depth: path.length,
|
|
24884
|
-
className: css(styles$
|
|
24884
|
+
className: css(styles$H.containerTitle)
|
|
24885
24885
|
}, capitalize(name)));
|
|
24886
24886
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24887
24887
|
return /*#__PURE__*/React.createElement("div", {
|
|
24888
|
-
className: css(styles$
|
|
24888
|
+
className: css(styles$H.container)
|
|
24889
24889
|
}, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
|
|
24890
|
-
className: css(styles$
|
|
24890
|
+
className: css(styles$H.row)
|
|
24891
24891
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24892
|
-
className: css(styles$
|
|
24892
|
+
className: css(styles$H.columnLeft)
|
|
24893
24893
|
}, headingEditor), /*#__PURE__*/React.createElement("div", {
|
|
24894
|
-
className: css(styles$
|
|
24894
|
+
className: css(styles$H.columnRight)
|
|
24895
24895
|
}, headingPreview)), /*#__PURE__*/React.createElement("div", {
|
|
24896
|
-
className: css(path.length > 0 && styles$
|
|
24896
|
+
className: css(path.length > 0 && styles$H.contentIndent)
|
|
24897
24897
|
}, children));
|
|
24898
24898
|
};
|
|
24899
24899
|
|
|
@@ -25016,11 +25016,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25016
25016
|
className: "framework-perseus"
|
|
25017
25017
|
}, lens(renderers).get(path));
|
|
25018
25018
|
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
25019
|
-
className: css(styles$
|
|
25019
|
+
className: css(styles$H.row)
|
|
25020
25020
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25021
|
-
className: css(styles$
|
|
25021
|
+
className: css(styles$H.columnLeft)
|
|
25022
25022
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25023
|
-
className: css(sticky && styles$
|
|
25023
|
+
className: css(sticky && styles$H.sticky)
|
|
25024
25024
|
},
|
|
25025
25025
|
/*#__PURE__*/
|
|
25026
25026
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25028,9 +25028,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25028
25028
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25029
25029
|
apiOptions: apiOptions
|
|
25030
25030
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25031
|
-
className: css(styles$
|
|
25031
|
+
className: css(styles$H.columnRight)
|
|
25032
25032
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25033
|
-
className: css(sticky && styles$
|
|
25033
|
+
className: css(sticky && styles$H.sticky)
|
|
25034
25034
|
}, preview))));
|
|
25035
25035
|
});
|
|
25036
25036
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25046,13 +25046,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25046
25046
|
className: "framework-perseus"
|
|
25047
25047
|
}, lens(renderers).get(path));
|
|
25048
25048
|
return /*#__PURE__*/React.createElement("div", {
|
|
25049
|
-
className: css(styles$
|
|
25049
|
+
className: css(styles$H.row)
|
|
25050
25050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25051
|
-
className: css(styles$
|
|
25051
|
+
className: css(styles$H.columnLeft)
|
|
25052
25052
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25053
|
-
className: css(sticky && styles$
|
|
25053
|
+
className: css(sticky && styles$H.sticky)
|
|
25054
25054
|
}, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
|
|
25055
|
-
className: css(styles$
|
|
25055
|
+
className: css(styles$H.hintEditor),
|
|
25056
25056
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25057
25057
|
apiOptions: apiOptions,
|
|
25058
25058
|
showTitle: false,
|
|
@@ -25067,9 +25067,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25067
25067
|
isFirst: true,
|
|
25068
25068
|
isLast: true
|
|
25069
25069
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25070
|
-
className: css(styles$
|
|
25070
|
+
className: css(styles$H.columnRight)
|
|
25071
25071
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25072
|
-
className: css(sticky && styles$
|
|
25072
|
+
className: css(sticky && styles$H.sticky)
|
|
25073
25073
|
}, preview)));
|
|
25074
25074
|
});
|
|
25075
25075
|
const TagsNodeContent = props => {
|
|
@@ -25086,9 +25086,9 @@ const TagsNodeContent = props => {
|
|
|
25086
25086
|
return null;
|
|
25087
25087
|
}
|
|
25088
25088
|
return /*#__PURE__*/React.createElement("div", {
|
|
25089
|
-
className: css(styles$
|
|
25089
|
+
className: css(styles$H.columnLeft)
|
|
25090
25090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25091
|
-
className: css(styles$
|
|
25091
|
+
className: css(styles$H.tagsEditor)
|
|
25092
25092
|
}, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
|
|
25093
25093
|
value: data,
|
|
25094
25094
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25119,23 +25119,23 @@ const ArrayNodeContent = props => {
|
|
|
25119
25119
|
const subpath = path.concat(i);
|
|
25120
25120
|
const controls = [i > 0 && /*#__PURE__*/React.createElement("div", {
|
|
25121
25121
|
key: "moveArrayElementUp",
|
|
25122
|
-
className: css(styles$
|
|
25122
|
+
className: css(styles$H.control)
|
|
25123
25123
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25124
25124
|
color: "orange",
|
|
25125
25125
|
title: "Move up",
|
|
25126
25126
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25127
25127
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25128
|
-
className: css(styles$
|
|
25128
|
+
className: css(styles$H.verticalFlip)
|
|
25129
25129
|
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
|
|
25130
25130
|
key: "moveArrayElementDown",
|
|
25131
|
-
className: css(styles$
|
|
25131
|
+
className: css(styles$H.control)
|
|
25132
25132
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25133
25133
|
color: "orange",
|
|
25134
25134
|
title: "Move down",
|
|
25135
25135
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25136
25136
|
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
|
|
25137
25137
|
key: "removeArrayElement",
|
|
25138
|
-
className: css(styles$
|
|
25138
|
+
className: css(styles$H.control)
|
|
25139
25139
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25140
25140
|
color: "orange",
|
|
25141
25141
|
title: "Delete",
|
|
@@ -25143,7 +25143,7 @@ const ArrayNodeContent = props => {
|
|
|
25143
25143
|
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$4)))];
|
|
25144
25144
|
return /*#__PURE__*/React.createElement("div", {
|
|
25145
25145
|
key: i,
|
|
25146
|
-
className: css(styles$
|
|
25146
|
+
className: css(styles$H.arrayElement, !elementIsLeaf && styles$H.arrayElementAndNotLeaf)
|
|
25147
25147
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25148
25148
|
key: i,
|
|
25149
25149
|
shape: shape.elementShape,
|
|
@@ -25169,7 +25169,7 @@ const ObjectNodeContent = props => {
|
|
|
25169
25169
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25170
25170
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React.createElement("div", {
|
|
25171
25171
|
key: subkey,
|
|
25172
|
-
className: css(styles$
|
|
25172
|
+
className: css(styles$H.objectElement)
|
|
25173
25173
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25174
25174
|
shape: shape.shape[subkey],
|
|
25175
25175
|
data: data[subkey],
|
|
@@ -25336,7 +25336,7 @@ class MultiRendererEditor extends React.Component {
|
|
|
25336
25336
|
}, this._renderContent());
|
|
25337
25337
|
}
|
|
25338
25338
|
}
|
|
25339
|
-
const styles$
|
|
25339
|
+
const styles$H = StyleSheet.create({
|
|
25340
25340
|
// This is used in a number of places throughout this file.
|
|
25341
25341
|
container: {},
|
|
25342
25342
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25817,7 +25817,7 @@ CSProgramEditor.defaultProps = {
|
|
|
25817
25817
|
};
|
|
25818
25818
|
|
|
25819
25819
|
const {
|
|
25820
|
-
TextInput: TextInput$
|
|
25820
|
+
TextInput: TextInput$9
|
|
25821
25821
|
} = components;
|
|
25822
25822
|
class DefinitionEditor extends React.Component {
|
|
25823
25823
|
constructor(..._args) {
|
|
@@ -25837,7 +25837,7 @@ class DefinitionEditor extends React.Component {
|
|
|
25837
25837
|
target: "_blank"
|
|
25838
25838
|
}, "Definition style guide"), /*#__PURE__*/React.createElement("div", {
|
|
25839
25839
|
className: "perseus-widget-row"
|
|
25840
|
-
}, /*#__PURE__*/React.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
25840
|
+
}, /*#__PURE__*/React.createElement("label", null, "Word to be defined:", " ", /*#__PURE__*/React.createElement(TextInput$9, {
|
|
25841
25841
|
value: this.props.togglePrompt
|
|
25842
25842
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
25843
25843
|
,
|
|
@@ -26246,7 +26246,7 @@ ExampleWidgetEditor.defaultProps = {
|
|
|
26246
26246
|
};
|
|
26247
26247
|
|
|
26248
26248
|
const {
|
|
26249
|
-
TextInput: TextInput$
|
|
26249
|
+
TextInput: TextInput$8
|
|
26250
26250
|
} = components;
|
|
26251
26251
|
const defaultExplanationProps = {
|
|
26252
26252
|
showPrompt: "Explain",
|
|
@@ -26270,14 +26270,14 @@ class ExplanationEditor extends React.Component {
|
|
|
26270
26270
|
className: "perseus-widget-explanation-editor"
|
|
26271
26271
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26272
26272
|
className: "perseus-widget-row"
|
|
26273
|
-
}, /*#__PURE__*/React.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
26273
|
+
}, /*#__PURE__*/React.createElement("label", null, "Prompt to show explanation:", " ", /*#__PURE__*/React.createElement(TextInput$8, {
|
|
26274
26274
|
value: this.props.showPrompt
|
|
26275
26275
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26276
26276
|
,
|
|
26277
26277
|
onChange: this.change("showPrompt")
|
|
26278
26278
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
26279
26279
|
className: "perseus-widget-row"
|
|
26280
|
-
}, /*#__PURE__*/React.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React.createElement(TextInput$
|
|
26280
|
+
}, /*#__PURE__*/React.createElement("label", null, "Prompt to hide explanation:", " ", /*#__PURE__*/React.createElement(TextInput$8, {
|
|
26281
26281
|
value: this.props.hidePrompt
|
|
26282
26282
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26283
26283
|
,
|
|
@@ -26492,7 +26492,8 @@ const SortableItem = createReactClass({
|
|
|
26492
26492
|
|
|
26493
26493
|
const {
|
|
26494
26494
|
InfoTip: InfoTip$i,
|
|
26495
|
-
PropCheckBox: PropCheckBox$a
|
|
26495
|
+
PropCheckBox: PropCheckBox$a,
|
|
26496
|
+
TextInput: TextInput$7
|
|
26496
26497
|
} = components;
|
|
26497
26498
|
|
|
26498
26499
|
// types for iterables
|
|
@@ -26538,7 +26539,7 @@ class ExpressionEditor extends React.Component {
|
|
|
26538
26539
|
// it's a little weird to serialize the react key, but saves some
|
|
26539
26540
|
// effort reconstructing them when this item is loaded later.
|
|
26540
26541
|
"key"];
|
|
26541
|
-
const serializables = ["answerForms", "buttonSets", "functions", "times"];
|
|
26542
|
+
const serializables = ["answerForms", "buttonSets", "functions", "times", "visibleLabel", "ariaLabel"];
|
|
26542
26543
|
const answerForms = this.props.answerForms.map(form => {
|
|
26543
26544
|
return _(form).pick(formSerializables);
|
|
26544
26545
|
});
|
|
@@ -26740,7 +26741,20 @@ class ExpressionEditor extends React.Component {
|
|
|
26740
26741
|
className: "perseus-widget-expression-editor"
|
|
26741
26742
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
26742
26743
|
className: "expression-editor-h3"
|
|
26743
|
-
}, "Global Options"), /*#__PURE__*/React.createElement("div",
|
|
26744
|
+
}, "Global Options"), /*#__PURE__*/React.createElement("div", {
|
|
26745
|
+
className: "perseus-widget-row"
|
|
26746
|
+
}, /*#__PURE__*/React.createElement("label", null, "Visible label:", " ", /*#__PURE__*/React.createElement(TextInput$7, {
|
|
26747
|
+
value: this.props.visibleLabel,
|
|
26748
|
+
onChange: this.change("visibleLabel")
|
|
26749
|
+
})), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React.createElement("div", {
|
|
26750
|
+
className: "perseus-widget-row"
|
|
26751
|
+
}, /*#__PURE__*/React.createElement("label", null, "Aria label:", " ", /*#__PURE__*/React.createElement(TextInput$7, {
|
|
26752
|
+
value: this.props.ariaLabel,
|
|
26753
|
+
onChange: this.change("ariaLabel")
|
|
26754
|
+
})), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React.createElement("a", {
|
|
26755
|
+
href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
|
|
26756
|
+
target: "_blank"
|
|
26757
|
+
}, "this article.")))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PropCheckBox$a, {
|
|
26744
26758
|
times: this.props.times,
|
|
26745
26759
|
onChange: this.props.onChange,
|
|
26746
26760
|
labelAlignment: "right",
|
|
@@ -26908,10 +26922,10 @@ class GradedGroupEditor extends React.Component {
|
|
|
26908
26922
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26909
26923
|
className: "perseus-widget-row"
|
|
26910
26924
|
}, /*#__PURE__*/React.createElement("label", {
|
|
26911
|
-
className: css(styles$
|
|
26925
|
+
className: css(styles$G.title)
|
|
26912
26926
|
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
26913
26927
|
value: this.props.title,
|
|
26914
|
-
className: css(styles$
|
|
26928
|
+
className: css(styles$G.input)
|
|
26915
26929
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26916
26930
|
,
|
|
26917
26931
|
onChange: this.change("title")
|
|
@@ -26936,7 +26950,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
26936
26950
|
}, /*#__PURE__*/React.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
|
|
26937
26951
|
className: "perseus-hint-editor"
|
|
26938
26952
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26939
|
-
className: css(styles$
|
|
26953
|
+
className: css(styles$G.hintsTitle)
|
|
26940
26954
|
}, "Hint"), /*#__PURE__*/React.createElement(Editor, {
|
|
26941
26955
|
ref: this.hintEditor,
|
|
26942
26956
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -26973,7 +26987,7 @@ GradedGroupEditor.defaultProps = {
|
|
|
26973
26987
|
images: {},
|
|
26974
26988
|
hint: null
|
|
26975
26989
|
};
|
|
26976
|
-
const styles$
|
|
26990
|
+
const styles$G = StyleSheet.create({
|
|
26977
26991
|
title: {
|
|
26978
26992
|
fontSize: 18,
|
|
26979
26993
|
fontWeight: "bold"
|
|
@@ -28312,13 +28326,13 @@ function MathquillInput(props) {
|
|
|
28312
28326
|
}
|
|
28313
28327
|
});
|
|
28314
28328
|
return /*#__PURE__*/React.createElement(View, {
|
|
28315
|
-
style: styles$
|
|
28329
|
+
style: styles$F.outerWrapper
|
|
28316
28330
|
}, /*#__PURE__*/React.createElement("span", {
|
|
28317
28331
|
ref: mathFieldWrapperRef,
|
|
28318
28332
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28319
28333
|
}));
|
|
28320
28334
|
}
|
|
28321
|
-
const styles$
|
|
28335
|
+
const styles$F = StyleSheet.create({
|
|
28322
28336
|
outerWrapper: {
|
|
28323
28337
|
display: "inline-block",
|
|
28324
28338
|
borderStyle: "solid",
|
|
@@ -29364,16 +29378,16 @@ const LabeledRow = props => {
|
|
|
29364
29378
|
style
|
|
29365
29379
|
} = props;
|
|
29366
29380
|
return /*#__PURE__*/React.createElement("label", {
|
|
29367
|
-
className: css(styles$
|
|
29381
|
+
className: css(styles$E.label)
|
|
29368
29382
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29369
|
-
style: [styles$
|
|
29383
|
+
style: [styles$E.row, style]
|
|
29370
29384
|
}, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29371
|
-
style: styles$
|
|
29385
|
+
style: styles$E.spaceEnd
|
|
29372
29386
|
}, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29373
|
-
style: styles$
|
|
29387
|
+
style: styles$E.spaceStart
|
|
29374
29388
|
}, label)));
|
|
29375
29389
|
};
|
|
29376
|
-
const styles$
|
|
29390
|
+
const styles$E = StyleSheet.create({
|
|
29377
29391
|
label: {
|
|
29378
29392
|
width: "fit-content"
|
|
29379
29393
|
},
|
|
@@ -29450,11 +29464,11 @@ class Spring extends React.Component {
|
|
|
29450
29464
|
} = this.props;
|
|
29451
29465
|
return React.createElement(View, {
|
|
29452
29466
|
"aria-hidden": "true",
|
|
29453
|
-
style: [styles$
|
|
29467
|
+
style: [styles$D.grow, style]
|
|
29454
29468
|
});
|
|
29455
29469
|
}
|
|
29456
29470
|
}
|
|
29457
|
-
const styles$
|
|
29471
|
+
const styles$D = StyleSheet.create({
|
|
29458
29472
|
grow: {
|
|
29459
29473
|
flexGrow: 1
|
|
29460
29474
|
}
|
|
@@ -29490,11 +29504,11 @@ function Heading({
|
|
|
29490
29504
|
onToggle
|
|
29491
29505
|
}) {
|
|
29492
29506
|
return /*#__PURE__*/React.createElement(Clickable, {
|
|
29493
|
-
style: [styles$
|
|
29507
|
+
style: [styles$C.container, !isCollapsible && styles$C.notClickable],
|
|
29494
29508
|
disabled: !isCollapsible,
|
|
29495
29509
|
onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
|
|
29496
29510
|
}, () => /*#__PURE__*/React.createElement(View, {
|
|
29497
|
-
style: styles$
|
|
29511
|
+
style: styles$C.heading
|
|
29498
29512
|
}, /*#__PURE__*/React.createElement(LabelLarge, {
|
|
29499
29513
|
style: {
|
|
29500
29514
|
fontSize: 14,
|
|
@@ -29504,7 +29518,7 @@ function Heading({
|
|
|
29504
29518
|
isExpanded: isOpen
|
|
29505
29519
|
})));
|
|
29506
29520
|
}
|
|
29507
|
-
const styles$
|
|
29521
|
+
const styles$C = StyleSheet.create({
|
|
29508
29522
|
container: {
|
|
29509
29523
|
marginTop: spacing.small_12,
|
|
29510
29524
|
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
@@ -29648,10 +29662,54 @@ function getDefaultGraphStartCoords(graph, range, step) {
|
|
|
29648
29662
|
return getLinearSystemCoords(_extends({}, graph, {
|
|
29649
29663
|
startCoords: undefined
|
|
29650
29664
|
}), range, step);
|
|
29665
|
+
case "circle":
|
|
29666
|
+
const startCoords = getCircleCoords(_extends({}, graph, {
|
|
29667
|
+
startCoords: undefined
|
|
29668
|
+
}));
|
|
29669
|
+
const radius = vector.length(vector.subtract(startCoords.radiusPoint, startCoords.center));
|
|
29670
|
+
return {
|
|
29671
|
+
center: startCoords.center,
|
|
29672
|
+
radius
|
|
29673
|
+
};
|
|
29674
|
+
case "sinusoid":
|
|
29675
|
+
return getSinusoidCoords(_extends({}, graph, {
|
|
29676
|
+
startCoords: undefined
|
|
29677
|
+
}), range, step);
|
|
29678
|
+
case "quadratic":
|
|
29679
|
+
return getQuadraticCoords(_extends({}, graph, {
|
|
29680
|
+
startCoords: undefined
|
|
29681
|
+
}), range, step);
|
|
29651
29682
|
default:
|
|
29652
29683
|
return undefined;
|
|
29653
29684
|
}
|
|
29654
29685
|
}
|
|
29686
|
+
const getSinusoidEquation = startCoords => {
|
|
29687
|
+
// Get coefficients
|
|
29688
|
+
// It's assumed that p1 is the root and p2 is the first peak
|
|
29689
|
+
const p1 = startCoords[0];
|
|
29690
|
+
const p2 = startCoords[1];
|
|
29691
|
+
|
|
29692
|
+
// Resulting coefficients are canonical for this sine curve
|
|
29693
|
+
const amplitude = p2[1] - p1[1];
|
|
29694
|
+
const angularFrequency = Math.PI / (2 * (p2[0] - p1[0]));
|
|
29695
|
+
const phase = p1[0] * angularFrequency;
|
|
29696
|
+
const verticalOffset = p1[1];
|
|
29697
|
+
return "y = " + amplitude.toFixed(3) + "sin(" + angularFrequency.toFixed(3) + "x - " + phase.toFixed(3) + ") + " + verticalOffset.toFixed(3);
|
|
29698
|
+
};
|
|
29699
|
+
const getQuadraticEquation = startCoords => {
|
|
29700
|
+
const p1 = startCoords[0];
|
|
29701
|
+
const p2 = startCoords[1];
|
|
29702
|
+
const p3 = startCoords[2];
|
|
29703
|
+
const denom = (p1[0] - p2[0]) * (p1[0] - p3[0]) * (p2[0] - p3[0]);
|
|
29704
|
+
if (denom === 0) {
|
|
29705
|
+
// Many of the callers assume that the return value is always defined.
|
|
29706
|
+
return "Division by zero error";
|
|
29707
|
+
}
|
|
29708
|
+
const a = (p3[0] * (p2[1] - p1[1]) + p2[0] * (p1[1] - p3[1]) + p1[0] * (p3[1] - p2[1])) / denom;
|
|
29709
|
+
const b = (p3[0] * p3[0] * (p1[1] - p2[1]) + p2[0] * p2[0] * (p3[1] - p1[1]) + p1[0] * p1[0] * (p2[1] - p3[1])) / denom;
|
|
29710
|
+
const c = (p2[0] * p3[0] * (p2[0] - p3[0]) * p1[1] + p3[0] * p1[0] * (p3[0] - p1[0]) * p2[1] + p1[0] * p2[0] * (p1[0] - p2[0]) * p3[1]) / denom;
|
|
29711
|
+
return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
|
|
29712
|
+
};
|
|
29655
29713
|
|
|
29656
29714
|
/**
|
|
29657
29715
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29665,19 +29723,20 @@ const LockedFigureSelect = props => {
|
|
|
29665
29723
|
id,
|
|
29666
29724
|
onChange
|
|
29667
29725
|
} = props;
|
|
29668
|
-
const figureTypes =
|
|
29726
|
+
const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
|
|
29727
|
+
const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
|
|
29669
29728
|
return /*#__PURE__*/React.createElement(View, {
|
|
29670
|
-
style: styles$
|
|
29729
|
+
style: styles$B.container
|
|
29671
29730
|
}, /*#__PURE__*/React.createElement(ActionMenu, {
|
|
29672
29731
|
menuText: "Add locked figure",
|
|
29673
|
-
style: styles$
|
|
29674
|
-
},
|
|
29732
|
+
style: styles$B.addElementSelect
|
|
29733
|
+
}, figureTypesCurrent.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
|
|
29675
29734
|
key: `${id}-${figureType}`,
|
|
29676
29735
|
label: figureType,
|
|
29677
29736
|
onClick: () => onChange(figureType)
|
|
29678
29737
|
}))));
|
|
29679
29738
|
};
|
|
29680
|
-
const styles$
|
|
29739
|
+
const styles$B = StyleSheet.create({
|
|
29681
29740
|
container: {
|
|
29682
29741
|
marginTop: spacing.xSmall_8
|
|
29683
29742
|
},
|
|
@@ -29708,19 +29767,19 @@ const AngleInput = props => {
|
|
|
29708
29767
|
}
|
|
29709
29768
|
return /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29710
29769
|
tag: "label",
|
|
29711
|
-
style: styles$
|
|
29770
|
+
style: styles$A.row
|
|
29712
29771
|
}, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
|
|
29713
29772
|
size: spacing.xxSmall_6
|
|
29714
29773
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29715
29774
|
type: "number",
|
|
29716
29775
|
value: angleInput,
|
|
29717
29776
|
onChange: handleAngleChange,
|
|
29718
|
-
style: styles$
|
|
29777
|
+
style: styles$A.textField
|
|
29719
29778
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
29720
29779
|
size: spacing.xxSmall_6
|
|
29721
29780
|
}));
|
|
29722
29781
|
};
|
|
29723
|
-
const styles$
|
|
29782
|
+
const styles$A = StyleSheet.create({
|
|
29724
29783
|
row: {
|
|
29725
29784
|
display: "flex",
|
|
29726
29785
|
flexDirection: "row",
|
|
@@ -29769,32 +29828,32 @@ const CoordinatePairInput = props => {
|
|
|
29769
29828
|
onChange(newCoords);
|
|
29770
29829
|
}
|
|
29771
29830
|
return /*#__PURE__*/React.createElement(View, {
|
|
29772
|
-
style: [styles$
|
|
29831
|
+
style: [styles$z.row, style]
|
|
29773
29832
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29774
29833
|
tag: "label",
|
|
29775
|
-
style: styles$
|
|
29834
|
+
style: styles$z.row
|
|
29776
29835
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29777
29836
|
size: spacing.xxSmall_6
|
|
29778
29837
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29779
29838
|
type: "number",
|
|
29780
29839
|
value: coordState[0],
|
|
29781
29840
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29782
|
-
style: [styles$
|
|
29841
|
+
style: [styles$z.textField, error ? styles$z.errorField : undefined]
|
|
29783
29842
|
})), /*#__PURE__*/React.createElement(Strut, {
|
|
29784
29843
|
size: spacing.medium_16
|
|
29785
29844
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29786
29845
|
tag: "label",
|
|
29787
|
-
style: styles$
|
|
29846
|
+
style: styles$z.row
|
|
29788
29847
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29789
29848
|
size: spacing.xxSmall_6
|
|
29790
29849
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29791
29850
|
type: "number",
|
|
29792
29851
|
value: coordState[1],
|
|
29793
29852
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29794
|
-
style: [styles$
|
|
29853
|
+
style: [styles$z.textField, error ? styles$z.errorField : undefined]
|
|
29795
29854
|
})));
|
|
29796
29855
|
};
|
|
29797
|
-
const styles$
|
|
29856
|
+
const styles$z = StyleSheet.create({
|
|
29798
29857
|
row: {
|
|
29799
29858
|
display: "flex",
|
|
29800
29859
|
flexDirection: "row",
|
|
@@ -29827,14 +29886,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29827
29886
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
29828
29887
|
expanded: expanded,
|
|
29829
29888
|
onToggle: onToggle,
|
|
29830
|
-
style: [styles$
|
|
29831
|
-
headerStyle: styles$
|
|
29889
|
+
style: [styles$y.container, containerStyle],
|
|
29890
|
+
headerStyle: styles$y.accordionHeader,
|
|
29832
29891
|
header: header
|
|
29833
29892
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29834
|
-
style: [styles$
|
|
29893
|
+
style: [styles$y.accordionPanel, panelStyle]
|
|
29835
29894
|
}, children)));
|
|
29836
29895
|
};
|
|
29837
|
-
const styles$
|
|
29896
|
+
const styles$y = StyleSheet.create({
|
|
29838
29897
|
container: {
|
|
29839
29898
|
backgroundColor: color.fadedBlue8,
|
|
29840
29899
|
marginTop: spacing.xSmall_8
|
|
@@ -29865,13 +29924,13 @@ const ColorSwatch = props => {
|
|
|
29865
29924
|
"aria-label":
|
|
29866
29925
|
// Don't include an aria label for decorative circles.
|
|
29867
29926
|
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
29868
|
-
style: [styles$
|
|
29927
|
+
style: [styles$x.colorSwatch, {
|
|
29869
29928
|
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
29870
29929
|
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
29871
29930
|
}]
|
|
29872
29931
|
});
|
|
29873
29932
|
};
|
|
29874
|
-
const styles$
|
|
29933
|
+
const styles$x = StyleSheet.create({
|
|
29875
29934
|
colorSwatch: {
|
|
29876
29935
|
// Add a white outline so that the color swatch is visible when
|
|
29877
29936
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29890,10 +29949,10 @@ const ColorSelect = props => {
|
|
|
29890
29949
|
onChange
|
|
29891
29950
|
} = props;
|
|
29892
29951
|
return /*#__PURE__*/React.createElement(View, {
|
|
29893
|
-
style: [styles$
|
|
29952
|
+
style: [styles$w.row, style]
|
|
29894
29953
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29895
29954
|
tag: "label",
|
|
29896
|
-
style: styles$
|
|
29955
|
+
style: styles$w.row
|
|
29897
29956
|
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
29898
29957
|
size: spacing.xxSmall_6
|
|
29899
29958
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -29912,7 +29971,7 @@ const ColorSelect = props => {
|
|
|
29912
29971
|
})
|
|
29913
29972
|
})))));
|
|
29914
29973
|
};
|
|
29915
|
-
const styles$
|
|
29974
|
+
const styles$w = StyleSheet.create({
|
|
29916
29975
|
row: {
|
|
29917
29976
|
display: "flex",
|
|
29918
29977
|
flexDirection: "row",
|
|
@@ -29928,17 +29987,17 @@ const EllipseSwatch = props => {
|
|
|
29928
29987
|
} = props;
|
|
29929
29988
|
return /*#__PURE__*/React.createElement(View, {
|
|
29930
29989
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
29931
|
-
style: [styles$
|
|
29990
|
+
style: [styles$v.container, {
|
|
29932
29991
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
29933
29992
|
}]
|
|
29934
29993
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29935
|
-
style: [styles$
|
|
29994
|
+
style: [styles$v.innerCircle, {
|
|
29936
29995
|
backgroundColor: lockedFigureColors[color],
|
|
29937
29996
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
29938
29997
|
}]
|
|
29939
29998
|
}));
|
|
29940
29999
|
};
|
|
29941
|
-
const styles$
|
|
30000
|
+
const styles$v = StyleSheet.create({
|
|
29942
30001
|
container: {
|
|
29943
30002
|
// Add a white outline so that the color swatch is visible when
|
|
29944
30003
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29969,40 +30028,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
29969
30028
|
onRemove
|
|
29970
30029
|
} = props;
|
|
29971
30030
|
return /*#__PURE__*/React.createElement(View, {
|
|
29972
|
-
style: styles$
|
|
30031
|
+
style: styles$u.container
|
|
29973
30032
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
29974
30033
|
startIcon: trashIcon,
|
|
29975
30034
|
"aria-label": `Delete locked ${figureType}`,
|
|
29976
30035
|
onClick: onRemove,
|
|
29977
30036
|
kind: "tertiary",
|
|
29978
|
-
style: styles$
|
|
29979
|
-
}, "Delete"), /*#__PURE__*/React.createElement(Spring, null),
|
|
30037
|
+
style: styles$u.deleteButton
|
|
30038
|
+
}, "Delete"), /*#__PURE__*/React.createElement(Spring, null), /*#__PURE__*/React.createElement(IconButton, {
|
|
29980
30039
|
icon: caretDoubleUpIcon,
|
|
29981
30040
|
size: "small",
|
|
29982
30041
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
29983
30042
|
onClick: () => onMove("back"),
|
|
29984
|
-
style: styles$
|
|
30043
|
+
style: styles$u.iconButton
|
|
29985
30044
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29986
30045
|
icon: caretUpIcon,
|
|
29987
30046
|
size: "small",
|
|
29988
30047
|
"aria-label": `Move locked ${figureType} backward`,
|
|
29989
30048
|
onClick: () => onMove("backward"),
|
|
29990
|
-
style: styles$
|
|
30049
|
+
style: styles$u.iconButton
|
|
29991
30050
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29992
30051
|
icon: caretDownIcon,
|
|
29993
30052
|
size: "small",
|
|
29994
30053
|
"aria-label": `Move locked ${figureType} forward`,
|
|
29995
30054
|
onClick: () => onMove("forward"),
|
|
29996
|
-
style: styles$
|
|
30055
|
+
style: styles$u.iconButton
|
|
29997
30056
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29998
30057
|
icon: caretDoubleDownIcon,
|
|
29999
30058
|
size: "small",
|
|
30000
30059
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30001
30060
|
onClick: () => onMove("front"),
|
|
30002
|
-
style: styles$
|
|
30003
|
-
}))
|
|
30061
|
+
style: styles$u.iconButton
|
|
30062
|
+
}));
|
|
30004
30063
|
};
|
|
30005
|
-
const styles$
|
|
30064
|
+
const styles$u = StyleSheet.create({
|
|
30006
30065
|
container: {
|
|
30007
30066
|
width: "100%",
|
|
30008
30067
|
flexDirection: "row",
|
|
@@ -30049,7 +30108,7 @@ const LockedEllipseSettings = props => {
|
|
|
30049
30108
|
/*#__PURE__*/
|
|
30050
30109
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30051
30110
|
React.createElement(View, {
|
|
30052
|
-
style: styles$
|
|
30111
|
+
style: styles$t.row
|
|
30053
30112
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
|
|
30054
30113
|
size: spacing.xSmall_8
|
|
30055
30114
|
}), /*#__PURE__*/React.createElement(EllipseSwatch, {
|
|
@@ -30058,19 +30117,19 @@ const LockedEllipseSettings = props => {
|
|
|
30058
30117
|
strokeStyle: strokeStyle
|
|
30059
30118
|
}))
|
|
30060
30119
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30061
|
-
style: styles$
|
|
30120
|
+
style: styles$t.row
|
|
30062
30121
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30063
30122
|
coord: center,
|
|
30064
|
-
style: styles$
|
|
30123
|
+
style: styles$t.spaceUnder,
|
|
30065
30124
|
onChange: newCoords => onChangeProps({
|
|
30066
30125
|
center: newCoords
|
|
30067
30126
|
})
|
|
30068
30127
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30069
|
-
style: styles$
|
|
30128
|
+
style: styles$t.spaceUnder
|
|
30070
30129
|
}, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30071
30130
|
coord: radius,
|
|
30072
30131
|
labels: ["x radius", "y radius"],
|
|
30073
|
-
style: styles$
|
|
30132
|
+
style: styles$t.spaceUnder,
|
|
30074
30133
|
onChange: newCoords => onChangeProps({
|
|
30075
30134
|
radius: newCoords
|
|
30076
30135
|
})
|
|
@@ -30082,7 +30141,7 @@ const LockedEllipseSettings = props => {
|
|
|
30082
30141
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30083
30142
|
size: spacing.xSmall_8
|
|
30084
30143
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30085
|
-
style: [styles$
|
|
30144
|
+
style: [styles$t.row, styles$t.spaceUnder]
|
|
30086
30145
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30087
30146
|
selectedValue: color,
|
|
30088
30147
|
onChange: handleColorChange
|
|
@@ -30090,7 +30149,7 @@ const LockedEllipseSettings = props => {
|
|
|
30090
30149
|
size: spacing.medium_16
|
|
30091
30150
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30092
30151
|
tag: "label",
|
|
30093
|
-
style: styles$
|
|
30152
|
+
style: styles$t.row
|
|
30094
30153
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30095
30154
|
size: spacing.xxSmall_6
|
|
30096
30155
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30107,7 +30166,7 @@ const LockedEllipseSettings = props => {
|
|
|
30107
30166
|
label: option
|
|
30108
30167
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30109
30168
|
tag: "label",
|
|
30110
|
-
style: styles$
|
|
30169
|
+
style: styles$t.row
|
|
30111
30170
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30112
30171
|
size: spacing.xxSmall_6
|
|
30113
30172
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30125,13 +30184,12 @@ const LockedEllipseSettings = props => {
|
|
|
30125
30184
|
value: "dashed",
|
|
30126
30185
|
label: "dashed"
|
|
30127
30186
|
}))), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30128
|
-
showM2Features: props.showM2Features,
|
|
30129
30187
|
figureType: props.type,
|
|
30130
30188
|
onMove: onMove,
|
|
30131
30189
|
onRemove: onRemove
|
|
30132
30190
|
}));
|
|
30133
30191
|
};
|
|
30134
|
-
const styles$
|
|
30192
|
+
const styles$t = StyleSheet.create({
|
|
30135
30193
|
row: {
|
|
30136
30194
|
display: "flex",
|
|
30137
30195
|
flexDirection: "row",
|
|
@@ -30152,7 +30210,7 @@ const LabeledSwitch = props => {
|
|
|
30152
30210
|
const ids = useUniqueIdWithMock();
|
|
30153
30211
|
const switchId = ids.get("switch");
|
|
30154
30212
|
return /*#__PURE__*/React.createElement(View, {
|
|
30155
|
-
style: [styles$
|
|
30213
|
+
style: [styles$s.row, style]
|
|
30156
30214
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30157
30215
|
id: switchId,
|
|
30158
30216
|
checked: checked,
|
|
@@ -30164,7 +30222,7 @@ const LabeledSwitch = props => {
|
|
|
30164
30222
|
htmlFor: switchId
|
|
30165
30223
|
}, label));
|
|
30166
30224
|
};
|
|
30167
|
-
const styles$
|
|
30225
|
+
const styles$s = StyleSheet.create({
|
|
30168
30226
|
row: {
|
|
30169
30227
|
flexDirection: "row",
|
|
30170
30228
|
alignItems: "center"
|
|
@@ -30198,13 +30256,13 @@ const DefiningPointSettings = props => {
|
|
|
30198
30256
|
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30199
30257
|
expanded: expanded,
|
|
30200
30258
|
onToggle: onToggle,
|
|
30201
|
-
containerStyle: styles$
|
|
30202
|
-
panelStyle: styles$
|
|
30259
|
+
containerStyle: styles$r.container,
|
|
30260
|
+
panelStyle: styles$r.accordionPanel,
|
|
30203
30261
|
header:
|
|
30204
30262
|
/*#__PURE__*/
|
|
30205
30263
|
// Summary: Point, coords, color (filled/open)
|
|
30206
30264
|
React.createElement(View, {
|
|
30207
|
-
style: styles$
|
|
30265
|
+
style: styles$r.row
|
|
30208
30266
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30209
30267
|
size: spacing.xSmall_8
|
|
30210
30268
|
}), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30214,7 +30272,7 @@ const DefiningPointSettings = props => {
|
|
|
30214
30272
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30215
30273
|
coord: coord,
|
|
30216
30274
|
error: !!error,
|
|
30217
|
-
style: styles$
|
|
30275
|
+
style: styles$r.spaceUnder,
|
|
30218
30276
|
onChange: newCoords => {
|
|
30219
30277
|
onChangeProps({
|
|
30220
30278
|
coord: newCoords
|
|
@@ -30223,12 +30281,12 @@ const DefiningPointSettings = props => {
|
|
|
30223
30281
|
}), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30224
30282
|
label: "show point on graph",
|
|
30225
30283
|
checked: !!showPoint,
|
|
30226
|
-
style: showPoint && styles$
|
|
30284
|
+
style: showPoint && styles$r.spaceUnder,
|
|
30227
30285
|
onChange: onTogglePoint
|
|
30228
30286
|
}), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30229
30287
|
selectedValue: pointColor,
|
|
30230
30288
|
onChange: handleColorChange,
|
|
30231
|
-
style: styles$
|
|
30289
|
+
style: styles$r.spaceUnder
|
|
30232
30290
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30233
30291
|
label: "open point",
|
|
30234
30292
|
checked: !filled,
|
|
@@ -30239,7 +30297,7 @@ const DefiningPointSettings = props => {
|
|
|
30239
30297
|
}
|
|
30240
30298
|
})));
|
|
30241
30299
|
};
|
|
30242
|
-
const styles$
|
|
30300
|
+
const styles$r = StyleSheet.create({
|
|
30243
30301
|
container: {
|
|
30244
30302
|
marginTop: spacing.xSmall_8,
|
|
30245
30303
|
marginBottom: 0,
|
|
@@ -30266,15 +30324,15 @@ const LineSwatch = props => {
|
|
|
30266
30324
|
lineStyle
|
|
30267
30325
|
} = props;
|
|
30268
30326
|
return /*#__PURE__*/React.createElement(View, {
|
|
30269
|
-
style: styles$
|
|
30327
|
+
style: styles$q.container
|
|
30270
30328
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30271
30329
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30272
|
-
style: [styles$
|
|
30330
|
+
style: [styles$q.lineSwatch, {
|
|
30273
30331
|
border: `5px ${lineStyle} ${lockedFigureColors[color]}`
|
|
30274
30332
|
}]
|
|
30275
30333
|
}));
|
|
30276
30334
|
};
|
|
30277
|
-
const styles$
|
|
30335
|
+
const styles$q = StyleSheet.create({
|
|
30278
30336
|
container: {
|
|
30279
30337
|
backgroundColor: color.white,
|
|
30280
30338
|
justifyContent: "center",
|
|
@@ -30328,7 +30386,7 @@ const LockedLineSettings = props => {
|
|
|
30328
30386
|
expanded: props.expanded,
|
|
30329
30387
|
onToggle: props.onToggle,
|
|
30330
30388
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30331
|
-
style: styles$
|
|
30389
|
+
style: styles$p.row
|
|
30332
30390
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30333
30391
|
size: spacing.xSmall_8
|
|
30334
30392
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30337,7 +30395,7 @@ const LockedLineSettings = props => {
|
|
|
30337
30395
|
}))
|
|
30338
30396
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30339
30397
|
tag: "label",
|
|
30340
|
-
style: [styles$
|
|
30398
|
+
style: [styles$p.row, styles$p.spaceUnder]
|
|
30341
30399
|
}, "kind", /*#__PURE__*/React.createElement(Strut, {
|
|
30342
30400
|
size: spacing.xxxSmall_4
|
|
30343
30401
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30358,7 +30416,7 @@ const LockedLineSettings = props => {
|
|
|
30358
30416
|
value: "segment",
|
|
30359
30417
|
label: "segment"
|
|
30360
30418
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
30361
|
-
style: styles$
|
|
30419
|
+
style: styles$p.row
|
|
30362
30420
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30363
30421
|
selectedValue: lineColor,
|
|
30364
30422
|
onChange: handleColorChange
|
|
@@ -30366,7 +30424,7 @@ const LockedLineSettings = props => {
|
|
|
30366
30424
|
size: spacing.small_12
|
|
30367
30425
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30368
30426
|
tag: "label",
|
|
30369
|
-
style: styles$
|
|
30427
|
+
style: styles$p.row
|
|
30370
30428
|
}, "style", /*#__PURE__*/React.createElement(Strut, {
|
|
30371
30429
|
size: spacing.xxxSmall_4
|
|
30372
30430
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30377,7 +30435,7 @@ const LockedLineSettings = props => {
|
|
|
30377
30435
|
// Placeholder is required, but never gets used.
|
|
30378
30436
|
,
|
|
30379
30437
|
placeholder: "",
|
|
30380
|
-
style: styles$
|
|
30438
|
+
style: styles$p.selectMarginOffset
|
|
30381
30439
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
30382
30440
|
value: "solid",
|
|
30383
30441
|
label: "solid"
|
|
@@ -30385,7 +30443,7 @@ const LockedLineSettings = props => {
|
|
|
30385
30443
|
value: "dashed",
|
|
30386
30444
|
label: "dashed"
|
|
30387
30445
|
})))), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30388
|
-
style: styles$
|
|
30446
|
+
style: styles$p.errorText
|
|
30389
30447
|
}, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
|
|
30390
30448
|
label: "Point 1",
|
|
30391
30449
|
showPoint: showPoint1,
|
|
@@ -30405,13 +30463,12 @@ const LockedLineSettings = props => {
|
|
|
30405
30463
|
}),
|
|
30406
30464
|
onChangeProps: newProps => handleChangePoint(newProps, 1)
|
|
30407
30465
|
})), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30408
|
-
showM2Features: props.showM2Features,
|
|
30409
30466
|
figureType: props.type,
|
|
30410
30467
|
onMove: onMove,
|
|
30411
30468
|
onRemove: onRemove
|
|
30412
30469
|
}));
|
|
30413
30470
|
};
|
|
30414
|
-
const styles$
|
|
30471
|
+
const styles$p = StyleSheet.create({
|
|
30415
30472
|
row: {
|
|
30416
30473
|
display: "flex",
|
|
30417
30474
|
flexDirection: "row",
|
|
@@ -30456,7 +30513,7 @@ const LockedPointSettings = props => {
|
|
|
30456
30513
|
/*#__PURE__*/
|
|
30457
30514
|
// Summary: Point, coords, color (filled/open)
|
|
30458
30515
|
React.createElement(View, {
|
|
30459
|
-
style: styles$
|
|
30516
|
+
style: styles$o.row
|
|
30460
30517
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30461
30518
|
size: spacing.xSmall_8
|
|
30462
30519
|
}), /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30465,7 +30522,7 @@ const LockedPointSettings = props => {
|
|
|
30465
30522
|
}))
|
|
30466
30523
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30467
30524
|
coord: coord,
|
|
30468
|
-
style: styles$
|
|
30525
|
+
style: styles$o.spaceUnder,
|
|
30469
30526
|
onChange: newCoord => {
|
|
30470
30527
|
onChangeProps({
|
|
30471
30528
|
coord: newCoord
|
|
@@ -30474,7 +30531,7 @@ const LockedPointSettings = props => {
|
|
|
30474
30531
|
}), /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30475
30532
|
selectedValue: pointColor,
|
|
30476
30533
|
onChange: handleColorChange,
|
|
30477
|
-
style: styles$
|
|
30534
|
+
style: styles$o.spaceUnder
|
|
30478
30535
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30479
30536
|
label: "open point",
|
|
30480
30537
|
checked: !filled,
|
|
@@ -30484,13 +30541,12 @@ const LockedPointSettings = props => {
|
|
|
30484
30541
|
});
|
|
30485
30542
|
}
|
|
30486
30543
|
}), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30487
|
-
showM2Features: props.showM2Features,
|
|
30488
30544
|
figureType: props.type,
|
|
30489
30545
|
onMove: onMove,
|
|
30490
30546
|
onRemove: onRemove
|
|
30491
30547
|
}));
|
|
30492
30548
|
};
|
|
30493
|
-
const styles$
|
|
30549
|
+
const styles$o = StyleSheet.create({
|
|
30494
30550
|
row: {
|
|
30495
30551
|
flexDirection: "row",
|
|
30496
30552
|
alignItems: "center"
|
|
@@ -30508,17 +30564,17 @@ const PolygonSwatch = props => {
|
|
|
30508
30564
|
} = props;
|
|
30509
30565
|
return /*#__PURE__*/React.createElement(View, {
|
|
30510
30566
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30511
|
-
style: [styles$
|
|
30567
|
+
style: [styles$n.container, {
|
|
30512
30568
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30513
30569
|
}]
|
|
30514
30570
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30515
|
-
style: [styles$
|
|
30571
|
+
style: [styles$n.innerSquare, {
|
|
30516
30572
|
backgroundColor: lockedFigureColors[color],
|
|
30517
30573
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
30518
30574
|
}]
|
|
30519
30575
|
}));
|
|
30520
30576
|
};
|
|
30521
|
-
const styles$
|
|
30577
|
+
const styles$n = StyleSheet.create({
|
|
30522
30578
|
container: {
|
|
30523
30579
|
// Add a white outline so that the color swatch is visible when
|
|
30524
30580
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30560,7 +30616,7 @@ const LockedPolygonSettings = props => {
|
|
|
30560
30616
|
/*#__PURE__*/
|
|
30561
30617
|
// Summary: Polygon, number of sides, style swatch
|
|
30562
30618
|
React.createElement(View, {
|
|
30563
|
-
style: styles$
|
|
30619
|
+
style: styles$m.row
|
|
30564
30620
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
|
|
30565
30621
|
size: spacing.xSmall_8
|
|
30566
30622
|
}), /*#__PURE__*/React.createElement(PolygonSwatch, {
|
|
@@ -30569,7 +30625,7 @@ const LockedPolygonSettings = props => {
|
|
|
30569
30625
|
strokeStyle: strokeStyle
|
|
30570
30626
|
}))
|
|
30571
30627
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30572
|
-
style: [styles$
|
|
30628
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30573
30629
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30574
30630
|
selectedValue: color,
|
|
30575
30631
|
onChange: handleColorChange
|
|
@@ -30577,7 +30633,7 @@ const LockedPolygonSettings = props => {
|
|
|
30577
30633
|
size: spacing.medium_16
|
|
30578
30634
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30579
30635
|
tag: "label",
|
|
30580
|
-
style: styles$
|
|
30636
|
+
style: styles$m.row
|
|
30581
30637
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30582
30638
|
size: spacing.xxSmall_6
|
|
30583
30639
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30594,7 +30650,7 @@ const LockedPolygonSettings = props => {
|
|
|
30594
30650
|
label: option
|
|
30595
30651
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30596
30652
|
tag: "label",
|
|
30597
|
-
style: [styles$
|
|
30653
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30598
30654
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30599
30655
|
size: spacing.xxSmall_6
|
|
30600
30656
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30617,17 +30673,17 @@ const LockedPolygonSettings = props => {
|
|
|
30617
30673
|
onChange: newValue => onChangeProps({
|
|
30618
30674
|
showVertices: newValue
|
|
30619
30675
|
}),
|
|
30620
|
-
style: styles$
|
|
30676
|
+
style: styles$m.spaceUnder
|
|
30621
30677
|
}), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30622
30678
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
|
|
30623
30679
|
expanded: true,
|
|
30624
|
-
containerStyle: styles$
|
|
30625
|
-
panelStyle: styles$
|
|
30680
|
+
containerStyle: styles$m.pointAccordionContainer,
|
|
30681
|
+
panelStyle: styles$m.pointAccordionPanel
|
|
30626
30682
|
}, points.map((point, index) => {
|
|
30627
30683
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30628
30684
|
return /*#__PURE__*/React.createElement(View, {
|
|
30629
30685
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30630
|
-
style: [styles$
|
|
30686
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30631
30687
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
|
|
30632
30688
|
size: spacing.medium_16
|
|
30633
30689
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -30655,7 +30711,7 @@ const LockedPolygonSettings = props => {
|
|
|
30655
30711
|
points: newPoints
|
|
30656
30712
|
});
|
|
30657
30713
|
},
|
|
30658
|
-
style: styles$
|
|
30714
|
+
style: styles$m.icon
|
|
30659
30715
|
}));
|
|
30660
30716
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
30661
30717
|
kind: "tertiary",
|
|
@@ -30666,13 +30722,12 @@ const LockedPolygonSettings = props => {
|
|
|
30666
30722
|
});
|
|
30667
30723
|
}
|
|
30668
30724
|
}, "Add point")), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30669
|
-
showM2Features: props.showM2Features,
|
|
30670
30725
|
figureType: props.type,
|
|
30671
30726
|
onMove: onMove,
|
|
30672
30727
|
onRemove: onRemove
|
|
30673
30728
|
}));
|
|
30674
30729
|
};
|
|
30675
|
-
const styles$
|
|
30730
|
+
const styles$m = StyleSheet.create({
|
|
30676
30731
|
row: {
|
|
30677
30732
|
display: "flex",
|
|
30678
30733
|
flexDirection: "row",
|
|
@@ -30730,7 +30785,7 @@ const LockedVectorSettings = props => {
|
|
|
30730
30785
|
expanded: props.expanded,
|
|
30731
30786
|
onToggle: props.onToggle,
|
|
30732
30787
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30733
|
-
style: styles$
|
|
30788
|
+
style: styles$l.row
|
|
30734
30789
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30735
30790
|
size: spacing.xSmall_8
|
|
30736
30791
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30738,19 +30793,19 @@ const LockedVectorSettings = props => {
|
|
|
30738
30793
|
lineStyle: "solid"
|
|
30739
30794
|
}))
|
|
30740
30795
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30741
|
-
style: [styles$
|
|
30796
|
+
style: [styles$l.row, styles$l.spaceUnder]
|
|
30742
30797
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30743
30798
|
selectedValue: lineColor,
|
|
30744
30799
|
onChange: handleColorChange
|
|
30745
30800
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30746
|
-
style: styles$
|
|
30801
|
+
style: styles$l.errorText
|
|
30747
30802
|
}, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30748
30803
|
expanded: true // Initial state is expanded
|
|
30749
30804
|
,
|
|
30750
|
-
containerStyle: styles$
|
|
30751
|
-
panelStyle: styles$
|
|
30805
|
+
containerStyle: styles$l.container,
|
|
30806
|
+
panelStyle: styles$l.accordionPanel,
|
|
30752
30807
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30753
|
-
style: styles$
|
|
30808
|
+
style: styles$l.row
|
|
30754
30809
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30755
30810
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30756
30811
|
coord: tail,
|
|
@@ -30761,10 +30816,10 @@ const LockedVectorSettings = props => {
|
|
|
30761
30816
|
})), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30762
30817
|
expanded: true // Initial state is expanded
|
|
30763
30818
|
,
|
|
30764
|
-
containerStyle: styles$
|
|
30765
|
-
panelStyle: styles$
|
|
30819
|
+
containerStyle: styles$l.container,
|
|
30820
|
+
panelStyle: styles$l.accordionPanel,
|
|
30766
30821
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30767
|
-
style: styles$
|
|
30822
|
+
style: styles$l.row
|
|
30768
30823
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30769
30824
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30770
30825
|
coord: tip,
|
|
@@ -30773,13 +30828,12 @@ const LockedVectorSettings = props => {
|
|
|
30773
30828
|
handleChangePoint(newProps, 1);
|
|
30774
30829
|
}
|
|
30775
30830
|
})), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30776
|
-
showM2Features: props.showM2Features,
|
|
30777
30831
|
figureType: props.type,
|
|
30778
30832
|
onMove: onMove,
|
|
30779
30833
|
onRemove: onRemove
|
|
30780
30834
|
}));
|
|
30781
30835
|
};
|
|
30782
|
-
const styles$
|
|
30836
|
+
const styles$l = StyleSheet.create({
|
|
30783
30837
|
accordionPanel: {
|
|
30784
30838
|
paddingBottom: spacing.medium_16
|
|
30785
30839
|
},
|
|
@@ -30816,19 +30870,11 @@ const LockedFigureSettings = props => {
|
|
|
30816
30870
|
case "line":
|
|
30817
30871
|
return /*#__PURE__*/React.createElement(LockedLineSettings, props);
|
|
30818
30872
|
case "vector":
|
|
30819
|
-
|
|
30820
|
-
return /*#__PURE__*/React.createElement(LockedVectorSettings, props);
|
|
30821
|
-
}
|
|
30822
|
-
break;
|
|
30873
|
+
return /*#__PURE__*/React.createElement(LockedVectorSettings, props);
|
|
30823
30874
|
case "ellipse":
|
|
30824
|
-
|
|
30825
|
-
return /*#__PURE__*/React.createElement(LockedEllipseSettings, props);
|
|
30826
|
-
}
|
|
30827
|
-
break;
|
|
30875
|
+
return /*#__PURE__*/React.createElement(LockedEllipseSettings, props);
|
|
30828
30876
|
case "polygon":
|
|
30829
|
-
|
|
30830
|
-
return /*#__PURE__*/React.createElement(LockedPolygonSettings, props);
|
|
30831
|
-
}
|
|
30877
|
+
return /*#__PURE__*/React.createElement(LockedPolygonSettings, props);
|
|
30832
30878
|
}
|
|
30833
30879
|
return null;
|
|
30834
30880
|
};
|
|
@@ -30940,7 +30986,6 @@ const LockedFiguresSection = props => {
|
|
|
30940
30986
|
}
|
|
30941
30987
|
return /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
|
|
30942
30988
|
key: `${uniqueId}-locked-${figure}-${index}`,
|
|
30943
|
-
showM2Features: props.showM2Features,
|
|
30944
30989
|
showM2bFeatures: props.showM2bFeatures,
|
|
30945
30990
|
expanded: expandedStates[index],
|
|
30946
30991
|
onToggle: newValue => {
|
|
@@ -30954,9 +30999,8 @@ const LockedFiguresSection = props => {
|
|
|
30954
30999
|
onRemove: () => removeLockedFigure(index)
|
|
30955
31000
|
}));
|
|
30956
31001
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30957
|
-
style: styles$
|
|
31002
|
+
style: styles$k.buttonContainer
|
|
30958
31003
|
}, /*#__PURE__*/React.createElement(LockedFigureSelect, {
|
|
30959
|
-
showM2Features: props.showM2Features,
|
|
30960
31004
|
showM2bFeatures: props.showM2bFeatures,
|
|
30961
31005
|
id: `${uniqueId}-select`,
|
|
30962
31006
|
onChange: addLockedFigure
|
|
@@ -30965,10 +31009,10 @@ const LockedFiguresSection = props => {
|
|
|
30965
31009
|
}), showExpandButton && /*#__PURE__*/React.createElement(Button, {
|
|
30966
31010
|
kind: "secondary",
|
|
30967
31011
|
onClick: () => toggleExpanded(allCollapsed),
|
|
30968
|
-
style: styles$
|
|
31012
|
+
style: styles$k.button
|
|
30969
31013
|
}, buttonLabel))));
|
|
30970
31014
|
};
|
|
30971
|
-
const styles$
|
|
31015
|
+
const styles$k = StyleSheet.create({
|
|
30972
31016
|
buttonContainer: {
|
|
30973
31017
|
flexDirection: "row",
|
|
30974
31018
|
alignItems: "center"
|
|
@@ -31003,7 +31047,7 @@ const GraphPointsCountSelector = ({
|
|
|
31003
31047
|
// Never uses placeholder, always has value
|
|
31004
31048
|
,
|
|
31005
31049
|
placeholder: "",
|
|
31006
|
-
style: styles$
|
|
31050
|
+
style: styles$j.singleSelectShort
|
|
31007
31051
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31008
31052
|
key: n,
|
|
31009
31053
|
value: `${n}`,
|
|
@@ -31014,7 +31058,7 @@ const GraphPointsCountSelector = ({
|
|
|
31014
31058
|
label: "unlimited"
|
|
31015
31059
|
})]);
|
|
31016
31060
|
};
|
|
31017
|
-
const styles$
|
|
31061
|
+
const styles$j = StyleSheet.create({
|
|
31018
31062
|
singleSelectShort: {
|
|
31019
31063
|
// Non-standard spacing, but it's the smallest we can go
|
|
31020
31064
|
// without running into styling issues with the dropdown.
|
|
@@ -31027,7 +31071,7 @@ const GraphTypeSelector = props => {
|
|
|
31027
31071
|
selectedValue: props.graphType,
|
|
31028
31072
|
onChange: props.onChange,
|
|
31029
31073
|
placeholder: "Select a graph type",
|
|
31030
|
-
style: styles$
|
|
31074
|
+
style: styles$i.singleSelectShort
|
|
31031
31075
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
31032
31076
|
value: "linear",
|
|
31033
31077
|
label: "Linear function"
|
|
@@ -31060,7 +31104,7 @@ const GraphTypeSelector = props => {
|
|
|
31060
31104
|
label: "Angle"
|
|
31061
31105
|
}));
|
|
31062
31106
|
};
|
|
31063
|
-
const styles$
|
|
31107
|
+
const styles$i = StyleSheet.create({
|
|
31064
31108
|
singleSelectShort: {
|
|
31065
31109
|
// Non-standard spacing, but it's the smallest we can go
|
|
31066
31110
|
// without running into styling issues with the dropdown.
|
|
@@ -31464,10 +31508,10 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31464
31508
|
onChange: this.change
|
|
31465
31509
|
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31466
31510
|
label: "Background image URL:",
|
|
31467
|
-
style: styles$
|
|
31511
|
+
style: styles$h.resetSpaceTop
|
|
31468
31512
|
}, /*#__PURE__*/React.createElement("input", {
|
|
31469
31513
|
type: "text",
|
|
31470
|
-
className: css(styles$
|
|
31514
|
+
className: css(styles$h.backgroundUrlInput),
|
|
31471
31515
|
ref: this.bgUrlRef,
|
|
31472
31516
|
value: this.state.backgroundImage.url || "",
|
|
31473
31517
|
onChange: e => {
|
|
@@ -31481,14 +31525,14 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31481
31525
|
onKeyPress: this.changeBackgroundUrl,
|
|
31482
31526
|
onBlur: this.changeBackgroundUrl
|
|
31483
31527
|
}), /*#__PURE__*/React.createElement(InfoTip$c, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
|
|
31484
|
-
style: styles$
|
|
31528
|
+
style: styles$h.protractorSection
|
|
31485
31529
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31486
|
-
style: styles$
|
|
31530
|
+
style: styles$h.checkboxRow
|
|
31487
31531
|
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
31488
31532
|
label: "Show protractor",
|
|
31489
31533
|
showProtractor: this.props.showProtractor,
|
|
31490
31534
|
onChange: this.change,
|
|
31491
|
-
style: styles$
|
|
31535
|
+
style: styles$h.resetSpaceTop
|
|
31492
31536
|
})), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
|
|
31493
31537
|
layout: "floating",
|
|
31494
31538
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31509,7 +31553,7 @@ InteractiveGraphSettings.defaultProps = {
|
|
|
31509
31553
|
showProtractor: false,
|
|
31510
31554
|
showTooltips: false
|
|
31511
31555
|
};
|
|
31512
|
-
const styles$
|
|
31556
|
+
const styles$h = StyleSheet.create({
|
|
31513
31557
|
resetSpaceTop: {
|
|
31514
31558
|
marginTop: 0
|
|
31515
31559
|
},
|
|
@@ -31546,13 +31590,13 @@ const SegmentCountSelector = ({
|
|
|
31546
31590
|
const num = +newValue;
|
|
31547
31591
|
onChange(num);
|
|
31548
31592
|
},
|
|
31549
|
-
style: styles$
|
|
31593
|
+
style: styles$g.singleSelectShort
|
|
31550
31594
|
}, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31551
31595
|
key: n,
|
|
31552
31596
|
value: `${n}`,
|
|
31553
31597
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31554
31598
|
})));
|
|
31555
|
-
const styles$
|
|
31599
|
+
const styles$g = StyleSheet.create({
|
|
31556
31600
|
singleSelectShort: {
|
|
31557
31601
|
// Non-standard spacing, but it's the smallest we can go
|
|
31558
31602
|
// without running into styling issues with the dropdown.
|
|
@@ -31560,13 +31604,65 @@ const styles$d = StyleSheet.create({
|
|
|
31560
31604
|
}
|
|
31561
31605
|
});
|
|
31562
31606
|
|
|
31607
|
+
const StartCoordsCircle = props => {
|
|
31608
|
+
const {
|
|
31609
|
+
startCoords,
|
|
31610
|
+
onChange
|
|
31611
|
+
} = props;
|
|
31612
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
31613
|
+
style: styles$f.tile
|
|
31614
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
31615
|
+
style: styles$f.row
|
|
31616
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Center:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31617
|
+
size: spacing.small_12
|
|
31618
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31619
|
+
coord: startCoords.center,
|
|
31620
|
+
labels: ["x", "y"],
|
|
31621
|
+
onChange: coord => onChange({
|
|
31622
|
+
center: coord,
|
|
31623
|
+
radius: startCoords.radius
|
|
31624
|
+
})
|
|
31625
|
+
})), /*#__PURE__*/React.createElement(Strut, {
|
|
31626
|
+
size: spacing.small_12
|
|
31627
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
31628
|
+
style: styles$f.row
|
|
31629
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Radius:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31630
|
+
size: spacing.small_12
|
|
31631
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
|
31632
|
+
value: startCoords.radius.toString(),
|
|
31633
|
+
type: "number",
|
|
31634
|
+
onChange: value => {
|
|
31635
|
+
onChange({
|
|
31636
|
+
center: startCoords.center,
|
|
31637
|
+
radius: parseFloat(value)
|
|
31638
|
+
});
|
|
31639
|
+
},
|
|
31640
|
+
style: styles$f.textField
|
|
31641
|
+
})));
|
|
31642
|
+
};
|
|
31643
|
+
const styles$f = StyleSheet.create({
|
|
31644
|
+
tile: {
|
|
31645
|
+
backgroundColor: color.fadedBlue8,
|
|
31646
|
+
marginTop: spacing.xSmall_8,
|
|
31647
|
+
padding: spacing.small_12,
|
|
31648
|
+
borderRadius: spacing.xSmall_8
|
|
31649
|
+
},
|
|
31650
|
+
row: {
|
|
31651
|
+
flexDirection: "row",
|
|
31652
|
+
alignItems: "center"
|
|
31653
|
+
},
|
|
31654
|
+
textField: {
|
|
31655
|
+
width: spacing.xxxLarge_64
|
|
31656
|
+
}
|
|
31657
|
+
});
|
|
31658
|
+
|
|
31563
31659
|
const StartCoordsLine = props => {
|
|
31564
31660
|
const {
|
|
31565
31661
|
startCoords,
|
|
31566
31662
|
onChange
|
|
31567
31663
|
} = props;
|
|
31568
31664
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
31569
|
-
style: styles$
|
|
31665
|
+
style: styles$e.tile
|
|
31570
31666
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31571
31667
|
size: spacing.small_12
|
|
31572
31668
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -31574,7 +31670,7 @@ const StartCoordsLine = props => {
|
|
|
31574
31670
|
labels: ["x", "y"],
|
|
31575
31671
|
onChange: value => onChange([value, startCoords[1]])
|
|
31576
31672
|
})), /*#__PURE__*/React.createElement(View, {
|
|
31577
|
-
style: styles$
|
|
31673
|
+
style: styles$e.tile
|
|
31578
31674
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31579
31675
|
size: spacing.small_12
|
|
31580
31676
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -31583,7 +31679,7 @@ const StartCoordsLine = props => {
|
|
|
31583
31679
|
onChange: value => onChange([startCoords[0], value])
|
|
31584
31680
|
})));
|
|
31585
31681
|
};
|
|
31586
|
-
const styles$
|
|
31682
|
+
const styles$e = StyleSheet.create({
|
|
31587
31683
|
tile: {
|
|
31588
31684
|
backgroundColor: color.fadedBlue8,
|
|
31589
31685
|
marginTop: spacing.xSmall_8,
|
|
@@ -31606,7 +31702,7 @@ const StartCoordsMultiline = props => {
|
|
|
31606
31702
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31607
31703
|
expanded: true
|
|
31608
31704
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31609
|
-
style: styles$
|
|
31705
|
+
style: styles$d.nestedTile
|
|
31610
31706
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31611
31707
|
size: spacing.small_12
|
|
31612
31708
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -31618,7 +31714,7 @@ const StartCoordsMultiline = props => {
|
|
|
31618
31714
|
onChange(newCoords);
|
|
31619
31715
|
}
|
|
31620
31716
|
})), /*#__PURE__*/React.createElement(View, {
|
|
31621
|
-
style: styles$
|
|
31717
|
+
style: styles$d.nestedTile
|
|
31622
31718
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31623
31719
|
size: spacing.small_12
|
|
31624
31720
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -31631,7 +31727,7 @@ const StartCoordsMultiline = props => {
|
|
|
31631
31727
|
}
|
|
31632
31728
|
})))));
|
|
31633
31729
|
};
|
|
31634
|
-
const styles$
|
|
31730
|
+
const styles$d = StyleSheet.create({
|
|
31635
31731
|
nestedTile: {
|
|
31636
31732
|
paddingBottom: spacing.small_12,
|
|
31637
31733
|
flexDirection: "row",
|
|
@@ -31639,6 +31735,112 @@ const styles$b = StyleSheet.create({
|
|
|
31639
31735
|
}
|
|
31640
31736
|
});
|
|
31641
31737
|
|
|
31738
|
+
const StartCoordsQuadratic = props => {
|
|
31739
|
+
const {
|
|
31740
|
+
startCoords,
|
|
31741
|
+
onChange
|
|
31742
|
+
} = props;
|
|
31743
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
31744
|
+
style: styles$c.equationSection
|
|
31745
|
+
}, /*#__PURE__*/React.createElement(LabelMedium, null, "Starting equation:"), /*#__PURE__*/React.createElement(BodyMonospace, {
|
|
31746
|
+
style: styles$c.equationBody
|
|
31747
|
+
}, getQuadraticEquation(startCoords))), /*#__PURE__*/React.createElement(View, {
|
|
31748
|
+
style: styles$c.tile
|
|
31749
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31750
|
+
size: spacing.small_12
|
|
31751
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31752
|
+
coord: startCoords[0],
|
|
31753
|
+
labels: ["x", "y"],
|
|
31754
|
+
onChange: value => onChange([value, startCoords[1], startCoords[2]])
|
|
31755
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
31756
|
+
style: styles$c.tile
|
|
31757
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31758
|
+
size: spacing.small_12
|
|
31759
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31760
|
+
coord: startCoords[1],
|
|
31761
|
+
labels: ["x", "y"],
|
|
31762
|
+
onChange: value => onChange([startCoords[0], value, startCoords[2]])
|
|
31763
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
31764
|
+
style: styles$c.tile
|
|
31765
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 3:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31766
|
+
size: spacing.small_12
|
|
31767
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31768
|
+
coord: startCoords[2],
|
|
31769
|
+
labels: ["x", "y"],
|
|
31770
|
+
onChange: value => onChange([startCoords[0], startCoords[1], value])
|
|
31771
|
+
})));
|
|
31772
|
+
};
|
|
31773
|
+
const styles$c = StyleSheet.create({
|
|
31774
|
+
tile: {
|
|
31775
|
+
backgroundColor: color.fadedBlue8,
|
|
31776
|
+
marginTop: spacing.xSmall_8,
|
|
31777
|
+
padding: spacing.small_12,
|
|
31778
|
+
borderRadius: spacing.xSmall_8,
|
|
31779
|
+
flexDirection: "row",
|
|
31780
|
+
alignItems: "center"
|
|
31781
|
+
},
|
|
31782
|
+
equationSection: {
|
|
31783
|
+
marginTop: spacing.small_12
|
|
31784
|
+
},
|
|
31785
|
+
equationBody: {
|
|
31786
|
+
backgroundColor: color.fadedOffBlack8,
|
|
31787
|
+
border: `1px solid ${color.fadedOffBlack32}`,
|
|
31788
|
+
marginTop: spacing.xSmall_8,
|
|
31789
|
+
paddingLeft: spacing.xSmall_8,
|
|
31790
|
+
paddingRight: spacing.xSmall_8,
|
|
31791
|
+
fontSize: font.size.xSmall
|
|
31792
|
+
}
|
|
31793
|
+
});
|
|
31794
|
+
|
|
31795
|
+
const StartCoordsSinusoid = props => {
|
|
31796
|
+
const {
|
|
31797
|
+
startCoords,
|
|
31798
|
+
onChange
|
|
31799
|
+
} = props;
|
|
31800
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
31801
|
+
style: styles$b.equationSection
|
|
31802
|
+
}, /*#__PURE__*/React.createElement(LabelMedium, null, "Starting equation:"), /*#__PURE__*/React.createElement(BodyMonospace, {
|
|
31803
|
+
style: styles$b.equationBody
|
|
31804
|
+
}, getSinusoidEquation(startCoords))), /*#__PURE__*/React.createElement(View, {
|
|
31805
|
+
style: styles$b.tile
|
|
31806
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31807
|
+
size: spacing.small_12
|
|
31808
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31809
|
+
coord: startCoords[0],
|
|
31810
|
+
labels: ["x", "y"],
|
|
31811
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31812
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
31813
|
+
style: styles$b.tile
|
|
31814
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31815
|
+
size: spacing.small_12
|
|
31816
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31817
|
+
coord: startCoords[1],
|
|
31818
|
+
labels: ["x", "y"],
|
|
31819
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31820
|
+
})));
|
|
31821
|
+
};
|
|
31822
|
+
const styles$b = StyleSheet.create({
|
|
31823
|
+
tile: {
|
|
31824
|
+
backgroundColor: color.fadedBlue8,
|
|
31825
|
+
marginTop: spacing.xSmall_8,
|
|
31826
|
+
padding: spacing.small_12,
|
|
31827
|
+
borderRadius: spacing.xSmall_8,
|
|
31828
|
+
flexDirection: "row",
|
|
31829
|
+
alignItems: "center"
|
|
31830
|
+
},
|
|
31831
|
+
equationSection: {
|
|
31832
|
+
marginTop: spacing.small_12
|
|
31833
|
+
},
|
|
31834
|
+
equationBody: {
|
|
31835
|
+
backgroundColor: color.fadedOffBlack8,
|
|
31836
|
+
border: `1px solid ${color.fadedOffBlack32}`,
|
|
31837
|
+
marginTop: spacing.xSmall_8,
|
|
31838
|
+
paddingLeft: spacing.xSmall_8,
|
|
31839
|
+
paddingRight: spacing.xSmall_8,
|
|
31840
|
+
fontSize: font.size.xSmall
|
|
31841
|
+
}
|
|
31842
|
+
});
|
|
31843
|
+
|
|
31642
31844
|
const StartCoordsSettingsInner = props => {
|
|
31643
31845
|
const {
|
|
31644
31846
|
type,
|
|
@@ -31669,6 +31871,28 @@ const StartCoordsSettingsInner = props => {
|
|
|
31669
31871
|
startCoords: multiLineCoords,
|
|
31670
31872
|
onChange: onChange
|
|
31671
31873
|
});
|
|
31874
|
+
case "circle":
|
|
31875
|
+
const circleCoords = getCircleCoords(props);
|
|
31876
|
+
const radius = vector.length(vector.subtract(circleCoords.radiusPoint, circleCoords.center));
|
|
31877
|
+
return /*#__PURE__*/React.createElement(StartCoordsCircle, {
|
|
31878
|
+
startCoords: {
|
|
31879
|
+
center: circleCoords.center,
|
|
31880
|
+
radius
|
|
31881
|
+
},
|
|
31882
|
+
onChange: onChange
|
|
31883
|
+
});
|
|
31884
|
+
case "sinusoid":
|
|
31885
|
+
const sinusoidCoords = getSinusoidCoords(props, range, step);
|
|
31886
|
+
return /*#__PURE__*/React.createElement(StartCoordsSinusoid, {
|
|
31887
|
+
startCoords: sinusoidCoords,
|
|
31888
|
+
onChange: onChange
|
|
31889
|
+
});
|
|
31890
|
+
case "quadratic":
|
|
31891
|
+
const quadraticCoords = getQuadraticCoords(props, range, step);
|
|
31892
|
+
return /*#__PURE__*/React.createElement(StartCoordsQuadratic, {
|
|
31893
|
+
startCoords: quadraticCoords,
|
|
31894
|
+
onChange: onChange
|
|
31895
|
+
});
|
|
31672
31896
|
default:
|
|
31673
31897
|
return null;
|
|
31674
31898
|
}
|
|
@@ -31723,6 +31947,10 @@ const POLYGON_SIDES = _.map(_.range(3, 13), function (value) {
|
|
|
31723
31947
|
label: `${value} sides`
|
|
31724
31948
|
});
|
|
31725
31949
|
});
|
|
31950
|
+
|
|
31951
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
31952
|
+
const startCoordsUiPhase1Types = ["linear", "linear-system", "ray", "segment", "circle"];
|
|
31953
|
+
const startCoordsUiPhase2Types = ["sinusoid", "quadratic"];
|
|
31726
31954
|
/**
|
|
31727
31955
|
* An editor for the InteractiveGraph widget, which allows the user to
|
|
31728
31956
|
* specify the graph's properties and the correct answer.
|
|
@@ -31774,7 +32002,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31774
32002
|
DeprecationMixin.UNSAFE_componentWillMount.call(this);
|
|
31775
32003
|
}
|
|
31776
32004
|
render() {
|
|
31777
|
-
var _this$props$graph$typ, _this$props$graph2, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$graph5, _this$props$
|
|
32005
|
+
var _this$props$apiOption, _this$props$apiOption2, _this$props$graph$typ, _this$props$graph2, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$graph5, _this$props$apiOption3, _this$props$apiOption4;
|
|
31778
32006
|
let graph;
|
|
31779
32007
|
let equationString;
|
|
31780
32008
|
const gridStep = this.props.gridStep || Util.getGridStep(this.props.range, this.props.step, interactiveSizes.defaultBoxSize);
|
|
@@ -31835,6 +32063,9 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31835
32063
|
className: "perseus-error"
|
|
31836
32064
|
}, this.props.valid);
|
|
31837
32065
|
}
|
|
32066
|
+
const startCoordsPhase1 = (_this$props$apiOption = this.props.apiOptions) == null || (_this$props$apiOption = _this$props$apiOption.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui-phase-1"];
|
|
32067
|
+
const startCoordsPhase2 = (_this$props$apiOption2 = this.props.apiOptions) == null || (_this$props$apiOption2 = _this$props$apiOption2.flags) == null || (_this$props$apiOption2 = _this$props$apiOption2.mafs) == null ? void 0 : _this$props$apiOption2["start-coords-ui-phase-2"];
|
|
32068
|
+
const displayStartCoordsUI = this.props.graph && (startCoordsPhase1 && startCoordsUiPhase1Types.includes(this.props.graph.type) || startCoordsPhase2 && startCoordsUiPhase2Types.includes(this.props.graph.type));
|
|
31838
32069
|
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31839
32070
|
label: "Type of Graph:"
|
|
31840
32071
|
}, /*#__PURE__*/React.createElement(GraphTypeSelector, {
|
|
@@ -31975,7 +32206,9 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31975
32206
|
}
|
|
31976
32207
|
});
|
|
31977
32208
|
}
|
|
31978
|
-
})), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) &&
|
|
32209
|
+
})), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) &&
|
|
32210
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32211
|
+
displayStartCoordsUI && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
31979
32212
|
range: this.props.range,
|
|
31980
32213
|
step: this.props.step,
|
|
31981
32214
|
onChange: this.changeStartCoords
|
|
@@ -32031,8 +32264,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32031
32264
|
})), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))),
|
|
32032
32265
|
// Only show the "Add locked figure" dropdown if the graph
|
|
32033
32266
|
// is using Mafs.
|
|
32034
|
-
this.props.graph && ((_this$props$
|
|
32035
|
-
showM2Features: (_this$props$apiOption3 = this.props.apiOptions) == null || (_this$props$apiOption3 = _this$props$apiOption3.flags) == null || (_this$props$apiOption3 = _this$props$apiOption3.mafs) == null ? void 0 : _this$props$apiOption3["interactive-graph-locked-features-m2"],
|
|
32267
|
+
this.props.graph && ((_this$props$apiOption3 = this.props.apiOptions) == null || (_this$props$apiOption3 = _this$props$apiOption3.flags) == null || (_this$props$apiOption3 = _this$props$apiOption3.mafs) == null ? void 0 : _this$props$apiOption3[this.props.graph.type]) && /*#__PURE__*/React.createElement(LockedFiguresSection, {
|
|
32036
32268
|
showM2bFeatures: (_this$props$apiOption4 = this.props.apiOptions) == null || (_this$props$apiOption4 = _this$props$apiOption4.flags) == null || (_this$props$apiOption4 = _this$props$apiOption4.mafs) == null ? void 0 : _this$props$apiOption4["interactive-graph-locked-features-m2b"],
|
|
32037
32269
|
figures: this.props.lockedFigures,
|
|
32038
32270
|
onChange: this.props.onChange
|