@khanacademy/perseus-editor 11.0.2 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/start-coords-circle.d.ts +11 -0
- package/dist/es/index.js +264 -179
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +264 -178
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, 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';
|
|
@@ -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.1.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$J.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$J = 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$I.expanded : styles$I.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$I = 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$H.errorContainer
|
|
20783
20783
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20784
|
-
style: styles$
|
|
20784
|
+
style: styles$H.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$H.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$H.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$H = 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$G.baseButton, color === "green" && styles$G.green, color === "orange" && styles$G.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$G = 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$F.containerHeader)
|
|
24830
24830
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24831
24831
|
depth: path.length,
|
|
24832
|
-
className: css(styles$
|
|
24832
|
+
className: css(styles$F.containerTitle)
|
|
24833
24833
|
}, capitalize(name)));
|
|
24834
24834
|
return /*#__PURE__*/React.createElement("div", {
|
|
24835
|
-
className: css(styles$
|
|
24835
|
+
className: css(styles$F.container)
|
|
24836
24836
|
}, /*#__PURE__*/React.createElement("span", {
|
|
24837
|
-
className: css(styles$
|
|
24837
|
+
className: css(styles$F.row, styles$F.rowHeading)
|
|
24838
24838
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24839
|
-
className: css(styles$
|
|
24839
|
+
className: css(styles$F.columnLeft)
|
|
24840
24840
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24841
|
-
className: "pod-title " + css(styles$
|
|
24841
|
+
className: "pod-title " + css(styles$F.containerHeader)
|
|
24842
24842
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24843
|
-
className: css(styles$
|
|
24843
|
+
className: css(styles$F.containerTitle)
|
|
24844
24844
|
}, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
|
|
24845
|
-
className: css(styles$
|
|
24845
|
+
className: css(styles$F.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$F.container)
|
|
24859
24859
|
}, controls && /*#__PURE__*/React.createElement("div", {
|
|
24860
|
-
className: css(styles$
|
|
24860
|
+
className: css(styles$F.columnLeft, styles$F.containerHeader)
|
|
24861
24861
|
}, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
24862
|
-
className: css(styles$
|
|
24862
|
+
className: css(styles$F.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$F.containerHeader)
|
|
24876
24876
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24877
24877
|
depth: path.length,
|
|
24878
|
-
className: css(styles$
|
|
24878
|
+
className: css(styles$F.containerTitle)
|
|
24879
24879
|
}, capitalize(name)), controls);
|
|
24880
24880
|
const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
|
|
24881
|
-
className: css(styles$
|
|
24881
|
+
className: css(styles$F.containerHeader, styles$F.previewCollectionHeader)
|
|
24882
24882
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24883
24883
|
depth: path.length,
|
|
24884
|
-
className: css(styles$
|
|
24884
|
+
className: css(styles$F.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$F.container)
|
|
24889
24889
|
}, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
|
|
24890
|
-
className: css(styles$
|
|
24890
|
+
className: css(styles$F.row)
|
|
24891
24891
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24892
|
-
className: css(styles$
|
|
24892
|
+
className: css(styles$F.columnLeft)
|
|
24893
24893
|
}, headingEditor), /*#__PURE__*/React.createElement("div", {
|
|
24894
|
-
className: css(styles$
|
|
24894
|
+
className: css(styles$F.columnRight)
|
|
24895
24895
|
}, headingPreview)), /*#__PURE__*/React.createElement("div", {
|
|
24896
|
-
className: css(path.length > 0 && styles$
|
|
24896
|
+
className: css(path.length > 0 && styles$F.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$F.row)
|
|
25020
25020
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25021
|
-
className: css(styles$
|
|
25021
|
+
className: css(styles$F.columnLeft)
|
|
25022
25022
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25023
|
-
className: css(sticky && styles$
|
|
25023
|
+
className: css(sticky && styles$F.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$F.columnRight)
|
|
25032
25032
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25033
|
-
className: css(sticky && styles$
|
|
25033
|
+
className: css(sticky && styles$F.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$F.row)
|
|
25050
25050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25051
|
-
className: css(styles$
|
|
25051
|
+
className: css(styles$F.columnLeft)
|
|
25052
25052
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25053
|
-
className: css(sticky && styles$
|
|
25053
|
+
className: css(sticky && styles$F.sticky)
|
|
25054
25054
|
}, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
|
|
25055
|
-
className: css(styles$
|
|
25055
|
+
className: css(styles$F.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$F.columnRight)
|
|
25071
25071
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25072
|
-
className: css(sticky && styles$
|
|
25072
|
+
className: css(sticky && styles$F.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$F.columnLeft)
|
|
25090
25090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25091
|
-
className: css(styles$
|
|
25091
|
+
className: css(styles$F.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$F.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$F.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$F.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$F.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$F.arrayElement, !elementIsLeaf && styles$F.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$F.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$F = 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$E.title)
|
|
26912
26926
|
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
26913
26927
|
value: this.props.title,
|
|
26914
|
-
className: css(styles$
|
|
26928
|
+
className: css(styles$E.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$E.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$E = 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$D.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$D = 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$C.label)
|
|
29368
29382
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29369
|
-
style: [styles$
|
|
29383
|
+
style: [styles$C.row, style]
|
|
29370
29384
|
}, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29371
|
-
style: styles$
|
|
29385
|
+
style: styles$C.spaceEnd
|
|
29372
29386
|
}, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29373
|
-
style: styles$
|
|
29387
|
+
style: styles$C.spaceStart
|
|
29374
29388
|
}, label)));
|
|
29375
29389
|
};
|
|
29376
|
-
const styles$
|
|
29390
|
+
const styles$C = 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$B.grow, style]
|
|
29454
29468
|
});
|
|
29455
29469
|
}
|
|
29456
29470
|
}
|
|
29457
|
-
const styles$
|
|
29471
|
+
const styles$B = 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$A.container, !isCollapsible && styles$A.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$A.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$A = StyleSheet.create({
|
|
29508
29522
|
container: {
|
|
29509
29523
|
marginTop: spacing.small_12,
|
|
29510
29524
|
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
@@ -29648,6 +29662,15 @@ 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
|
+
};
|
|
29651
29674
|
default:
|
|
29652
29675
|
return undefined;
|
|
29653
29676
|
}
|
|
@@ -29667,17 +29690,17 @@ const LockedFigureSelect = props => {
|
|
|
29667
29690
|
} = props;
|
|
29668
29691
|
const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
|
|
29669
29692
|
return /*#__PURE__*/React.createElement(View, {
|
|
29670
|
-
style: styles$
|
|
29693
|
+
style: styles$z.container
|
|
29671
29694
|
}, /*#__PURE__*/React.createElement(ActionMenu, {
|
|
29672
29695
|
menuText: "Add locked figure",
|
|
29673
|
-
style: styles$
|
|
29696
|
+
style: styles$z.addElementSelect
|
|
29674
29697
|
}, figureTypes.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
|
|
29675
29698
|
key: `${id}-${figureType}`,
|
|
29676
29699
|
label: figureType,
|
|
29677
29700
|
onClick: () => onChange(figureType)
|
|
29678
29701
|
}))));
|
|
29679
29702
|
};
|
|
29680
|
-
const styles$
|
|
29703
|
+
const styles$z = StyleSheet.create({
|
|
29681
29704
|
container: {
|
|
29682
29705
|
marginTop: spacing.xSmall_8
|
|
29683
29706
|
},
|
|
@@ -29708,19 +29731,19 @@ const AngleInput = props => {
|
|
|
29708
29731
|
}
|
|
29709
29732
|
return /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29710
29733
|
tag: "label",
|
|
29711
|
-
style: styles$
|
|
29734
|
+
style: styles$y.row
|
|
29712
29735
|
}, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
|
|
29713
29736
|
size: spacing.xxSmall_6
|
|
29714
29737
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29715
29738
|
type: "number",
|
|
29716
29739
|
value: angleInput,
|
|
29717
29740
|
onChange: handleAngleChange,
|
|
29718
|
-
style: styles$
|
|
29741
|
+
style: styles$y.textField
|
|
29719
29742
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
29720
29743
|
size: spacing.xxSmall_6
|
|
29721
29744
|
}));
|
|
29722
29745
|
};
|
|
29723
|
-
const styles$
|
|
29746
|
+
const styles$y = StyleSheet.create({
|
|
29724
29747
|
row: {
|
|
29725
29748
|
display: "flex",
|
|
29726
29749
|
flexDirection: "row",
|
|
@@ -29769,32 +29792,32 @@ const CoordinatePairInput = props => {
|
|
|
29769
29792
|
onChange(newCoords);
|
|
29770
29793
|
}
|
|
29771
29794
|
return /*#__PURE__*/React.createElement(View, {
|
|
29772
|
-
style: [styles$
|
|
29795
|
+
style: [styles$x.row, style]
|
|
29773
29796
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29774
29797
|
tag: "label",
|
|
29775
|
-
style: styles$
|
|
29798
|
+
style: styles$x.row
|
|
29776
29799
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29777
29800
|
size: spacing.xxSmall_6
|
|
29778
29801
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29779
29802
|
type: "number",
|
|
29780
29803
|
value: coordState[0],
|
|
29781
29804
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29782
|
-
style: [styles$
|
|
29805
|
+
style: [styles$x.textField, error ? styles$x.errorField : undefined]
|
|
29783
29806
|
})), /*#__PURE__*/React.createElement(Strut, {
|
|
29784
29807
|
size: spacing.medium_16
|
|
29785
29808
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29786
29809
|
tag: "label",
|
|
29787
|
-
style: styles$
|
|
29810
|
+
style: styles$x.row
|
|
29788
29811
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29789
29812
|
size: spacing.xxSmall_6
|
|
29790
29813
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29791
29814
|
type: "number",
|
|
29792
29815
|
value: coordState[1],
|
|
29793
29816
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29794
|
-
style: [styles$
|
|
29817
|
+
style: [styles$x.textField, error ? styles$x.errorField : undefined]
|
|
29795
29818
|
})));
|
|
29796
29819
|
};
|
|
29797
|
-
const styles$
|
|
29820
|
+
const styles$x = StyleSheet.create({
|
|
29798
29821
|
row: {
|
|
29799
29822
|
display: "flex",
|
|
29800
29823
|
flexDirection: "row",
|
|
@@ -29827,14 +29850,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29827
29850
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
29828
29851
|
expanded: expanded,
|
|
29829
29852
|
onToggle: onToggle,
|
|
29830
|
-
style: [styles$
|
|
29831
|
-
headerStyle: styles$
|
|
29853
|
+
style: [styles$w.container, containerStyle],
|
|
29854
|
+
headerStyle: styles$w.accordionHeader,
|
|
29832
29855
|
header: header
|
|
29833
29856
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29834
|
-
style: [styles$
|
|
29857
|
+
style: [styles$w.accordionPanel, panelStyle]
|
|
29835
29858
|
}, children)));
|
|
29836
29859
|
};
|
|
29837
|
-
const styles$
|
|
29860
|
+
const styles$w = StyleSheet.create({
|
|
29838
29861
|
container: {
|
|
29839
29862
|
backgroundColor: color.fadedBlue8,
|
|
29840
29863
|
marginTop: spacing.xSmall_8
|
|
@@ -29865,13 +29888,13 @@ const ColorSwatch = props => {
|
|
|
29865
29888
|
"aria-label":
|
|
29866
29889
|
// Don't include an aria label for decorative circles.
|
|
29867
29890
|
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
29868
|
-
style: [styles$
|
|
29891
|
+
style: [styles$v.colorSwatch, {
|
|
29869
29892
|
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
29870
29893
|
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
29871
29894
|
}]
|
|
29872
29895
|
});
|
|
29873
29896
|
};
|
|
29874
|
-
const styles$
|
|
29897
|
+
const styles$v = StyleSheet.create({
|
|
29875
29898
|
colorSwatch: {
|
|
29876
29899
|
// Add a white outline so that the color swatch is visible when
|
|
29877
29900
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29890,10 +29913,10 @@ const ColorSelect = props => {
|
|
|
29890
29913
|
onChange
|
|
29891
29914
|
} = props;
|
|
29892
29915
|
return /*#__PURE__*/React.createElement(View, {
|
|
29893
|
-
style: [styles$
|
|
29916
|
+
style: [styles$u.row, style]
|
|
29894
29917
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29895
29918
|
tag: "label",
|
|
29896
|
-
style: styles$
|
|
29919
|
+
style: styles$u.row
|
|
29897
29920
|
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
29898
29921
|
size: spacing.xxSmall_6
|
|
29899
29922
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -29912,7 +29935,7 @@ const ColorSelect = props => {
|
|
|
29912
29935
|
})
|
|
29913
29936
|
})))));
|
|
29914
29937
|
};
|
|
29915
|
-
const styles$
|
|
29938
|
+
const styles$u = StyleSheet.create({
|
|
29916
29939
|
row: {
|
|
29917
29940
|
display: "flex",
|
|
29918
29941
|
flexDirection: "row",
|
|
@@ -29928,17 +29951,17 @@ const EllipseSwatch = props => {
|
|
|
29928
29951
|
} = props;
|
|
29929
29952
|
return /*#__PURE__*/React.createElement(View, {
|
|
29930
29953
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
29931
|
-
style: [styles$
|
|
29954
|
+
style: [styles$t.container, {
|
|
29932
29955
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
29933
29956
|
}]
|
|
29934
29957
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29935
|
-
style: [styles$
|
|
29958
|
+
style: [styles$t.innerCircle, {
|
|
29936
29959
|
backgroundColor: lockedFigureColors[color],
|
|
29937
29960
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
29938
29961
|
}]
|
|
29939
29962
|
}));
|
|
29940
29963
|
};
|
|
29941
|
-
const styles$
|
|
29964
|
+
const styles$t = StyleSheet.create({
|
|
29942
29965
|
container: {
|
|
29943
29966
|
// Add a white outline so that the color swatch is visible when
|
|
29944
29967
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29969,40 +29992,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
29969
29992
|
onRemove
|
|
29970
29993
|
} = props;
|
|
29971
29994
|
return /*#__PURE__*/React.createElement(View, {
|
|
29972
|
-
style: styles$
|
|
29995
|
+
style: styles$s.container
|
|
29973
29996
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
29974
29997
|
startIcon: trashIcon,
|
|
29975
29998
|
"aria-label": `Delete locked ${figureType}`,
|
|
29976
29999
|
onClick: onRemove,
|
|
29977
30000
|
kind: "tertiary",
|
|
29978
|
-
style: styles$
|
|
30001
|
+
style: styles$s.deleteButton
|
|
29979
30002
|
}, "Delete"), /*#__PURE__*/React.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
29980
30003
|
icon: caretDoubleUpIcon,
|
|
29981
30004
|
size: "small",
|
|
29982
30005
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
29983
30006
|
onClick: () => onMove("back"),
|
|
29984
|
-
style: styles$
|
|
30007
|
+
style: styles$s.iconButton
|
|
29985
30008
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29986
30009
|
icon: caretUpIcon,
|
|
29987
30010
|
size: "small",
|
|
29988
30011
|
"aria-label": `Move locked ${figureType} backward`,
|
|
29989
30012
|
onClick: () => onMove("backward"),
|
|
29990
|
-
style: styles$
|
|
30013
|
+
style: styles$s.iconButton
|
|
29991
30014
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29992
30015
|
icon: caretDownIcon,
|
|
29993
30016
|
size: "small",
|
|
29994
30017
|
"aria-label": `Move locked ${figureType} forward`,
|
|
29995
30018
|
onClick: () => onMove("forward"),
|
|
29996
|
-
style: styles$
|
|
30019
|
+
style: styles$s.iconButton
|
|
29997
30020
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
29998
30021
|
icon: caretDoubleDownIcon,
|
|
29999
30022
|
size: "small",
|
|
30000
30023
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30001
30024
|
onClick: () => onMove("front"),
|
|
30002
|
-
style: styles$
|
|
30025
|
+
style: styles$s.iconButton
|
|
30003
30026
|
})));
|
|
30004
30027
|
};
|
|
30005
|
-
const styles$
|
|
30028
|
+
const styles$s = StyleSheet.create({
|
|
30006
30029
|
container: {
|
|
30007
30030
|
width: "100%",
|
|
30008
30031
|
flexDirection: "row",
|
|
@@ -30049,7 +30072,7 @@ const LockedEllipseSettings = props => {
|
|
|
30049
30072
|
/*#__PURE__*/
|
|
30050
30073
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30051
30074
|
React.createElement(View, {
|
|
30052
|
-
style: styles$
|
|
30075
|
+
style: styles$r.row
|
|
30053
30076
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
|
|
30054
30077
|
size: spacing.xSmall_8
|
|
30055
30078
|
}), /*#__PURE__*/React.createElement(EllipseSwatch, {
|
|
@@ -30058,19 +30081,19 @@ const LockedEllipseSettings = props => {
|
|
|
30058
30081
|
strokeStyle: strokeStyle
|
|
30059
30082
|
}))
|
|
30060
30083
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30061
|
-
style: styles$
|
|
30084
|
+
style: styles$r.row
|
|
30062
30085
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30063
30086
|
coord: center,
|
|
30064
|
-
style: styles$
|
|
30087
|
+
style: styles$r.spaceUnder,
|
|
30065
30088
|
onChange: newCoords => onChangeProps({
|
|
30066
30089
|
center: newCoords
|
|
30067
30090
|
})
|
|
30068
30091
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30069
|
-
style: styles$
|
|
30092
|
+
style: styles$r.spaceUnder
|
|
30070
30093
|
}, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30071
30094
|
coord: radius,
|
|
30072
30095
|
labels: ["x radius", "y radius"],
|
|
30073
|
-
style: styles$
|
|
30096
|
+
style: styles$r.spaceUnder,
|
|
30074
30097
|
onChange: newCoords => onChangeProps({
|
|
30075
30098
|
radius: newCoords
|
|
30076
30099
|
})
|
|
@@ -30082,7 +30105,7 @@ const LockedEllipseSettings = props => {
|
|
|
30082
30105
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30083
30106
|
size: spacing.xSmall_8
|
|
30084
30107
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30085
|
-
style: [styles$
|
|
30108
|
+
style: [styles$r.row, styles$r.spaceUnder]
|
|
30086
30109
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30087
30110
|
selectedValue: color,
|
|
30088
30111
|
onChange: handleColorChange
|
|
@@ -30090,7 +30113,7 @@ const LockedEllipseSettings = props => {
|
|
|
30090
30113
|
size: spacing.medium_16
|
|
30091
30114
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30092
30115
|
tag: "label",
|
|
30093
|
-
style: styles$
|
|
30116
|
+
style: styles$r.row
|
|
30094
30117
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30095
30118
|
size: spacing.xxSmall_6
|
|
30096
30119
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30107,7 +30130,7 @@ const LockedEllipseSettings = props => {
|
|
|
30107
30130
|
label: option
|
|
30108
30131
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30109
30132
|
tag: "label",
|
|
30110
|
-
style: styles$
|
|
30133
|
+
style: styles$r.row
|
|
30111
30134
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30112
30135
|
size: spacing.xxSmall_6
|
|
30113
30136
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30131,7 +30154,7 @@ const LockedEllipseSettings = props => {
|
|
|
30131
30154
|
onRemove: onRemove
|
|
30132
30155
|
}));
|
|
30133
30156
|
};
|
|
30134
|
-
const styles$
|
|
30157
|
+
const styles$r = StyleSheet.create({
|
|
30135
30158
|
row: {
|
|
30136
30159
|
display: "flex",
|
|
30137
30160
|
flexDirection: "row",
|
|
@@ -30152,7 +30175,7 @@ const LabeledSwitch = props => {
|
|
|
30152
30175
|
const ids = useUniqueIdWithMock();
|
|
30153
30176
|
const switchId = ids.get("switch");
|
|
30154
30177
|
return /*#__PURE__*/React.createElement(View, {
|
|
30155
|
-
style: [styles$
|
|
30178
|
+
style: [styles$q.row, style]
|
|
30156
30179
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30157
30180
|
id: switchId,
|
|
30158
30181
|
checked: checked,
|
|
@@ -30164,7 +30187,7 @@ const LabeledSwitch = props => {
|
|
|
30164
30187
|
htmlFor: switchId
|
|
30165
30188
|
}, label));
|
|
30166
30189
|
};
|
|
30167
|
-
const styles$
|
|
30190
|
+
const styles$q = StyleSheet.create({
|
|
30168
30191
|
row: {
|
|
30169
30192
|
flexDirection: "row",
|
|
30170
30193
|
alignItems: "center"
|
|
@@ -30198,13 +30221,13 @@ const DefiningPointSettings = props => {
|
|
|
30198
30221
|
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30199
30222
|
expanded: expanded,
|
|
30200
30223
|
onToggle: onToggle,
|
|
30201
|
-
containerStyle: styles$
|
|
30202
|
-
panelStyle: styles$
|
|
30224
|
+
containerStyle: styles$p.container,
|
|
30225
|
+
panelStyle: styles$p.accordionPanel,
|
|
30203
30226
|
header:
|
|
30204
30227
|
/*#__PURE__*/
|
|
30205
30228
|
// Summary: Point, coords, color (filled/open)
|
|
30206
30229
|
React.createElement(View, {
|
|
30207
|
-
style: styles$
|
|
30230
|
+
style: styles$p.row
|
|
30208
30231
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30209
30232
|
size: spacing.xSmall_8
|
|
30210
30233
|
}), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30214,7 +30237,7 @@ const DefiningPointSettings = props => {
|
|
|
30214
30237
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30215
30238
|
coord: coord,
|
|
30216
30239
|
error: !!error,
|
|
30217
|
-
style: styles$
|
|
30240
|
+
style: styles$p.spaceUnder,
|
|
30218
30241
|
onChange: newCoords => {
|
|
30219
30242
|
onChangeProps({
|
|
30220
30243
|
coord: newCoords
|
|
@@ -30223,12 +30246,12 @@ const DefiningPointSettings = props => {
|
|
|
30223
30246
|
}), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30224
30247
|
label: "show point on graph",
|
|
30225
30248
|
checked: !!showPoint,
|
|
30226
|
-
style: showPoint && styles$
|
|
30249
|
+
style: showPoint && styles$p.spaceUnder,
|
|
30227
30250
|
onChange: onTogglePoint
|
|
30228
30251
|
}), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30229
30252
|
selectedValue: pointColor,
|
|
30230
30253
|
onChange: handleColorChange,
|
|
30231
|
-
style: styles$
|
|
30254
|
+
style: styles$p.spaceUnder
|
|
30232
30255
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30233
30256
|
label: "open point",
|
|
30234
30257
|
checked: !filled,
|
|
@@ -30239,7 +30262,7 @@ const DefiningPointSettings = props => {
|
|
|
30239
30262
|
}
|
|
30240
30263
|
})));
|
|
30241
30264
|
};
|
|
30242
|
-
const styles$
|
|
30265
|
+
const styles$p = StyleSheet.create({
|
|
30243
30266
|
container: {
|
|
30244
30267
|
marginTop: spacing.xSmall_8,
|
|
30245
30268
|
marginBottom: 0,
|
|
@@ -30266,15 +30289,15 @@ const LineSwatch = props => {
|
|
|
30266
30289
|
lineStyle
|
|
30267
30290
|
} = props;
|
|
30268
30291
|
return /*#__PURE__*/React.createElement(View, {
|
|
30269
|
-
style: styles$
|
|
30292
|
+
style: styles$o.container
|
|
30270
30293
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30271
30294
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30272
|
-
style: [styles$
|
|
30295
|
+
style: [styles$o.lineSwatch, {
|
|
30273
30296
|
border: `5px ${lineStyle} ${lockedFigureColors[color]}`
|
|
30274
30297
|
}]
|
|
30275
30298
|
}));
|
|
30276
30299
|
};
|
|
30277
|
-
const styles$
|
|
30300
|
+
const styles$o = StyleSheet.create({
|
|
30278
30301
|
container: {
|
|
30279
30302
|
backgroundColor: color.white,
|
|
30280
30303
|
justifyContent: "center",
|
|
@@ -30328,7 +30351,7 @@ const LockedLineSettings = props => {
|
|
|
30328
30351
|
expanded: props.expanded,
|
|
30329
30352
|
onToggle: props.onToggle,
|
|
30330
30353
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30331
|
-
style: styles$
|
|
30354
|
+
style: styles$n.row
|
|
30332
30355
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30333
30356
|
size: spacing.xSmall_8
|
|
30334
30357
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30337,7 +30360,7 @@ const LockedLineSettings = props => {
|
|
|
30337
30360
|
}))
|
|
30338
30361
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30339
30362
|
tag: "label",
|
|
30340
|
-
style: [styles$
|
|
30363
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
30341
30364
|
}, "kind", /*#__PURE__*/React.createElement(Strut, {
|
|
30342
30365
|
size: spacing.xxxSmall_4
|
|
30343
30366
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30358,7 +30381,7 @@ const LockedLineSettings = props => {
|
|
|
30358
30381
|
value: "segment",
|
|
30359
30382
|
label: "segment"
|
|
30360
30383
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
30361
|
-
style: styles$
|
|
30384
|
+
style: styles$n.row
|
|
30362
30385
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30363
30386
|
selectedValue: lineColor,
|
|
30364
30387
|
onChange: handleColorChange
|
|
@@ -30366,7 +30389,7 @@ const LockedLineSettings = props => {
|
|
|
30366
30389
|
size: spacing.small_12
|
|
30367
30390
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30368
30391
|
tag: "label",
|
|
30369
|
-
style: styles$
|
|
30392
|
+
style: styles$n.row
|
|
30370
30393
|
}, "style", /*#__PURE__*/React.createElement(Strut, {
|
|
30371
30394
|
size: spacing.xxxSmall_4
|
|
30372
30395
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30377,7 +30400,7 @@ const LockedLineSettings = props => {
|
|
|
30377
30400
|
// Placeholder is required, but never gets used.
|
|
30378
30401
|
,
|
|
30379
30402
|
placeholder: "",
|
|
30380
|
-
style: styles$
|
|
30403
|
+
style: styles$n.selectMarginOffset
|
|
30381
30404
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
30382
30405
|
value: "solid",
|
|
30383
30406
|
label: "solid"
|
|
@@ -30385,7 +30408,7 @@ const LockedLineSettings = props => {
|
|
|
30385
30408
|
value: "dashed",
|
|
30386
30409
|
label: "dashed"
|
|
30387
30410
|
})))), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30388
|
-
style: styles$
|
|
30411
|
+
style: styles$n.errorText
|
|
30389
30412
|
}, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
|
|
30390
30413
|
label: "Point 1",
|
|
30391
30414
|
showPoint: showPoint1,
|
|
@@ -30411,7 +30434,7 @@ const LockedLineSettings = props => {
|
|
|
30411
30434
|
onRemove: onRemove
|
|
30412
30435
|
}));
|
|
30413
30436
|
};
|
|
30414
|
-
const styles$
|
|
30437
|
+
const styles$n = StyleSheet.create({
|
|
30415
30438
|
row: {
|
|
30416
30439
|
display: "flex",
|
|
30417
30440
|
flexDirection: "row",
|
|
@@ -30456,7 +30479,7 @@ const LockedPointSettings = props => {
|
|
|
30456
30479
|
/*#__PURE__*/
|
|
30457
30480
|
// Summary: Point, coords, color (filled/open)
|
|
30458
30481
|
React.createElement(View, {
|
|
30459
|
-
style: styles$
|
|
30482
|
+
style: styles$m.row
|
|
30460
30483
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30461
30484
|
size: spacing.xSmall_8
|
|
30462
30485
|
}), /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30465,7 +30488,7 @@ const LockedPointSettings = props => {
|
|
|
30465
30488
|
}))
|
|
30466
30489
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30467
30490
|
coord: coord,
|
|
30468
|
-
style: styles$
|
|
30491
|
+
style: styles$m.spaceUnder,
|
|
30469
30492
|
onChange: newCoord => {
|
|
30470
30493
|
onChangeProps({
|
|
30471
30494
|
coord: newCoord
|
|
@@ -30474,7 +30497,7 @@ const LockedPointSettings = props => {
|
|
|
30474
30497
|
}), /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30475
30498
|
selectedValue: pointColor,
|
|
30476
30499
|
onChange: handleColorChange,
|
|
30477
|
-
style: styles$
|
|
30500
|
+
style: styles$m.spaceUnder
|
|
30478
30501
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30479
30502
|
label: "open point",
|
|
30480
30503
|
checked: !filled,
|
|
@@ -30490,7 +30513,7 @@ const LockedPointSettings = props => {
|
|
|
30490
30513
|
onRemove: onRemove
|
|
30491
30514
|
}));
|
|
30492
30515
|
};
|
|
30493
|
-
const styles$
|
|
30516
|
+
const styles$m = StyleSheet.create({
|
|
30494
30517
|
row: {
|
|
30495
30518
|
flexDirection: "row",
|
|
30496
30519
|
alignItems: "center"
|
|
@@ -30508,17 +30531,17 @@ const PolygonSwatch = props => {
|
|
|
30508
30531
|
} = props;
|
|
30509
30532
|
return /*#__PURE__*/React.createElement(View, {
|
|
30510
30533
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30511
|
-
style: [styles$
|
|
30534
|
+
style: [styles$l.container, {
|
|
30512
30535
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30513
30536
|
}]
|
|
30514
30537
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30515
|
-
style: [styles$
|
|
30538
|
+
style: [styles$l.innerSquare, {
|
|
30516
30539
|
backgroundColor: lockedFigureColors[color],
|
|
30517
30540
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
30518
30541
|
}]
|
|
30519
30542
|
}));
|
|
30520
30543
|
};
|
|
30521
|
-
const styles$
|
|
30544
|
+
const styles$l = StyleSheet.create({
|
|
30522
30545
|
container: {
|
|
30523
30546
|
// Add a white outline so that the color swatch is visible when
|
|
30524
30547
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30560,7 +30583,7 @@ const LockedPolygonSettings = props => {
|
|
|
30560
30583
|
/*#__PURE__*/
|
|
30561
30584
|
// Summary: Polygon, number of sides, style swatch
|
|
30562
30585
|
React.createElement(View, {
|
|
30563
|
-
style: styles$
|
|
30586
|
+
style: styles$k.row
|
|
30564
30587
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
|
|
30565
30588
|
size: spacing.xSmall_8
|
|
30566
30589
|
}), /*#__PURE__*/React.createElement(PolygonSwatch, {
|
|
@@ -30569,7 +30592,7 @@ const LockedPolygonSettings = props => {
|
|
|
30569
30592
|
strokeStyle: strokeStyle
|
|
30570
30593
|
}))
|
|
30571
30594
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30572
|
-
style: [styles$
|
|
30595
|
+
style: [styles$k.row, styles$k.spaceUnder]
|
|
30573
30596
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30574
30597
|
selectedValue: color,
|
|
30575
30598
|
onChange: handleColorChange
|
|
@@ -30577,7 +30600,7 @@ const LockedPolygonSettings = props => {
|
|
|
30577
30600
|
size: spacing.medium_16
|
|
30578
30601
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30579
30602
|
tag: "label",
|
|
30580
|
-
style: styles$
|
|
30603
|
+
style: styles$k.row
|
|
30581
30604
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30582
30605
|
size: spacing.xxSmall_6
|
|
30583
30606
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30594,7 +30617,7 @@ const LockedPolygonSettings = props => {
|
|
|
30594
30617
|
label: option
|
|
30595
30618
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30596
30619
|
tag: "label",
|
|
30597
|
-
style: [styles$
|
|
30620
|
+
style: [styles$k.row, styles$k.spaceUnder]
|
|
30598
30621
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30599
30622
|
size: spacing.xxSmall_6
|
|
30600
30623
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30617,17 +30640,17 @@ const LockedPolygonSettings = props => {
|
|
|
30617
30640
|
onChange: newValue => onChangeProps({
|
|
30618
30641
|
showVertices: newValue
|
|
30619
30642
|
}),
|
|
30620
|
-
style: styles$
|
|
30643
|
+
style: styles$k.spaceUnder
|
|
30621
30644
|
}), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30622
30645
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
|
|
30623
30646
|
expanded: true,
|
|
30624
|
-
containerStyle: styles$
|
|
30625
|
-
panelStyle: styles$
|
|
30647
|
+
containerStyle: styles$k.pointAccordionContainer,
|
|
30648
|
+
panelStyle: styles$k.pointAccordionPanel
|
|
30626
30649
|
}, points.map((point, index) => {
|
|
30627
30650
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30628
30651
|
return /*#__PURE__*/React.createElement(View, {
|
|
30629
30652
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30630
|
-
style: [styles$
|
|
30653
|
+
style: [styles$k.row, styles$k.spaceUnder]
|
|
30631
30654
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
|
|
30632
30655
|
size: spacing.medium_16
|
|
30633
30656
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -30655,7 +30678,7 @@ const LockedPolygonSettings = props => {
|
|
|
30655
30678
|
points: newPoints
|
|
30656
30679
|
});
|
|
30657
30680
|
},
|
|
30658
|
-
style: styles$
|
|
30681
|
+
style: styles$k.icon
|
|
30659
30682
|
}));
|
|
30660
30683
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
30661
30684
|
kind: "tertiary",
|
|
@@ -30672,7 +30695,7 @@ const LockedPolygonSettings = props => {
|
|
|
30672
30695
|
onRemove: onRemove
|
|
30673
30696
|
}));
|
|
30674
30697
|
};
|
|
30675
|
-
const styles$
|
|
30698
|
+
const styles$k = StyleSheet.create({
|
|
30676
30699
|
row: {
|
|
30677
30700
|
display: "flex",
|
|
30678
30701
|
flexDirection: "row",
|
|
@@ -30730,7 +30753,7 @@ const LockedVectorSettings = props => {
|
|
|
30730
30753
|
expanded: props.expanded,
|
|
30731
30754
|
onToggle: props.onToggle,
|
|
30732
30755
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30733
|
-
style: styles$
|
|
30756
|
+
style: styles$j.row
|
|
30734
30757
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30735
30758
|
size: spacing.xSmall_8
|
|
30736
30759
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30738,19 +30761,19 @@ const LockedVectorSettings = props => {
|
|
|
30738
30761
|
lineStyle: "solid"
|
|
30739
30762
|
}))
|
|
30740
30763
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30741
|
-
style: [styles$
|
|
30764
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30742
30765
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30743
30766
|
selectedValue: lineColor,
|
|
30744
30767
|
onChange: handleColorChange
|
|
30745
30768
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30746
|
-
style: styles$
|
|
30769
|
+
style: styles$j.errorText
|
|
30747
30770
|
}, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30748
30771
|
expanded: true // Initial state is expanded
|
|
30749
30772
|
,
|
|
30750
|
-
containerStyle: styles$
|
|
30751
|
-
panelStyle: styles$
|
|
30773
|
+
containerStyle: styles$j.container,
|
|
30774
|
+
panelStyle: styles$j.accordionPanel,
|
|
30752
30775
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30753
|
-
style: styles$
|
|
30776
|
+
style: styles$j.row
|
|
30754
30777
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30755
30778
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30756
30779
|
coord: tail,
|
|
@@ -30761,10 +30784,10 @@ const LockedVectorSettings = props => {
|
|
|
30761
30784
|
})), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30762
30785
|
expanded: true // Initial state is expanded
|
|
30763
30786
|
,
|
|
30764
|
-
containerStyle: styles$
|
|
30765
|
-
panelStyle: styles$
|
|
30787
|
+
containerStyle: styles$j.container,
|
|
30788
|
+
panelStyle: styles$j.accordionPanel,
|
|
30766
30789
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30767
|
-
style: styles$
|
|
30790
|
+
style: styles$j.row
|
|
30768
30791
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30769
30792
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30770
30793
|
coord: tip,
|
|
@@ -30779,7 +30802,7 @@ const LockedVectorSettings = props => {
|
|
|
30779
30802
|
onRemove: onRemove
|
|
30780
30803
|
}));
|
|
30781
30804
|
};
|
|
30782
|
-
const styles$
|
|
30805
|
+
const styles$j = StyleSheet.create({
|
|
30783
30806
|
accordionPanel: {
|
|
30784
30807
|
paddingBottom: spacing.medium_16
|
|
30785
30808
|
},
|
|
@@ -30954,7 +30977,7 @@ const LockedFiguresSection = props => {
|
|
|
30954
30977
|
onRemove: () => removeLockedFigure(index)
|
|
30955
30978
|
}));
|
|
30956
30979
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30957
|
-
style: styles$
|
|
30980
|
+
style: styles$i.buttonContainer
|
|
30958
30981
|
}, /*#__PURE__*/React.createElement(LockedFigureSelect, {
|
|
30959
30982
|
showM2Features: props.showM2Features,
|
|
30960
30983
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -30965,10 +30988,10 @@ const LockedFiguresSection = props => {
|
|
|
30965
30988
|
}), showExpandButton && /*#__PURE__*/React.createElement(Button, {
|
|
30966
30989
|
kind: "secondary",
|
|
30967
30990
|
onClick: () => toggleExpanded(allCollapsed),
|
|
30968
|
-
style: styles$
|
|
30991
|
+
style: styles$i.button
|
|
30969
30992
|
}, buttonLabel))));
|
|
30970
30993
|
};
|
|
30971
|
-
const styles$
|
|
30994
|
+
const styles$i = StyleSheet.create({
|
|
30972
30995
|
buttonContainer: {
|
|
30973
30996
|
flexDirection: "row",
|
|
30974
30997
|
alignItems: "center"
|
|
@@ -31003,7 +31026,7 @@ const GraphPointsCountSelector = ({
|
|
|
31003
31026
|
// Never uses placeholder, always has value
|
|
31004
31027
|
,
|
|
31005
31028
|
placeholder: "",
|
|
31006
|
-
style: styles$
|
|
31029
|
+
style: styles$h.singleSelectShort
|
|
31007
31030
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31008
31031
|
key: n,
|
|
31009
31032
|
value: `${n}`,
|
|
@@ -31014,7 +31037,7 @@ const GraphPointsCountSelector = ({
|
|
|
31014
31037
|
label: "unlimited"
|
|
31015
31038
|
})]);
|
|
31016
31039
|
};
|
|
31017
|
-
const styles$
|
|
31040
|
+
const styles$h = StyleSheet.create({
|
|
31018
31041
|
singleSelectShort: {
|
|
31019
31042
|
// Non-standard spacing, but it's the smallest we can go
|
|
31020
31043
|
// without running into styling issues with the dropdown.
|
|
@@ -31027,7 +31050,7 @@ const GraphTypeSelector = props => {
|
|
|
31027
31050
|
selectedValue: props.graphType,
|
|
31028
31051
|
onChange: props.onChange,
|
|
31029
31052
|
placeholder: "Select a graph type",
|
|
31030
|
-
style: styles$
|
|
31053
|
+
style: styles$g.singleSelectShort
|
|
31031
31054
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
31032
31055
|
value: "linear",
|
|
31033
31056
|
label: "Linear function"
|
|
@@ -31060,7 +31083,7 @@ const GraphTypeSelector = props => {
|
|
|
31060
31083
|
label: "Angle"
|
|
31061
31084
|
}));
|
|
31062
31085
|
};
|
|
31063
|
-
const styles$
|
|
31086
|
+
const styles$g = StyleSheet.create({
|
|
31064
31087
|
singleSelectShort: {
|
|
31065
31088
|
// Non-standard spacing, but it's the smallest we can go
|
|
31066
31089
|
// without running into styling issues with the dropdown.
|
|
@@ -31464,10 +31487,10 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31464
31487
|
onChange: this.change
|
|
31465
31488
|
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31466
31489
|
label: "Background image URL:",
|
|
31467
|
-
style: styles$
|
|
31490
|
+
style: styles$f.resetSpaceTop
|
|
31468
31491
|
}, /*#__PURE__*/React.createElement("input", {
|
|
31469
31492
|
type: "text",
|
|
31470
|
-
className: css(styles$
|
|
31493
|
+
className: css(styles$f.backgroundUrlInput),
|
|
31471
31494
|
ref: this.bgUrlRef,
|
|
31472
31495
|
value: this.state.backgroundImage.url || "",
|
|
31473
31496
|
onChange: e => {
|
|
@@ -31481,14 +31504,14 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31481
31504
|
onKeyPress: this.changeBackgroundUrl,
|
|
31482
31505
|
onBlur: this.changeBackgroundUrl
|
|
31483
31506
|
}), /*#__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$
|
|
31507
|
+
style: styles$f.protractorSection
|
|
31485
31508
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31486
|
-
style: styles$
|
|
31509
|
+
style: styles$f.checkboxRow
|
|
31487
31510
|
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
31488
31511
|
label: "Show protractor",
|
|
31489
31512
|
showProtractor: this.props.showProtractor,
|
|
31490
31513
|
onChange: this.change,
|
|
31491
|
-
style: styles$
|
|
31514
|
+
style: styles$f.resetSpaceTop
|
|
31492
31515
|
})), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
|
|
31493
31516
|
layout: "floating",
|
|
31494
31517
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31509,7 +31532,7 @@ InteractiveGraphSettings.defaultProps = {
|
|
|
31509
31532
|
showProtractor: false,
|
|
31510
31533
|
showTooltips: false
|
|
31511
31534
|
};
|
|
31512
|
-
const styles$
|
|
31535
|
+
const styles$f = StyleSheet.create({
|
|
31513
31536
|
resetSpaceTop: {
|
|
31514
31537
|
marginTop: 0
|
|
31515
31538
|
},
|
|
@@ -31546,13 +31569,13 @@ const SegmentCountSelector = ({
|
|
|
31546
31569
|
const num = +newValue;
|
|
31547
31570
|
onChange(num);
|
|
31548
31571
|
},
|
|
31549
|
-
style: styles$
|
|
31572
|
+
style: styles$e.singleSelectShort
|
|
31550
31573
|
}, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31551
31574
|
key: n,
|
|
31552
31575
|
value: `${n}`,
|
|
31553
31576
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31554
31577
|
})));
|
|
31555
|
-
const styles$
|
|
31578
|
+
const styles$e = StyleSheet.create({
|
|
31556
31579
|
singleSelectShort: {
|
|
31557
31580
|
// Non-standard spacing, but it's the smallest we can go
|
|
31558
31581
|
// without running into styling issues with the dropdown.
|
|
@@ -31560,6 +31583,58 @@ const styles$d = StyleSheet.create({
|
|
|
31560
31583
|
}
|
|
31561
31584
|
});
|
|
31562
31585
|
|
|
31586
|
+
const StartCoordsCircle = props => {
|
|
31587
|
+
const {
|
|
31588
|
+
startCoords,
|
|
31589
|
+
onChange
|
|
31590
|
+
} = props;
|
|
31591
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
31592
|
+
style: styles$d.tile
|
|
31593
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
31594
|
+
style: styles$d.row
|
|
31595
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Center:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31596
|
+
size: spacing.small_12
|
|
31597
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31598
|
+
coord: startCoords.center,
|
|
31599
|
+
labels: ["x", "y"],
|
|
31600
|
+
onChange: coord => onChange({
|
|
31601
|
+
center: coord,
|
|
31602
|
+
radius: startCoords.radius
|
|
31603
|
+
})
|
|
31604
|
+
})), /*#__PURE__*/React.createElement(Strut, {
|
|
31605
|
+
size: spacing.small_12
|
|
31606
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
31607
|
+
style: styles$d.row
|
|
31608
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Radius:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31609
|
+
size: spacing.small_12
|
|
31610
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
|
31611
|
+
value: startCoords.radius.toString(),
|
|
31612
|
+
type: "number",
|
|
31613
|
+
onChange: value => {
|
|
31614
|
+
onChange({
|
|
31615
|
+
center: startCoords.center,
|
|
31616
|
+
radius: parseFloat(value)
|
|
31617
|
+
});
|
|
31618
|
+
},
|
|
31619
|
+
style: styles$d.textField
|
|
31620
|
+
})));
|
|
31621
|
+
};
|
|
31622
|
+
const styles$d = StyleSheet.create({
|
|
31623
|
+
tile: {
|
|
31624
|
+
backgroundColor: color.fadedBlue8,
|
|
31625
|
+
marginTop: spacing.xSmall_8,
|
|
31626
|
+
padding: spacing.small_12,
|
|
31627
|
+
borderRadius: spacing.xSmall_8
|
|
31628
|
+
},
|
|
31629
|
+
row: {
|
|
31630
|
+
flexDirection: "row",
|
|
31631
|
+
alignItems: "center"
|
|
31632
|
+
},
|
|
31633
|
+
textField: {
|
|
31634
|
+
width: spacing.xxxLarge_64
|
|
31635
|
+
}
|
|
31636
|
+
});
|
|
31637
|
+
|
|
31563
31638
|
const StartCoordsLine = props => {
|
|
31564
31639
|
const {
|
|
31565
31640
|
startCoords,
|
|
@@ -31669,6 +31744,16 @@ const StartCoordsSettingsInner = props => {
|
|
|
31669
31744
|
startCoords: multiLineCoords,
|
|
31670
31745
|
onChange: onChange
|
|
31671
31746
|
});
|
|
31747
|
+
case "circle":
|
|
31748
|
+
const circleCoords = getCircleCoords(props);
|
|
31749
|
+
const radius = vector.length(vector.subtract(circleCoords.radiusPoint, circleCoords.center));
|
|
31750
|
+
return /*#__PURE__*/React.createElement(StartCoordsCircle, {
|
|
31751
|
+
startCoords: {
|
|
31752
|
+
center: circleCoords.center,
|
|
31753
|
+
radius
|
|
31754
|
+
},
|
|
31755
|
+
onChange: onChange
|
|
31756
|
+
});
|
|
31672
31757
|
default:
|
|
31673
31758
|
return null;
|
|
31674
31759
|
}
|
|
@@ -31975,7 +32060,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31975
32060
|
}
|
|
31976
32061
|
});
|
|
31977
32062
|
}
|
|
31978
|
-
})), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) && ((_this$props$apiOption = this.props.apiOptions.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui"]) && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32063
|
+
})), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) && ((_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"]) && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
31979
32064
|
range: this.props.range,
|
|
31980
32065
|
step: this.props.step,
|
|
31981
32066
|
onChange: this.changeStartCoords
|