@khanacademy/perseus-editor 11.4.1 → 11.5.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/util.d.ts +1 -0
- package/dist/es/index.js +259 -202
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +259 -202
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -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.
|
|
40
|
+
const libVersion = "11.5.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$S.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$S = 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$R.expanded : styles$R.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$R = 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$Q.errorContainer
|
|
20783
20783
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20784
|
-
style: styles$
|
|
20784
|
+
style: styles$Q.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$Q.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$Q.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$Q = StyleSheet.create({
|
|
20801
20801
|
title: {
|
|
20802
20802
|
backgroundColor: "#eee",
|
|
20803
20803
|
fontSize: "1.25em",
|
|
@@ -23910,7 +23910,7 @@ ItemExtrasEditor.defaultProps = {
|
|
|
23910
23910
|
zTable: false
|
|
23911
23911
|
};
|
|
23912
23912
|
const ItemExtraCheckbox = props => /*#__PURE__*/React.createElement(View, {
|
|
23913
|
-
style: [styles$
|
|
23913
|
+
style: [styles$P.checkbox, props.indent ? styles$P.indented : undefined]
|
|
23914
23914
|
}, /*#__PURE__*/React.createElement(Checkbox$1, {
|
|
23915
23915
|
label: /*#__PURE__*/React.createElement(View, {
|
|
23916
23916
|
style: {
|
|
@@ -23920,7 +23920,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React.createElement(View, {
|
|
|
23920
23920
|
checked: props.checked,
|
|
23921
23921
|
onChange: newCheckedState => props.onChange(newCheckedState)
|
|
23922
23922
|
}));
|
|
23923
|
-
const styles$
|
|
23923
|
+
const styles$P = StyleSheet.create({
|
|
23924
23924
|
indented: {
|
|
23925
23925
|
marginInlineStart: spacing.large_24
|
|
23926
23926
|
}
|
|
@@ -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$O.baseButton, color === "green" && styles$O.green, color === "orange" && styles$O.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$O = 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$N.containerHeader)
|
|
24830
24830
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24831
24831
|
depth: path.length,
|
|
24832
|
-
className: css(styles$
|
|
24832
|
+
className: css(styles$N.containerTitle)
|
|
24833
24833
|
}, capitalize(name)));
|
|
24834
24834
|
return /*#__PURE__*/React.createElement("div", {
|
|
24835
|
-
className: css(styles$
|
|
24835
|
+
className: css(styles$N.container)
|
|
24836
24836
|
}, /*#__PURE__*/React.createElement("span", {
|
|
24837
|
-
className: css(styles$
|
|
24837
|
+
className: css(styles$N.row, styles$N.rowHeading)
|
|
24838
24838
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24839
|
-
className: css(styles$
|
|
24839
|
+
className: css(styles$N.columnLeft)
|
|
24840
24840
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24841
|
-
className: "pod-title " + css(styles$
|
|
24841
|
+
className: "pod-title " + css(styles$N.containerHeader)
|
|
24842
24842
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24843
|
-
className: css(styles$
|
|
24843
|
+
className: css(styles$N.containerTitle)
|
|
24844
24844
|
}, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
|
|
24845
|
-
className: css(styles$
|
|
24845
|
+
className: css(styles$N.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$N.container)
|
|
24859
24859
|
}, controls && /*#__PURE__*/React.createElement("div", {
|
|
24860
|
-
className: css(styles$
|
|
24860
|
+
className: css(styles$N.columnLeft, styles$N.containerHeader)
|
|
24861
24861
|
}, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
24862
|
-
className: css(styles$
|
|
24862
|
+
className: css(styles$N.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$N.containerHeader)
|
|
24876
24876
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24877
24877
|
depth: path.length,
|
|
24878
|
-
className: css(styles$
|
|
24878
|
+
className: css(styles$N.containerTitle)
|
|
24879
24879
|
}, capitalize(name)), controls);
|
|
24880
24880
|
const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
|
|
24881
|
-
className: css(styles$
|
|
24881
|
+
className: css(styles$N.containerHeader, styles$N.previewCollectionHeader)
|
|
24882
24882
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24883
24883
|
depth: path.length,
|
|
24884
|
-
className: css(styles$
|
|
24884
|
+
className: css(styles$N.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$N.container)
|
|
24889
24889
|
}, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
|
|
24890
|
-
className: css(styles$
|
|
24890
|
+
className: css(styles$N.row)
|
|
24891
24891
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24892
|
-
className: css(styles$
|
|
24892
|
+
className: css(styles$N.columnLeft)
|
|
24893
24893
|
}, headingEditor), /*#__PURE__*/React.createElement("div", {
|
|
24894
|
-
className: css(styles$
|
|
24894
|
+
className: css(styles$N.columnRight)
|
|
24895
24895
|
}, headingPreview)), /*#__PURE__*/React.createElement("div", {
|
|
24896
|
-
className: css(path.length > 0 && styles$
|
|
24896
|
+
className: css(path.length > 0 && styles$N.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$N.row)
|
|
25020
25020
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25021
|
-
className: css(styles$
|
|
25021
|
+
className: css(styles$N.columnLeft)
|
|
25022
25022
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25023
|
-
className: css(sticky && styles$
|
|
25023
|
+
className: css(sticky && styles$N.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$N.columnRight)
|
|
25032
25032
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25033
|
-
className: css(sticky && styles$
|
|
25033
|
+
className: css(sticky && styles$N.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$N.row)
|
|
25050
25050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25051
|
-
className: css(styles$
|
|
25051
|
+
className: css(styles$N.columnLeft)
|
|
25052
25052
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25053
|
-
className: css(sticky && styles$
|
|
25053
|
+
className: css(sticky && styles$N.sticky)
|
|
25054
25054
|
}, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
|
|
25055
|
-
className: css(styles$
|
|
25055
|
+
className: css(styles$N.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$N.columnRight)
|
|
25071
25071
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25072
|
-
className: css(sticky && styles$
|
|
25072
|
+
className: css(sticky && styles$N.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$N.columnLeft)
|
|
25090
25090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25091
|
-
className: css(styles$
|
|
25091
|
+
className: css(styles$N.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$N.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$N.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$N.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$N.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$N.arrayElement, !elementIsLeaf && styles$N.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$N.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$N = 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
|
|
@@ -26382,11 +26382,11 @@ class Spring extends React.Component {
|
|
|
26382
26382
|
} = this.props;
|
|
26383
26383
|
return React.createElement(View, {
|
|
26384
26384
|
"aria-hidden": "true",
|
|
26385
|
-
style: [styles$
|
|
26385
|
+
style: [styles$M.grow, style]
|
|
26386
26386
|
});
|
|
26387
26387
|
}
|
|
26388
26388
|
}
|
|
26389
|
-
const styles$
|
|
26389
|
+
const styles$M = StyleSheet.create({
|
|
26390
26390
|
grow: {
|
|
26391
26391
|
flexGrow: 1
|
|
26392
26392
|
}
|
|
@@ -26588,7 +26588,7 @@ const SortableItem = createReactClass({
|
|
|
26588
26588
|
}
|
|
26589
26589
|
return /*#__PURE__*/React.createElement("li", {
|
|
26590
26590
|
draggable: this.props.draggable,
|
|
26591
|
-
className: [dragState, css(styles$
|
|
26591
|
+
className: [dragState, css(styles$L.sortableListItem)].join(" "),
|
|
26592
26592
|
onDragStart: this.handleDragStart,
|
|
26593
26593
|
onDrop: this.handleDrop,
|
|
26594
26594
|
onDragEnter: this.handleDragEnter,
|
|
@@ -26596,7 +26596,7 @@ const SortableItem = createReactClass({
|
|
|
26596
26596
|
}, this.props.component);
|
|
26597
26597
|
}
|
|
26598
26598
|
});
|
|
26599
|
-
const styles$
|
|
26599
|
+
const styles$L = StyleSheet.create({
|
|
26600
26600
|
sortableListItem: {
|
|
26601
26601
|
margin: "5px 0"
|
|
26602
26602
|
}
|
|
@@ -26844,13 +26844,13 @@ class ExpressionEditor extends React.Component {
|
|
|
26844
26844
|
onChange: this.handleToggleDiv
|
|
26845
26845
|
}));
|
|
26846
26846
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(HeadingSmall, null, "Global Options"), /*#__PURE__*/React.createElement("div", {
|
|
26847
|
-
className: css(styles$
|
|
26847
|
+
className: css(styles$K.paddedY)
|
|
26848
26848
|
}, /*#__PURE__*/React.createElement(LabeledTextField, {
|
|
26849
26849
|
label: "Visible label",
|
|
26850
26850
|
value: this.props.visibleLabel || "",
|
|
26851
26851
|
onChange: this.change("visibleLabel")
|
|
26852
26852
|
}), /*#__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", {
|
|
26853
|
-
className: css(styles$
|
|
26853
|
+
className: css(styles$K.paddedY)
|
|
26854
26854
|
}, /*#__PURE__*/React.createElement(LabeledTextField, {
|
|
26855
26855
|
label: "Aria label",
|
|
26856
26856
|
value: this.props.ariaLabel || "",
|
|
@@ -26859,13 +26859,13 @@ class ExpressionEditor extends React.Component {
|
|
|
26859
26859
|
href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
|
|
26860
26860
|
target: "_blank"
|
|
26861
26861
|
}, "this article.")))), /*#__PURE__*/React.createElement("div", {
|
|
26862
|
-
className: css(styles$
|
|
26862
|
+
className: css(styles$K.paddedY)
|
|
26863
26863
|
}, /*#__PURE__*/React.createElement(LabeledTextField, {
|
|
26864
26864
|
label: "Function variables",
|
|
26865
26865
|
value: this.state.functionsInternal,
|
|
26866
26866
|
onChange: this.handleFunctions
|
|
26867
26867
|
}), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React.createElement("div", {
|
|
26868
|
-
className: css(styles$
|
|
26868
|
+
className: css(styles$K.paddedY)
|
|
26869
26869
|
}, /*#__PURE__*/React.createElement(Checkbox$1, {
|
|
26870
26870
|
label: "Use \xD7 instead of \u22C5 for multiplication",
|
|
26871
26871
|
checked: this.props.times,
|
|
@@ -26875,7 +26875,7 @@ class ExpressionEditor extends React.Component {
|
|
|
26875
26875
|
});
|
|
26876
26876
|
}
|
|
26877
26877
|
}), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React.createElement("div", {
|
|
26878
|
-
className: css(styles$
|
|
26878
|
+
className: css(styles$K.paddedY)
|
|
26879
26879
|
}, /*#__PURE__*/React.createElement(HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React.createElement(HeadingSmall, null, "Answers"), /*#__PURE__*/React.createElement("p", {
|
|
26880
26880
|
style: {
|
|
26881
26881
|
margin: "4px 0"
|
|
@@ -26946,18 +26946,18 @@ class AnswerOption extends React.Component {
|
|
|
26946
26946
|
color: "destructive",
|
|
26947
26947
|
light: true
|
|
26948
26948
|
}, "Delete");
|
|
26949
|
-
const answerStatusCss = css(styles$
|
|
26949
|
+
const answerStatusCss = css(styles$K.answerStatus, this.props.considered === "wrong" && styles$K.answerStatusWrong, this.props.considered === "correct" && styles$K.answerStatusCorrect, this.props.considered === "ungraded" && styles$K.answerStatusUngraded);
|
|
26950
26950
|
return /*#__PURE__*/React.createElement("div", {
|
|
26951
|
-
className: css(styles$
|
|
26951
|
+
className: css(styles$K.answerOption)
|
|
26952
26952
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26953
|
-
className: css(styles$
|
|
26953
|
+
className: css(styles$K.answerHandle)
|
|
26954
26954
|
}), /*#__PURE__*/React.createElement("div", {
|
|
26955
|
-
className: css(styles$
|
|
26955
|
+
className: css(styles$K.answerBody)
|
|
26956
26956
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
26957
26957
|
onClick: this.toggleConsidered,
|
|
26958
26958
|
className: answerStatusCss
|
|
26959
26959
|
}, this.props.considered), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Expression, this.props.expressionProps))), /*#__PURE__*/React.createElement("div", {
|
|
26960
|
-
className: css(styles$
|
|
26960
|
+
className: css(styles$K.paddedY, styles$K.paddedX)
|
|
26961
26961
|
}, /*#__PURE__*/React.createElement(Checkbox$1, {
|
|
26962
26962
|
label: "Answer expression must have the same form.",
|
|
26963
26963
|
checked: this.props.form,
|
|
@@ -26967,7 +26967,7 @@ class AnswerOption extends React.Component {
|
|
|
26967
26967
|
});
|
|
26968
26968
|
}
|
|
26969
26969
|
}), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React.createElement("div", {
|
|
26970
|
-
className: css(styles$
|
|
26970
|
+
className: css(styles$K.paddedY, styles$K.paddedX)
|
|
26971
26971
|
}, /*#__PURE__*/React.createElement(Checkbox$1, {
|
|
26972
26972
|
label: "Answer expression must be fully expanded and simplified.",
|
|
26973
26973
|
checked: this.props.simplify,
|
|
@@ -26977,11 +26977,11 @@ class AnswerOption extends React.Component {
|
|
|
26977
26977
|
});
|
|
26978
26978
|
}
|
|
26979
26979
|
}), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React.createElement("div", {
|
|
26980
|
-
className: css(styles$
|
|
26980
|
+
className: css(styles$K.buttonRow, styles$K.paddedY)
|
|
26981
26981
|
}, removeButton)));
|
|
26982
26982
|
}
|
|
26983
26983
|
}
|
|
26984
|
-
const styles$
|
|
26984
|
+
const styles$K = StyleSheet.create({
|
|
26985
26985
|
paddedX: {
|
|
26986
26986
|
paddingLeft: spacing.xSmall_8,
|
|
26987
26987
|
paddingRight: spacing.xSmall_8
|
|
@@ -27076,10 +27076,10 @@ class GradedGroupEditor extends React.Component {
|
|
|
27076
27076
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27077
27077
|
className: "perseus-widget-row"
|
|
27078
27078
|
}, /*#__PURE__*/React.createElement("label", {
|
|
27079
|
-
className: css(styles$
|
|
27079
|
+
className: css(styles$J.title)
|
|
27080
27080
|
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
27081
27081
|
value: this.props.title,
|
|
27082
|
-
className: css(styles$
|
|
27082
|
+
className: css(styles$J.input)
|
|
27083
27083
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27084
27084
|
,
|
|
27085
27085
|
onChange: this.change("title")
|
|
@@ -27104,7 +27104,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27104
27104
|
}, /*#__PURE__*/React.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
|
|
27105
27105
|
className: "perseus-hint-editor"
|
|
27106
27106
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27107
|
-
className: css(styles$
|
|
27107
|
+
className: css(styles$J.hintsTitle)
|
|
27108
27108
|
}, "Hint"), /*#__PURE__*/React.createElement(Editor, {
|
|
27109
27109
|
ref: this.hintEditor,
|
|
27110
27110
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27141,7 +27141,7 @@ GradedGroupEditor.defaultProps = {
|
|
|
27141
27141
|
images: {},
|
|
27142
27142
|
hint: null
|
|
27143
27143
|
};
|
|
27144
|
-
const styles$
|
|
27144
|
+
const styles$J = StyleSheet.create({
|
|
27145
27145
|
title: {
|
|
27146
27146
|
fontSize: 18,
|
|
27147
27147
|
fontWeight: "bold"
|
|
@@ -28496,13 +28496,13 @@ function MathquillInput(props) {
|
|
|
28496
28496
|
}
|
|
28497
28497
|
});
|
|
28498
28498
|
return /*#__PURE__*/React.createElement(View, {
|
|
28499
|
-
style: styles$
|
|
28499
|
+
style: styles$I.outerWrapper
|
|
28500
28500
|
}, /*#__PURE__*/React.createElement("span", {
|
|
28501
28501
|
ref: mathFieldWrapperRef,
|
|
28502
28502
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28503
28503
|
}));
|
|
28504
28504
|
}
|
|
28505
|
-
const styles$
|
|
28505
|
+
const styles$I = StyleSheet.create({
|
|
28506
28506
|
outerWrapper: {
|
|
28507
28507
|
display: "inline-block",
|
|
28508
28508
|
borderStyle: "solid",
|
|
@@ -29548,16 +29548,16 @@ const LabeledRow = props => {
|
|
|
29548
29548
|
style
|
|
29549
29549
|
} = props;
|
|
29550
29550
|
return /*#__PURE__*/React.createElement("label", {
|
|
29551
|
-
className: css(styles$
|
|
29551
|
+
className: css(styles$H.label)
|
|
29552
29552
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29553
|
-
style: [styles$
|
|
29553
|
+
style: [styles$H.row, style]
|
|
29554
29554
|
}, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29555
|
-
style: styles$
|
|
29555
|
+
style: styles$H.spaceEnd
|
|
29556
29556
|
}, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29557
|
-
style: styles$
|
|
29557
|
+
style: styles$H.spaceStart
|
|
29558
29558
|
}, label)));
|
|
29559
29559
|
};
|
|
29560
|
-
const styles$
|
|
29560
|
+
const styles$H = StyleSheet.create({
|
|
29561
29561
|
label: {
|
|
29562
29562
|
width: "fit-content"
|
|
29563
29563
|
},
|
|
@@ -29582,11 +29582,11 @@ function Heading({
|
|
|
29582
29582
|
onToggle
|
|
29583
29583
|
}) {
|
|
29584
29584
|
return /*#__PURE__*/React.createElement(Clickable, {
|
|
29585
|
-
style: [styles$
|
|
29585
|
+
style: [styles$G.container, !isCollapsible && styles$G.notClickable],
|
|
29586
29586
|
disabled: !isCollapsible,
|
|
29587
29587
|
onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
|
|
29588
29588
|
}, () => /*#__PURE__*/React.createElement(View, {
|
|
29589
|
-
style: styles$
|
|
29589
|
+
style: styles$G.heading
|
|
29590
29590
|
}, /*#__PURE__*/React.createElement(LabelLarge, {
|
|
29591
29591
|
style: {
|
|
29592
29592
|
fontSize: 14,
|
|
@@ -29596,7 +29596,7 @@ function Heading({
|
|
|
29596
29596
|
isExpanded: isOpen
|
|
29597
29597
|
})));
|
|
29598
29598
|
}
|
|
29599
|
-
const styles$
|
|
29599
|
+
const styles$G = StyleSheet.create({
|
|
29600
29600
|
container: {
|
|
29601
29601
|
marginTop: spacing.small_12,
|
|
29602
29602
|
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
@@ -29804,6 +29804,17 @@ const getQuadraticEquation = startCoords => {
|
|
|
29804
29804
|
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;
|
|
29805
29805
|
return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
|
|
29806
29806
|
};
|
|
29807
|
+
const findAngle = (point1, point2) => {
|
|
29808
|
+
const x = point1[0] - point2[0];
|
|
29809
|
+
const y = point1[1] - point2[1];
|
|
29810
|
+
return (180 + Math.atan2(-y, -x) * 180 / Math.PI + 360) % 360;
|
|
29811
|
+
};
|
|
29812
|
+
const getAngleEquation = startCoords => {
|
|
29813
|
+
const [point1, vertex, point2] = startCoords;
|
|
29814
|
+
const angle = findAngle(point2, vertex) - findAngle(point1, vertex);
|
|
29815
|
+
const roundedAngle = angle.toFixed(0);
|
|
29816
|
+
return `${roundedAngle}\u00B0 angle at (${vertex[0]}, ${vertex[1]})`;
|
|
29817
|
+
};
|
|
29807
29818
|
const shouldShowStartCoordsUI = (flags, graph) => {
|
|
29808
29819
|
var _flags$mafs, _flags$mafs2, _flags$mafs3, _flags$mafs4, _flags$mafs5;
|
|
29809
29820
|
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
@@ -29850,17 +29861,17 @@ const LockedFigureSelect = props => {
|
|
|
29850
29861
|
const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
|
|
29851
29862
|
const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
|
|
29852
29863
|
return /*#__PURE__*/React.createElement(View, {
|
|
29853
|
-
style: styles$
|
|
29864
|
+
style: styles$F.container
|
|
29854
29865
|
}, /*#__PURE__*/React.createElement(ActionMenu, {
|
|
29855
29866
|
menuText: "Add locked figure",
|
|
29856
|
-
style: styles$
|
|
29867
|
+
style: styles$F.addElementSelect
|
|
29857
29868
|
}, figureTypesCurrent.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
|
|
29858
29869
|
key: `${id}-${figureType}`,
|
|
29859
29870
|
label: figureType,
|
|
29860
29871
|
onClick: () => onChange(figureType)
|
|
29861
29872
|
}))));
|
|
29862
29873
|
};
|
|
29863
|
-
const styles$
|
|
29874
|
+
const styles$F = StyleSheet.create({
|
|
29864
29875
|
container: {
|
|
29865
29876
|
marginTop: spacing.xSmall_8
|
|
29866
29877
|
},
|
|
@@ -29930,18 +29941,18 @@ const AngleInput = props => {
|
|
|
29930
29941
|
}
|
|
29931
29942
|
return /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29932
29943
|
tag: "label",
|
|
29933
|
-
style: styles$
|
|
29944
|
+
style: styles$E.row
|
|
29934
29945
|
}, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
|
|
29935
29946
|
size: spacing.xxSmall_6
|
|
29936
29947
|
}), /*#__PURE__*/React.createElement(ScrolllessNumberTextField, {
|
|
29937
29948
|
value: angleInput,
|
|
29938
29949
|
onChange: handleAngleChange,
|
|
29939
|
-
style: styles$
|
|
29950
|
+
style: styles$E.textField
|
|
29940
29951
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
29941
29952
|
size: spacing.xxSmall_6
|
|
29942
29953
|
}));
|
|
29943
29954
|
};
|
|
29944
|
-
const styles$
|
|
29955
|
+
const styles$E = StyleSheet.create({
|
|
29945
29956
|
row: {
|
|
29946
29957
|
display: "flex",
|
|
29947
29958
|
flexDirection: "row",
|
|
@@ -29990,30 +30001,30 @@ const CoordinatePairInput = props => {
|
|
|
29990
30001
|
onChange(newCoords);
|
|
29991
30002
|
}
|
|
29992
30003
|
return /*#__PURE__*/React.createElement(View, {
|
|
29993
|
-
style: [styles$
|
|
30004
|
+
style: [styles$D.row, style]
|
|
29994
30005
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29995
30006
|
tag: "label",
|
|
29996
|
-
style: styles$
|
|
30007
|
+
style: styles$D.row
|
|
29997
30008
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29998
30009
|
size: spacing.xxSmall_6
|
|
29999
30010
|
}), /*#__PURE__*/React.createElement(ScrolllessNumberTextField, {
|
|
30000
30011
|
value: coordState[0],
|
|
30001
30012
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
30002
|
-
style: [styles$
|
|
30013
|
+
style: [styles$D.textField, error ? styles$D.errorField : undefined]
|
|
30003
30014
|
})), /*#__PURE__*/React.createElement(Strut, {
|
|
30004
30015
|
size: spacing.medium_16
|
|
30005
30016
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30006
30017
|
tag: "label",
|
|
30007
|
-
style: styles$
|
|
30018
|
+
style: styles$D.row
|
|
30008
30019
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
|
|
30009
30020
|
size: spacing.xxSmall_6
|
|
30010
30021
|
}), /*#__PURE__*/React.createElement(ScrolllessNumberTextField, {
|
|
30011
30022
|
value: coordState[1],
|
|
30012
30023
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
30013
|
-
style: [styles$
|
|
30024
|
+
style: [styles$D.textField, error ? styles$D.errorField : undefined]
|
|
30014
30025
|
})));
|
|
30015
30026
|
};
|
|
30016
|
-
const styles$
|
|
30027
|
+
const styles$D = StyleSheet.create({
|
|
30017
30028
|
row: {
|
|
30018
30029
|
display: "flex",
|
|
30019
30030
|
flexDirection: "row",
|
|
@@ -30046,14 +30057,14 @@ const PerseusEditorAccordion = props => {
|
|
|
30046
30057
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
30047
30058
|
expanded: expanded,
|
|
30048
30059
|
onToggle: onToggle,
|
|
30049
|
-
style: [styles$
|
|
30050
|
-
headerStyle: styles$
|
|
30060
|
+
style: [styles$C.container, containerStyle],
|
|
30061
|
+
headerStyle: styles$C.accordionHeader,
|
|
30051
30062
|
header: header
|
|
30052
30063
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30053
|
-
style: [styles$
|
|
30064
|
+
style: [styles$C.accordionPanel, panelStyle]
|
|
30054
30065
|
}, children)));
|
|
30055
30066
|
};
|
|
30056
|
-
const styles$
|
|
30067
|
+
const styles$C = StyleSheet.create({
|
|
30057
30068
|
container: {
|
|
30058
30069
|
backgroundColor: color.fadedBlue8,
|
|
30059
30070
|
marginTop: spacing.xSmall_8
|
|
@@ -30084,13 +30095,13 @@ const ColorSwatch = props => {
|
|
|
30084
30095
|
"aria-label":
|
|
30085
30096
|
// Don't include an aria label for decorative circles.
|
|
30086
30097
|
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
30087
|
-
style: [styles$
|
|
30098
|
+
style: [styles$B.colorSwatch, {
|
|
30088
30099
|
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
30089
30100
|
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
30090
30101
|
}]
|
|
30091
30102
|
});
|
|
30092
30103
|
};
|
|
30093
|
-
const styles$
|
|
30104
|
+
const styles$B = StyleSheet.create({
|
|
30094
30105
|
colorSwatch: {
|
|
30095
30106
|
// Add a white outline so that the color swatch is visible when
|
|
30096
30107
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30109,10 +30120,10 @@ const ColorSelect = props => {
|
|
|
30109
30120
|
onChange
|
|
30110
30121
|
} = props;
|
|
30111
30122
|
return /*#__PURE__*/React.createElement(View, {
|
|
30112
|
-
style: [styles$
|
|
30123
|
+
style: [styles$A.row, style]
|
|
30113
30124
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30114
30125
|
tag: "label",
|
|
30115
|
-
style: styles$
|
|
30126
|
+
style: styles$A.row
|
|
30116
30127
|
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
30117
30128
|
size: spacing.xxSmall_6
|
|
30118
30129
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30131,7 +30142,7 @@ const ColorSelect = props => {
|
|
|
30131
30142
|
})
|
|
30132
30143
|
})))));
|
|
30133
30144
|
};
|
|
30134
|
-
const styles$
|
|
30145
|
+
const styles$A = StyleSheet.create({
|
|
30135
30146
|
row: {
|
|
30136
30147
|
display: "flex",
|
|
30137
30148
|
flexDirection: "row",
|
|
@@ -30150,17 +30161,17 @@ const EllipseSwatch = props => {
|
|
|
30150
30161
|
} = props;
|
|
30151
30162
|
return /*#__PURE__*/React.createElement(View, {
|
|
30152
30163
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30153
|
-
style: [styles$
|
|
30164
|
+
style: [styles$z.container, {
|
|
30154
30165
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30155
30166
|
}]
|
|
30156
30167
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30157
|
-
style: [styles$
|
|
30168
|
+
style: [styles$z.innerCircle, {
|
|
30158
30169
|
backgroundColor: lockedFigureColors[color],
|
|
30159
30170
|
opacity: fillStyle === "white" ? 0 : lockedFigureFillStyles[fillStyle]
|
|
30160
30171
|
}]
|
|
30161
30172
|
}));
|
|
30162
30173
|
};
|
|
30163
|
-
const styles$
|
|
30174
|
+
const styles$z = StyleSheet.create({
|
|
30164
30175
|
container: {
|
|
30165
30176
|
// Add a white outline so that the color swatch is visible when
|
|
30166
30177
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30186,7 +30197,7 @@ const LineStrokeSelect = props => {
|
|
|
30186
30197
|
} = props;
|
|
30187
30198
|
return /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30188
30199
|
tag: "label",
|
|
30189
|
-
style: styles$
|
|
30200
|
+
style: styles$y.lineStrokeSelect
|
|
30190
30201
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30191
30202
|
size: spacing.xxxSmall_4
|
|
30192
30203
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30203,7 +30214,7 @@ const LineStrokeSelect = props => {
|
|
|
30203
30214
|
label: "dashed"
|
|
30204
30215
|
})));
|
|
30205
30216
|
};
|
|
30206
|
-
const styles$
|
|
30217
|
+
const styles$y = StyleSheet.create({
|
|
30207
30218
|
lineStrokeSelect: {
|
|
30208
30219
|
display: "flex",
|
|
30209
30220
|
flexDirection: "row",
|
|
@@ -30225,40 +30236,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30225
30236
|
onRemove
|
|
30226
30237
|
} = props;
|
|
30227
30238
|
return /*#__PURE__*/React.createElement(View, {
|
|
30228
|
-
style: styles$
|
|
30239
|
+
style: styles$x.container
|
|
30229
30240
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
30230
30241
|
startIcon: trashIcon,
|
|
30231
30242
|
"aria-label": `Delete locked ${figureType}`,
|
|
30232
30243
|
onClick: onRemove,
|
|
30233
30244
|
kind: "tertiary",
|
|
30234
|
-
style: styles$
|
|
30245
|
+
style: styles$x.deleteButton
|
|
30235
30246
|
}, "Delete"), /*#__PURE__*/React.createElement(Spring, null), /*#__PURE__*/React.createElement(IconButton, {
|
|
30236
30247
|
icon: caretDoubleUpIcon,
|
|
30237
30248
|
size: "small",
|
|
30238
30249
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30239
30250
|
onClick: () => onMove("back"),
|
|
30240
|
-
style: styles$
|
|
30251
|
+
style: styles$x.iconButton
|
|
30241
30252
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30242
30253
|
icon: caretUpIcon,
|
|
30243
30254
|
size: "small",
|
|
30244
30255
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30245
30256
|
onClick: () => onMove("backward"),
|
|
30246
|
-
style: styles$
|
|
30257
|
+
style: styles$x.iconButton
|
|
30247
30258
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30248
30259
|
icon: caretDownIcon,
|
|
30249
30260
|
size: "small",
|
|
30250
30261
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30251
30262
|
onClick: () => onMove("forward"),
|
|
30252
|
-
style: styles$
|
|
30263
|
+
style: styles$x.iconButton
|
|
30253
30264
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30254
30265
|
icon: caretDoubleDownIcon,
|
|
30255
30266
|
size: "small",
|
|
30256
30267
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30257
30268
|
onClick: () => onMove("front"),
|
|
30258
|
-
style: styles$
|
|
30269
|
+
style: styles$x.iconButton
|
|
30259
30270
|
}));
|
|
30260
30271
|
};
|
|
30261
|
-
const styles$
|
|
30272
|
+
const styles$x = StyleSheet.create({
|
|
30262
30273
|
container: {
|
|
30263
30274
|
width: "100%",
|
|
30264
30275
|
flexDirection: "row",
|
|
@@ -30305,7 +30316,7 @@ const LockedEllipseSettings = props => {
|
|
|
30305
30316
|
/*#__PURE__*/
|
|
30306
30317
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30307
30318
|
React.createElement(View, {
|
|
30308
|
-
style: styles$
|
|
30319
|
+
style: styles$w.row
|
|
30309
30320
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
|
|
30310
30321
|
size: spacing.xSmall_8
|
|
30311
30322
|
}), /*#__PURE__*/React.createElement(EllipseSwatch, {
|
|
@@ -30314,19 +30325,19 @@ const LockedEllipseSettings = props => {
|
|
|
30314
30325
|
strokeStyle: strokeStyle
|
|
30315
30326
|
}))
|
|
30316
30327
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30317
|
-
style: styles$
|
|
30328
|
+
style: styles$w.row
|
|
30318
30329
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30319
30330
|
coord: center,
|
|
30320
|
-
style: styles$
|
|
30331
|
+
style: styles$w.spaceUnder,
|
|
30321
30332
|
onChange: newCoords => onChangeProps({
|
|
30322
30333
|
center: newCoords
|
|
30323
30334
|
})
|
|
30324
30335
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30325
|
-
style: styles$
|
|
30336
|
+
style: styles$w.spaceUnder
|
|
30326
30337
|
}, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30327
30338
|
coord: radius,
|
|
30328
30339
|
labels: ["x radius", "y radius"],
|
|
30329
|
-
style: styles$
|
|
30340
|
+
style: styles$w.spaceUnder,
|
|
30330
30341
|
onChange: newCoords => onChangeProps({
|
|
30331
30342
|
radius: newCoords
|
|
30332
30343
|
})
|
|
@@ -30338,7 +30349,7 @@ const LockedEllipseSettings = props => {
|
|
|
30338
30349
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30339
30350
|
size: spacing.xSmall_8
|
|
30340
30351
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30341
|
-
style: [styles$
|
|
30352
|
+
style: [styles$w.row, styles$w.spaceUnder]
|
|
30342
30353
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30343
30354
|
selectedValue: color,
|
|
30344
30355
|
onChange: handleColorChange
|
|
@@ -30346,7 +30357,7 @@ const LockedEllipseSettings = props => {
|
|
|
30346
30357
|
size: spacing.medium_16
|
|
30347
30358
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30348
30359
|
tag: "label",
|
|
30349
|
-
style: [styles$
|
|
30360
|
+
style: [styles$w.row, styles$w.truncatedWidth]
|
|
30350
30361
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30351
30362
|
size: spacing.xxSmall_6
|
|
30352
30363
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30372,7 +30383,7 @@ const LockedEllipseSettings = props => {
|
|
|
30372
30383
|
onRemove: onRemove
|
|
30373
30384
|
}));
|
|
30374
30385
|
};
|
|
30375
|
-
const styles$
|
|
30386
|
+
const styles$w = StyleSheet.create({
|
|
30376
30387
|
row: {
|
|
30377
30388
|
display: "flex",
|
|
30378
30389
|
flexDirection: "row",
|
|
@@ -30393,15 +30404,15 @@ const LineSwatch = props => {
|
|
|
30393
30404
|
lineStyle
|
|
30394
30405
|
} = props;
|
|
30395
30406
|
return /*#__PURE__*/React.createElement(View, {
|
|
30396
|
-
style: styles$
|
|
30407
|
+
style: styles$v.container
|
|
30397
30408
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30398
30409
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30399
|
-
style: [styles$
|
|
30410
|
+
style: [styles$v.lineSwatch, {
|
|
30400
30411
|
border: `5px ${lineStyle} ${lockedFigureColors[color]}`
|
|
30401
30412
|
}]
|
|
30402
30413
|
}));
|
|
30403
30414
|
};
|
|
30404
|
-
const styles$
|
|
30415
|
+
const styles$v = StyleSheet.create({
|
|
30405
30416
|
container: {
|
|
30406
30417
|
backgroundColor: color.white,
|
|
30407
30418
|
justifyContent: "center",
|
|
@@ -30475,9 +30486,9 @@ const LockedFunctionSettings = props => {
|
|
|
30475
30486
|
expanded: props.expanded,
|
|
30476
30487
|
onToggle: props.onToggle,
|
|
30477
30488
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30478
|
-
style: styles$
|
|
30489
|
+
style: styles$u.row
|
|
30479
30490
|
}, /*#__PURE__*/React.createElement(LabelLarge, {
|
|
30480
|
-
style: styles$
|
|
30491
|
+
style: styles$u.accordionHeader
|
|
30481
30492
|
}, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30482
30493
|
size: spacing.xSmall_8
|
|
30483
30494
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30485,7 +30496,7 @@ const LockedFunctionSettings = props => {
|
|
|
30485
30496
|
lineStyle: strokeStyle
|
|
30486
30497
|
}))
|
|
30487
30498
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30488
|
-
style: [styles$
|
|
30499
|
+
style: [styles$u.row, styles$u.spaceUnder]
|
|
30489
30500
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30490
30501
|
selectedValue: lineColor,
|
|
30491
30502
|
onChange: newValue => {
|
|
@@ -30499,14 +30510,14 @@ const LockedFunctionSettings = props => {
|
|
|
30499
30510
|
handlePropChange("strokeStyle", newValue);
|
|
30500
30511
|
}
|
|
30501
30512
|
})), /*#__PURE__*/React.createElement(View, {
|
|
30502
|
-
style: [styles$
|
|
30513
|
+
style: [styles$u.row, styles$u.rowSpace]
|
|
30503
30514
|
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
30504
30515
|
selectedValue: directionalAxis,
|
|
30505
30516
|
onChange: newValue => {
|
|
30506
30517
|
handlePropChange("directionalAxis", newValue);
|
|
30507
30518
|
},
|
|
30508
30519
|
"aria-label": "equation prefix",
|
|
30509
|
-
style: styles$
|
|
30520
|
+
style: styles$u.equationPrefix
|
|
30510
30521
|
// Placeholder is required, but never gets used.
|
|
30511
30522
|
,
|
|
30512
30523
|
placeholder: ""
|
|
@@ -30525,17 +30536,17 @@ const LockedFunctionSettings = props => {
|
|
|
30525
30536
|
onChange: newValue => {
|
|
30526
30537
|
handlePropChange("equation", newValue);
|
|
30527
30538
|
},
|
|
30528
|
-
style: [styles$
|
|
30539
|
+
style: [styles$u.textField]
|
|
30529
30540
|
})), /*#__PURE__*/React.createElement(View, {
|
|
30530
|
-
style: [styles$
|
|
30541
|
+
style: [styles$u.row, styles$u.rowSpace]
|
|
30531
30542
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30532
30543
|
tag: "label",
|
|
30533
|
-
style: styles$
|
|
30544
|
+
style: styles$u.domainMin
|
|
30534
30545
|
}, "domain min", /*#__PURE__*/React.createElement(Strut, {
|
|
30535
30546
|
size: spacing.xxSmall_6
|
|
30536
30547
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
30537
30548
|
type: "number",
|
|
30538
|
-
style: styles$
|
|
30549
|
+
style: styles$u.domainMinField,
|
|
30539
30550
|
value: domainEntries[0],
|
|
30540
30551
|
onChange: newValue => {
|
|
30541
30552
|
handleDomainChange(0, newValue);
|
|
@@ -30545,12 +30556,12 @@ const LockedFunctionSettings = props => {
|
|
|
30545
30556
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30546
30557
|
tag: "label",
|
|
30547
30558
|
"aria-label": "domain max",
|
|
30548
|
-
style: styles$
|
|
30559
|
+
style: styles$u.domainMax
|
|
30549
30560
|
}, "max", /*#__PURE__*/React.createElement(Strut, {
|
|
30550
30561
|
size: spacing.xxSmall_6
|
|
30551
30562
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
30552
30563
|
type: "number",
|
|
30553
|
-
style: styles$
|
|
30564
|
+
style: styles$u.domainMaxField,
|
|
30554
30565
|
value: domainEntries[1],
|
|
30555
30566
|
onChange: newValue => {
|
|
30556
30567
|
handleDomainChange(1, newValue);
|
|
@@ -30561,7 +30572,7 @@ const LockedFunctionSettings = props => {
|
|
|
30561
30572
|
onRemove: onRemove
|
|
30562
30573
|
}));
|
|
30563
30574
|
};
|
|
30564
|
-
const styles$
|
|
30575
|
+
const styles$u = StyleSheet.create({
|
|
30565
30576
|
accordionHeader: {
|
|
30566
30577
|
textOverflow: "ellipsis",
|
|
30567
30578
|
// A maximum width needs to be specified in order for the ellipsis to work.
|
|
@@ -30626,7 +30637,7 @@ const LabeledSwitch = props => {
|
|
|
30626
30637
|
const ids = useUniqueIdWithMock();
|
|
30627
30638
|
const switchId = ids.get("switch");
|
|
30628
30639
|
return /*#__PURE__*/React.createElement(View, {
|
|
30629
|
-
style: [styles$
|
|
30640
|
+
style: [styles$t.row, style]
|
|
30630
30641
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30631
30642
|
id: switchId,
|
|
30632
30643
|
checked: checked,
|
|
@@ -30638,7 +30649,7 @@ const LabeledSwitch = props => {
|
|
|
30638
30649
|
htmlFor: switchId
|
|
30639
30650
|
}, label));
|
|
30640
30651
|
};
|
|
30641
|
-
const styles$
|
|
30652
|
+
const styles$t = StyleSheet.create({
|
|
30642
30653
|
row: {
|
|
30643
30654
|
flexDirection: "row",
|
|
30644
30655
|
alignItems: "center"
|
|
@@ -30672,13 +30683,13 @@ const DefiningPointSettings = props => {
|
|
|
30672
30683
|
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30673
30684
|
expanded: expanded,
|
|
30674
30685
|
onToggle: onToggle,
|
|
30675
|
-
containerStyle: styles$
|
|
30676
|
-
panelStyle: styles$
|
|
30686
|
+
containerStyle: styles$s.container,
|
|
30687
|
+
panelStyle: styles$s.accordionPanel,
|
|
30677
30688
|
header:
|
|
30678
30689
|
/*#__PURE__*/
|
|
30679
30690
|
// Summary: Point, coords, color (filled/open)
|
|
30680
30691
|
React.createElement(View, {
|
|
30681
|
-
style: styles$
|
|
30692
|
+
style: styles$s.row
|
|
30682
30693
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30683
30694
|
size: spacing.xSmall_8
|
|
30684
30695
|
}), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30688,7 +30699,7 @@ const DefiningPointSettings = props => {
|
|
|
30688
30699
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30689
30700
|
coord: coord,
|
|
30690
30701
|
error: !!error,
|
|
30691
|
-
style: styles$
|
|
30702
|
+
style: styles$s.spaceUnder,
|
|
30692
30703
|
onChange: newCoords => {
|
|
30693
30704
|
onChangeProps({
|
|
30694
30705
|
coord: newCoords
|
|
@@ -30697,12 +30708,12 @@ const DefiningPointSettings = props => {
|
|
|
30697
30708
|
}), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30698
30709
|
label: "show point on graph",
|
|
30699
30710
|
checked: !!showPoint,
|
|
30700
|
-
style: showPoint && styles$
|
|
30711
|
+
style: showPoint && styles$s.spaceUnder,
|
|
30701
30712
|
onChange: onTogglePoint
|
|
30702
30713
|
}), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30703
30714
|
selectedValue: pointColor,
|
|
30704
30715
|
onChange: handleColorChange,
|
|
30705
|
-
style: styles$
|
|
30716
|
+
style: styles$s.spaceUnder
|
|
30706
30717
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30707
30718
|
label: "open point",
|
|
30708
30719
|
checked: !filled,
|
|
@@ -30713,7 +30724,7 @@ const DefiningPointSettings = props => {
|
|
|
30713
30724
|
}
|
|
30714
30725
|
})));
|
|
30715
30726
|
};
|
|
30716
|
-
const styles$
|
|
30727
|
+
const styles$s = StyleSheet.create({
|
|
30717
30728
|
container: {
|
|
30718
30729
|
marginTop: spacing.xSmall_8,
|
|
30719
30730
|
marginBottom: 0,
|
|
@@ -30776,7 +30787,7 @@ const LockedLineSettings = props => {
|
|
|
30776
30787
|
expanded: props.expanded,
|
|
30777
30788
|
onToggle: props.onToggle,
|
|
30778
30789
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30779
|
-
style: styles$
|
|
30790
|
+
style: styles$r.row
|
|
30780
30791
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30781
30792
|
size: spacing.xSmall_8
|
|
30782
30793
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30785,7 +30796,7 @@ const LockedLineSettings = props => {
|
|
|
30785
30796
|
}))
|
|
30786
30797
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30787
30798
|
tag: "label",
|
|
30788
|
-
style: [styles$
|
|
30799
|
+
style: [styles$r.row, styles$r.spaceUnder]
|
|
30789
30800
|
}, "kind", /*#__PURE__*/React.createElement(Strut, {
|
|
30790
30801
|
size: spacing.xxxSmall_4
|
|
30791
30802
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30806,7 +30817,7 @@ const LockedLineSettings = props => {
|
|
|
30806
30817
|
value: "segment",
|
|
30807
30818
|
label: "segment"
|
|
30808
30819
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
30809
|
-
style: styles$
|
|
30820
|
+
style: styles$r.row
|
|
30810
30821
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30811
30822
|
selectedValue: lineColor,
|
|
30812
30823
|
onChange: handleColorChange
|
|
@@ -30818,7 +30829,7 @@ const LockedLineSettings = props => {
|
|
|
30818
30829
|
lineStyle: value
|
|
30819
30830
|
})
|
|
30820
30831
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30821
|
-
style: styles$
|
|
30832
|
+
style: styles$r.errorText
|
|
30822
30833
|
}, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
|
|
30823
30834
|
label: "Point 1",
|
|
30824
30835
|
showPoint: showPoint1,
|
|
@@ -30843,7 +30854,7 @@ const LockedLineSettings = props => {
|
|
|
30843
30854
|
onRemove: onRemove
|
|
30844
30855
|
}));
|
|
30845
30856
|
};
|
|
30846
|
-
const styles$
|
|
30857
|
+
const styles$r = StyleSheet.create({
|
|
30847
30858
|
row: {
|
|
30848
30859
|
display: "flex",
|
|
30849
30860
|
flexDirection: "row",
|
|
@@ -30884,7 +30895,7 @@ const LockedPointSettings = props => {
|
|
|
30884
30895
|
/*#__PURE__*/
|
|
30885
30896
|
// Summary: Point, coords, color (filled/open)
|
|
30886
30897
|
React.createElement(View, {
|
|
30887
|
-
style: styles$
|
|
30898
|
+
style: styles$q.row
|
|
30888
30899
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30889
30900
|
size: spacing.xSmall_8
|
|
30890
30901
|
}), /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30893,7 +30904,7 @@ const LockedPointSettings = props => {
|
|
|
30893
30904
|
}))
|
|
30894
30905
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30895
30906
|
coord: coord,
|
|
30896
|
-
style: styles$
|
|
30907
|
+
style: styles$q.spaceUnder,
|
|
30897
30908
|
onChange: newCoord => {
|
|
30898
30909
|
onChangeProps({
|
|
30899
30910
|
coord: newCoord
|
|
@@ -30902,7 +30913,7 @@ const LockedPointSettings = props => {
|
|
|
30902
30913
|
}), /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30903
30914
|
selectedValue: pointColor,
|
|
30904
30915
|
onChange: handleColorChange,
|
|
30905
|
-
style: styles$
|
|
30916
|
+
style: styles$q.spaceUnder
|
|
30906
30917
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30907
30918
|
label: "open point",
|
|
30908
30919
|
checked: !filled,
|
|
@@ -30917,7 +30928,7 @@ const LockedPointSettings = props => {
|
|
|
30917
30928
|
onRemove: onRemove
|
|
30918
30929
|
}));
|
|
30919
30930
|
};
|
|
30920
|
-
const styles$
|
|
30931
|
+
const styles$q = StyleSheet.create({
|
|
30921
30932
|
row: {
|
|
30922
30933
|
flexDirection: "row",
|
|
30923
30934
|
alignItems: "center"
|
|
@@ -30935,17 +30946,17 @@ const PolygonSwatch = props => {
|
|
|
30935
30946
|
} = props;
|
|
30936
30947
|
return /*#__PURE__*/React.createElement(View, {
|
|
30937
30948
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30938
|
-
style: [styles$
|
|
30949
|
+
style: [styles$p.container, {
|
|
30939
30950
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30940
30951
|
}]
|
|
30941
30952
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30942
|
-
style: [styles$
|
|
30953
|
+
style: [styles$p.innerSquare, {
|
|
30943
30954
|
backgroundColor: lockedFigureColors[color],
|
|
30944
30955
|
opacity: fillStyle === "white" ? 0 : lockedFigureFillStyles[fillStyle]
|
|
30945
30956
|
}]
|
|
30946
30957
|
}));
|
|
30947
30958
|
};
|
|
30948
|
-
const styles$
|
|
30959
|
+
const styles$p = StyleSheet.create({
|
|
30949
30960
|
container: {
|
|
30950
30961
|
// Add a white outline so that the color swatch is visible when
|
|
30951
30962
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30987,7 +30998,7 @@ const LockedPolygonSettings = props => {
|
|
|
30987
30998
|
/*#__PURE__*/
|
|
30988
30999
|
// Summary: Polygon, number of sides, style swatch
|
|
30989
31000
|
React.createElement(View, {
|
|
30990
|
-
style: styles$
|
|
31001
|
+
style: styles$o.row
|
|
30991
31002
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
|
|
30992
31003
|
size: spacing.xSmall_8
|
|
30993
31004
|
}), /*#__PURE__*/React.createElement(PolygonSwatch, {
|
|
@@ -30996,7 +31007,7 @@ const LockedPolygonSettings = props => {
|
|
|
30996
31007
|
strokeStyle: strokeStyle
|
|
30997
31008
|
}))
|
|
30998
31009
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30999
|
-
style: [styles$
|
|
31010
|
+
style: [styles$o.row, styles$o.spaceUnder]
|
|
31000
31011
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
31001
31012
|
selectedValue: color,
|
|
31002
31013
|
onChange: handleColorChange
|
|
@@ -31004,7 +31015,7 @@ const LockedPolygonSettings = props => {
|
|
|
31004
31015
|
size: spacing.medium_16
|
|
31005
31016
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
31006
31017
|
tag: "label",
|
|
31007
|
-
style: [styles$
|
|
31018
|
+
style: [styles$o.row, styles$o.truncatedWidth]
|
|
31008
31019
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
31009
31020
|
size: spacing.xxSmall_6
|
|
31010
31021
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -31030,17 +31041,17 @@ const LockedPolygonSettings = props => {
|
|
|
31030
31041
|
onChange: newValue => onChangeProps({
|
|
31031
31042
|
showVertices: newValue
|
|
31032
31043
|
}),
|
|
31033
|
-
style: styles$
|
|
31044
|
+
style: styles$o.spaceUnder
|
|
31034
31045
|
}), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
31035
31046
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
|
|
31036
31047
|
expanded: true,
|
|
31037
|
-
containerStyle: styles$
|
|
31038
|
-
panelStyle: styles$
|
|
31048
|
+
containerStyle: styles$o.pointAccordionContainer,
|
|
31049
|
+
panelStyle: styles$o.pointAccordionPanel
|
|
31039
31050
|
}, points.map((point, index) => {
|
|
31040
31051
|
const pointLabel = String.fromCharCode(65 + index);
|
|
31041
31052
|
return /*#__PURE__*/React.createElement(View, {
|
|
31042
31053
|
key: `locked-polygon-point-index-${index}`,
|
|
31043
|
-
style: [styles$
|
|
31054
|
+
style: [styles$o.row, styles$o.spaceUnder]
|
|
31044
31055
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
|
|
31045
31056
|
size: spacing.medium_16
|
|
31046
31057
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -31068,7 +31079,7 @@ const LockedPolygonSettings = props => {
|
|
|
31068
31079
|
points: newPoints
|
|
31069
31080
|
});
|
|
31070
31081
|
},
|
|
31071
|
-
style: styles$
|
|
31082
|
+
style: styles$o.icon
|
|
31072
31083
|
}));
|
|
31073
31084
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
31074
31085
|
kind: "tertiary",
|
|
@@ -31084,7 +31095,7 @@ const LockedPolygonSettings = props => {
|
|
|
31084
31095
|
onRemove: onRemove
|
|
31085
31096
|
}));
|
|
31086
31097
|
};
|
|
31087
|
-
const styles$
|
|
31098
|
+
const styles$o = StyleSheet.create({
|
|
31088
31099
|
row: {
|
|
31089
31100
|
display: "flex",
|
|
31090
31101
|
flexDirection: "row",
|
|
@@ -31146,7 +31157,7 @@ const LockedVectorSettings = props => {
|
|
|
31146
31157
|
expanded: props.expanded,
|
|
31147
31158
|
onToggle: props.onToggle,
|
|
31148
31159
|
header: /*#__PURE__*/React.createElement(View, {
|
|
31149
|
-
style: styles$
|
|
31160
|
+
style: styles$n.row
|
|
31150
31161
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
31151
31162
|
size: spacing.xSmall_8
|
|
31152
31163
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -31154,19 +31165,19 @@ const LockedVectorSettings = props => {
|
|
|
31154
31165
|
lineStyle: "solid"
|
|
31155
31166
|
}))
|
|
31156
31167
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31157
|
-
style: [styles$
|
|
31168
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
31158
31169
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
31159
31170
|
selectedValue: lineColor,
|
|
31160
31171
|
onChange: handleColorChange
|
|
31161
31172
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
31162
|
-
style: styles$
|
|
31173
|
+
style: styles$n.errorText
|
|
31163
31174
|
}, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
31164
31175
|
expanded: true // Initial state is expanded
|
|
31165
31176
|
,
|
|
31166
|
-
containerStyle: styles$
|
|
31167
|
-
panelStyle: styles$
|
|
31177
|
+
containerStyle: styles$n.container,
|
|
31178
|
+
panelStyle: styles$n.accordionPanel,
|
|
31168
31179
|
header: /*#__PURE__*/React.createElement(View, {
|
|
31169
|
-
style: styles$
|
|
31180
|
+
style: styles$n.row
|
|
31170
31181
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
31171
31182
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31172
31183
|
coord: tail,
|
|
@@ -31177,10 +31188,10 @@ const LockedVectorSettings = props => {
|
|
|
31177
31188
|
})), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
31178
31189
|
expanded: true // Initial state is expanded
|
|
31179
31190
|
,
|
|
31180
|
-
containerStyle: styles$
|
|
31181
|
-
panelStyle: styles$
|
|
31191
|
+
containerStyle: styles$n.container,
|
|
31192
|
+
panelStyle: styles$n.accordionPanel,
|
|
31182
31193
|
header: /*#__PURE__*/React.createElement(View, {
|
|
31183
|
-
style: styles$
|
|
31194
|
+
style: styles$n.row
|
|
31184
31195
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
31185
31196
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31186
31197
|
coord: tip,
|
|
@@ -31194,7 +31205,7 @@ const LockedVectorSettings = props => {
|
|
|
31194
31205
|
onRemove: onRemove
|
|
31195
31206
|
}));
|
|
31196
31207
|
};
|
|
31197
|
-
const styles$
|
|
31208
|
+
const styles$n = StyleSheet.create({
|
|
31198
31209
|
accordionPanel: {
|
|
31199
31210
|
paddingBottom: spacing.medium_16
|
|
31200
31211
|
},
|
|
@@ -31359,7 +31370,7 @@ const LockedFiguresSection = props => {
|
|
|
31359
31370
|
onRemove: () => removeLockedFigure(index)
|
|
31360
31371
|
}));
|
|
31361
31372
|
}), /*#__PURE__*/React.createElement(View, {
|
|
31362
|
-
style: styles$
|
|
31373
|
+
style: styles$m.buttonContainer
|
|
31363
31374
|
}, /*#__PURE__*/React.createElement(LockedFigureSelect, {
|
|
31364
31375
|
showM2bFeatures: props.showM2bFeatures,
|
|
31365
31376
|
id: `${uniqueId}-select`,
|
|
@@ -31369,10 +31380,10 @@ const LockedFiguresSection = props => {
|
|
|
31369
31380
|
}), showExpandButton && /*#__PURE__*/React.createElement(Button, {
|
|
31370
31381
|
kind: "secondary",
|
|
31371
31382
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31372
|
-
style: styles$
|
|
31383
|
+
style: styles$m.button
|
|
31373
31384
|
}, buttonLabel))));
|
|
31374
31385
|
};
|
|
31375
|
-
const styles$
|
|
31386
|
+
const styles$m = StyleSheet.create({
|
|
31376
31387
|
buttonContainer: {
|
|
31377
31388
|
flexDirection: "row",
|
|
31378
31389
|
alignItems: "center"
|
|
@@ -31407,7 +31418,7 @@ const GraphPointsCountSelector = ({
|
|
|
31407
31418
|
// Never uses placeholder, always has value
|
|
31408
31419
|
,
|
|
31409
31420
|
placeholder: "",
|
|
31410
|
-
style: styles$
|
|
31421
|
+
style: styles$l.singleSelectShort
|
|
31411
31422
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31412
31423
|
key: n,
|
|
31413
31424
|
value: `${n}`,
|
|
@@ -31418,7 +31429,7 @@ const GraphPointsCountSelector = ({
|
|
|
31418
31429
|
label: "unlimited"
|
|
31419
31430
|
})]);
|
|
31420
31431
|
};
|
|
31421
|
-
const styles$
|
|
31432
|
+
const styles$l = StyleSheet.create({
|
|
31422
31433
|
singleSelectShort: {
|
|
31423
31434
|
// Non-standard spacing, but it's the smallest we can go
|
|
31424
31435
|
// without running into styling issues with the dropdown.
|
|
@@ -31431,7 +31442,7 @@ const GraphTypeSelector = props => {
|
|
|
31431
31442
|
selectedValue: props.graphType,
|
|
31432
31443
|
onChange: props.onChange,
|
|
31433
31444
|
placeholder: "Select a graph type",
|
|
31434
|
-
style: styles$
|
|
31445
|
+
style: styles$k.singleSelectShort
|
|
31435
31446
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
31436
31447
|
value: "linear",
|
|
31437
31448
|
label: "Linear function"
|
|
@@ -31464,7 +31475,7 @@ const GraphTypeSelector = props => {
|
|
|
31464
31475
|
label: "Angle"
|
|
31465
31476
|
}));
|
|
31466
31477
|
};
|
|
31467
|
-
const styles$
|
|
31478
|
+
const styles$k = StyleSheet.create({
|
|
31468
31479
|
singleSelectShort: {
|
|
31469
31480
|
// Non-standard spacing, but it's the smallest we can go
|
|
31470
31481
|
// without running into styling issues with the dropdown.
|
|
@@ -31871,10 +31882,10 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31871
31882
|
}
|
|
31872
31883
|
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31873
31884
|
label: "Background image URL:",
|
|
31874
|
-
style: styles$
|
|
31885
|
+
style: styles$j.resetSpaceTop
|
|
31875
31886
|
}, /*#__PURE__*/React.createElement("input", {
|
|
31876
31887
|
type: "text",
|
|
31877
|
-
className: css(styles$
|
|
31888
|
+
className: css(styles$j.backgroundUrlInput),
|
|
31878
31889
|
ref: this.bgUrlRef,
|
|
31879
31890
|
value: this.state.backgroundImage.url || "",
|
|
31880
31891
|
onChange: e => {
|
|
@@ -31888,9 +31899,9 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31888
31899
|
onKeyPress: this.changeBackgroundUrl,
|
|
31889
31900
|
onBlur: this.changeBackgroundUrl
|
|
31890
31901
|
}), /*#__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, {
|
|
31891
|
-
style: styles$
|
|
31902
|
+
style: styles$j.protractorSection
|
|
31892
31903
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31893
|
-
style: styles$
|
|
31904
|
+
style: styles$j.checkboxRow
|
|
31894
31905
|
}, /*#__PURE__*/React.createElement(Checkbox$1, {
|
|
31895
31906
|
label: "Show protractor",
|
|
31896
31907
|
checked: this.props.showProtractor,
|
|
@@ -31899,7 +31910,7 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31899
31910
|
showProtractor: value
|
|
31900
31911
|
});
|
|
31901
31912
|
},
|
|
31902
|
-
style: styles$
|
|
31913
|
+
style: styles$j.resetSpaceTop
|
|
31903
31914
|
})), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
|
|
31904
31915
|
layout: "floating",
|
|
31905
31916
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31920,7 +31931,7 @@ InteractiveGraphSettings.defaultProps = {
|
|
|
31920
31931
|
showProtractor: false,
|
|
31921
31932
|
showTooltips: false
|
|
31922
31933
|
};
|
|
31923
|
-
const styles$
|
|
31934
|
+
const styles$j = StyleSheet.create({
|
|
31924
31935
|
resetSpaceTop: {
|
|
31925
31936
|
marginTop: 0
|
|
31926
31937
|
},
|
|
@@ -31957,13 +31968,13 @@ const SegmentCountSelector = ({
|
|
|
31957
31968
|
const num = +newValue;
|
|
31958
31969
|
onChange(num);
|
|
31959
31970
|
},
|
|
31960
|
-
style: styles$
|
|
31971
|
+
style: styles$i.singleSelectShort
|
|
31961
31972
|
}, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31962
31973
|
key: n,
|
|
31963
31974
|
value: `${n}`,
|
|
31964
31975
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31965
31976
|
})));
|
|
31966
|
-
const styles$
|
|
31977
|
+
const styles$i = StyleSheet.create({
|
|
31967
31978
|
singleSelectShort: {
|
|
31968
31979
|
// Non-standard spacing, but it's the smallest we can go
|
|
31969
31980
|
// without running into styling issues with the dropdown.
|
|
@@ -31973,14 +31984,60 @@ const styles$h = StyleSheet.create({
|
|
|
31973
31984
|
|
|
31974
31985
|
const StartCoordsAngle = props => {
|
|
31975
31986
|
const {
|
|
31976
|
-
startCoords
|
|
31987
|
+
startCoords,
|
|
31988
|
+
onChange
|
|
31977
31989
|
} = props;
|
|
31978
|
-
return /*#__PURE__*/React.createElement(
|
|
31979
|
-
|
|
31980
|
-
|
|
31981
|
-
|
|
31982
|
-
}))
|
|
31990
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
31991
|
+
style: styles$h.equationSection
|
|
31992
|
+
}, /*#__PURE__*/React.createElement(LabelMedium, null, "Starting equation:"), /*#__PURE__*/React.createElement(BodyMonospace, {
|
|
31993
|
+
style: styles$h.equationBody
|
|
31994
|
+
}, getAngleEquation(startCoords))), /*#__PURE__*/React.createElement(View, {
|
|
31995
|
+
style: styles$h.tile
|
|
31996
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31997
|
+
size: spacing.small_12
|
|
31998
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31999
|
+
coord: startCoords[0],
|
|
32000
|
+
labels: ["x", "y"],
|
|
32001
|
+
onChange: value => onChange([value, startCoords[1], startCoords[2]])
|
|
32002
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
32003
|
+
style: styles$h.tile
|
|
32004
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Vertex:"), /*#__PURE__*/React.createElement(Strut, {
|
|
32005
|
+
size: spacing.small_12
|
|
32006
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
32007
|
+
coord: startCoords[1],
|
|
32008
|
+
labels: ["x", "y"],
|
|
32009
|
+
onChange: value => onChange([startCoords[0], value, startCoords[2]])
|
|
32010
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
32011
|
+
style: styles$h.tile
|
|
32012
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
32013
|
+
size: spacing.small_12
|
|
32014
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
32015
|
+
coord: startCoords[2],
|
|
32016
|
+
labels: ["x", "y"],
|
|
32017
|
+
onChange: value => onChange([startCoords[0], startCoords[1], value])
|
|
32018
|
+
})));
|
|
31983
32019
|
};
|
|
32020
|
+
const styles$h = StyleSheet.create({
|
|
32021
|
+
tile: {
|
|
32022
|
+
backgroundColor: color.fadedBlue8,
|
|
32023
|
+
marginTop: spacing.xSmall_8,
|
|
32024
|
+
padding: spacing.small_12,
|
|
32025
|
+
borderRadius: spacing.xSmall_8,
|
|
32026
|
+
flexDirection: "row",
|
|
32027
|
+
alignItems: "center"
|
|
32028
|
+
},
|
|
32029
|
+
equationSection: {
|
|
32030
|
+
marginTop: spacing.small_12
|
|
32031
|
+
},
|
|
32032
|
+
equationBody: {
|
|
32033
|
+
backgroundColor: color.fadedOffBlack8,
|
|
32034
|
+
border: `1px solid ${color.fadedOffBlack32}`,
|
|
32035
|
+
marginTop: spacing.xSmall_8,
|
|
32036
|
+
paddingLeft: spacing.xSmall_8,
|
|
32037
|
+
paddingRight: spacing.xSmall_8,
|
|
32038
|
+
fontSize: font.size.xSmall
|
|
32039
|
+
}
|
|
32040
|
+
});
|
|
31984
32041
|
|
|
31985
32042
|
const StartCoordsCircle = props => {
|
|
31986
32043
|
const {
|