@khanacademy/perseus-editor 6.1.0 → 6.2.1
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/color-select.d.ts +2 -0
- package/dist/components/labeled-switch.d.ts +10 -0
- package/dist/components/locked-figure-settings-accordion.d.ts +10 -0
- package/dist/es/index.js +239 -226
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +240 -226
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +372 -248
- package/package.json +7 -3
package/dist/es/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { useMathInputI18n, createMathField } from '@khanacademy/math-input';
|
|
|
21
21
|
import { SingleSelect, OptionItem, ActionMenu, ActionItem } from '@khanacademy/wonder-blocks-dropdown';
|
|
22
22
|
import { TextField, Checkbox as Checkbox$1 } from '@khanacademy/wonder-blocks-form';
|
|
23
23
|
import { LabelSmall, LabelMedium, LabelLarge, BodyMonospace } from '@khanacademy/wonder-blocks-typography';
|
|
24
|
+
import Banner from '@khanacademy/wonder-blocks-banner';
|
|
24
25
|
import { AccordionSection } from '@khanacademy/wonder-blocks-accordion';
|
|
25
26
|
import Button from '@khanacademy/wonder-blocks-button';
|
|
26
27
|
import trashIcon from '@phosphor-icons/core/bold/trash-bold.svg';
|
|
@@ -28,7 +29,7 @@ import Switch from '@khanacademy/wonder-blocks-switch';
|
|
|
28
29
|
|
|
29
30
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
30
31
|
const libName = "@khanacademy/perseus-editor";
|
|
31
|
-
const libVersion = "6.1
|
|
32
|
+
const libVersion = "6.2.1";
|
|
32
33
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
33
34
|
|
|
34
35
|
function _extends() {
|
|
@@ -218,7 +219,7 @@ class SectionControlButton extends React.Component {
|
|
|
218
219
|
role: "button",
|
|
219
220
|
hideDefaultFocusRing: true,
|
|
220
221
|
"aria-label": title,
|
|
221
|
-
style: styles$
|
|
222
|
+
style: styles$u.button
|
|
222
223
|
}, ({
|
|
223
224
|
hovered,
|
|
224
225
|
focused,
|
|
@@ -226,7 +227,7 @@ class SectionControlButton extends React.Component {
|
|
|
226
227
|
}) => /*#__PURE__*/React.createElement(InlineIcon$b, icon));
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
const styles$
|
|
230
|
+
const styles$u = StyleSheet.create({
|
|
230
231
|
button: {
|
|
231
232
|
backgroundColor: color.gold,
|
|
232
233
|
margin: 2,
|
|
@@ -20748,19 +20749,19 @@ class TexErrorView extends React.Component {
|
|
|
20748
20749
|
const {
|
|
20749
20750
|
showErrors
|
|
20750
20751
|
} = this.state;
|
|
20751
|
-
const iconStyle = showErrors ? styles$
|
|
20752
|
+
const iconStyle = showErrors ? styles$t.iconExpanded : styles$t.iconCollapsed;
|
|
20752
20753
|
return /*#__PURE__*/React.createElement(View, {
|
|
20753
|
-
style: styles$
|
|
20754
|
+
style: styles$t.errorContainer
|
|
20754
20755
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20755
|
-
style: styles$
|
|
20756
|
+
style: styles$t.title,
|
|
20756
20757
|
onClick: this.handleToggleTexErrors
|
|
20757
20758
|
}, /*#__PURE__*/React.createElement(PhosphorIcon, {
|
|
20758
20759
|
icon: caretRight,
|
|
20759
20760
|
style: iconStyle
|
|
20760
20761
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React.createElement(View, {
|
|
20761
|
-
style: styles$
|
|
20762
|
+
style: styles$t.errorExplanation
|
|
20762
20763
|
}, "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, {
|
|
20763
|
-
style: styles$
|
|
20764
|
+
style: styles$t.error,
|
|
20764
20765
|
key: index
|
|
20765
20766
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20766
20767
|
style: {
|
|
@@ -20769,7 +20770,7 @@ class TexErrorView extends React.Component {
|
|
|
20769
20770
|
}, e.math), /*#__PURE__*/React.createElement(View, null, e.message))));
|
|
20770
20771
|
}
|
|
20771
20772
|
}
|
|
20772
|
-
const styles$
|
|
20773
|
+
const styles$t = StyleSheet.create({
|
|
20773
20774
|
title: {
|
|
20774
20775
|
backgroundColor: "#eee",
|
|
20775
20776
|
fontSize: "1.25em",
|
|
@@ -24570,7 +24571,7 @@ class SimpleButton extends React.Component {
|
|
|
24570
24571
|
} = _this$props,
|
|
24571
24572
|
otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);
|
|
24572
24573
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24573
|
-
className: css(styles$
|
|
24574
|
+
className: css(styles$s.baseButton, color === "green" && styles$s.green, color === "orange" && styles$s.orange),
|
|
24574
24575
|
onClick: onClick
|
|
24575
24576
|
}, otherProps), children);
|
|
24576
24577
|
}
|
|
@@ -24585,7 +24586,7 @@ SimpleButton.defaultProps = {
|
|
|
24585
24586
|
color: "green",
|
|
24586
24587
|
onClick: () => {}
|
|
24587
24588
|
};
|
|
24588
|
-
const styles$
|
|
24589
|
+
const styles$s = StyleSheet.create({
|
|
24589
24590
|
baseButton: {
|
|
24590
24591
|
top: "0",
|
|
24591
24592
|
fontSize: "11px",
|
|
@@ -24805,23 +24806,23 @@ const LeafContainer = ({
|
|
|
24805
24806
|
}) => {
|
|
24806
24807
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24807
24808
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React.createElement("div", {
|
|
24808
|
-
className: css(styles$
|
|
24809
|
+
className: css(styles$r.containerHeader)
|
|
24809
24810
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24810
24811
|
depth: path.length,
|
|
24811
|
-
className: css(styles$
|
|
24812
|
+
className: css(styles$r.containerTitle)
|
|
24812
24813
|
}, capitalize(name)));
|
|
24813
24814
|
return /*#__PURE__*/React.createElement("div", {
|
|
24814
|
-
className: css(styles$
|
|
24815
|
+
className: css(styles$r.container)
|
|
24815
24816
|
}, /*#__PURE__*/React.createElement("span", {
|
|
24816
|
-
className: css(styles$
|
|
24817
|
+
className: css(styles$r.row, styles$r.rowHeading)
|
|
24817
24818
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24818
|
-
className: css(styles$
|
|
24819
|
+
className: css(styles$r.columnLeft)
|
|
24819
24820
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24820
|
-
className: "pod-title " + css(styles$
|
|
24821
|
+
className: "pod-title " + css(styles$r.containerHeader)
|
|
24821
24822
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24822
|
-
className: css(styles$
|
|
24823
|
+
className: css(styles$r.containerTitle)
|
|
24823
24824
|
}, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
|
|
24824
|
-
className: css(styles$
|
|
24825
|
+
className: css(styles$r.columnRight)
|
|
24825
24826
|
}, previewHeading)), children);
|
|
24826
24827
|
};
|
|
24827
24828
|
const ArrayContainer = props => {
|
|
@@ -24834,11 +24835,11 @@ const ArrayContainer = props => {
|
|
|
24834
24835
|
actions
|
|
24835
24836
|
} = props;
|
|
24836
24837
|
return /*#__PURE__*/React.createElement("div", {
|
|
24837
|
-
className: css(styles$
|
|
24838
|
+
className: css(styles$r.container)
|
|
24838
24839
|
}, controls && /*#__PURE__*/React.createElement("div", {
|
|
24839
|
-
className: css(styles$
|
|
24840
|
+
className: css(styles$r.columnLeft, styles$r.containerHeader)
|
|
24840
24841
|
}, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
24841
|
-
className: css(styles$
|
|
24842
|
+
className: css(styles$r.columnLeft)
|
|
24842
24843
|
}, /*#__PURE__*/React.createElement("a", {
|
|
24843
24844
|
href: "javascript:void 0",
|
|
24844
24845
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24851,28 +24852,28 @@ const ObjectContainer = ({
|
|
|
24851
24852
|
path
|
|
24852
24853
|
}) => {
|
|
24853
24854
|
const headingEditor = /*#__PURE__*/React.createElement("div", {
|
|
24854
|
-
className: css(styles$
|
|
24855
|
+
className: css(styles$r.containerHeader)
|
|
24855
24856
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24856
24857
|
depth: path.length,
|
|
24857
|
-
className: css(styles$
|
|
24858
|
+
className: css(styles$r.containerTitle)
|
|
24858
24859
|
}, capitalize(name)), controls);
|
|
24859
24860
|
const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
|
|
24860
|
-
className: css(styles$
|
|
24861
|
+
className: css(styles$r.containerHeader, styles$r.previewCollectionHeader)
|
|
24861
24862
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24862
24863
|
depth: path.length,
|
|
24863
|
-
className: css(styles$
|
|
24864
|
+
className: css(styles$r.containerTitle)
|
|
24864
24865
|
}, capitalize(name)));
|
|
24865
24866
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24866
24867
|
return /*#__PURE__*/React.createElement("div", {
|
|
24867
|
-
className: css(styles$
|
|
24868
|
+
className: css(styles$r.container)
|
|
24868
24869
|
}, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
|
|
24869
|
-
className: css(styles$
|
|
24870
|
+
className: css(styles$r.row)
|
|
24870
24871
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24871
|
-
className: css(styles$
|
|
24872
|
+
className: css(styles$r.columnLeft)
|
|
24872
24873
|
}, headingEditor), /*#__PURE__*/React.createElement("div", {
|
|
24873
|
-
className: css(styles$
|
|
24874
|
+
className: css(styles$r.columnRight)
|
|
24874
24875
|
}, headingPreview)), /*#__PURE__*/React.createElement("div", {
|
|
24875
|
-
className: css(path.length > 0 && styles$
|
|
24876
|
+
className: css(path.length > 0 && styles$r.contentIndent)
|
|
24876
24877
|
}, children));
|
|
24877
24878
|
};
|
|
24878
24879
|
|
|
@@ -24995,11 +24996,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24995
24996
|
className: "framework-perseus"
|
|
24996
24997
|
}, lens(renderers).get(path));
|
|
24997
24998
|
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
24998
|
-
className: css(styles$
|
|
24999
|
+
className: css(styles$r.row)
|
|
24999
25000
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25000
|
-
className: css(styles$
|
|
25001
|
+
className: css(styles$r.columnLeft)
|
|
25001
25002
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25002
|
-
className: css(sticky && styles$
|
|
25003
|
+
className: css(sticky && styles$r.sticky)
|
|
25003
25004
|
},
|
|
25004
25005
|
/*#__PURE__*/
|
|
25005
25006
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25007,9 +25008,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25007
25008
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25008
25009
|
apiOptions: apiOptions
|
|
25009
25010
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25010
|
-
className: css(styles$
|
|
25011
|
+
className: css(styles$r.columnRight)
|
|
25011
25012
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25012
|
-
className: css(sticky && styles$
|
|
25013
|
+
className: css(sticky && styles$r.sticky)
|
|
25013
25014
|
}, preview))));
|
|
25014
25015
|
});
|
|
25015
25016
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25025,13 +25026,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25025
25026
|
className: "framework-perseus"
|
|
25026
25027
|
}, lens(renderers).get(path));
|
|
25027
25028
|
return /*#__PURE__*/React.createElement("div", {
|
|
25028
|
-
className: css(styles$
|
|
25029
|
+
className: css(styles$r.row)
|
|
25029
25030
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25030
|
-
className: css(styles$
|
|
25031
|
+
className: css(styles$r.columnLeft)
|
|
25031
25032
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25032
|
-
className: css(sticky && styles$
|
|
25033
|
+
className: css(sticky && styles$r.sticky)
|
|
25033
25034
|
}, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
|
|
25034
|
-
className: css(styles$
|
|
25035
|
+
className: css(styles$r.hintEditor),
|
|
25035
25036
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25036
25037
|
apiOptions: apiOptions,
|
|
25037
25038
|
showTitle: false,
|
|
@@ -25046,9 +25047,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25046
25047
|
isFirst: true,
|
|
25047
25048
|
isLast: true
|
|
25048
25049
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25049
|
-
className: css(styles$
|
|
25050
|
+
className: css(styles$r.columnRight)
|
|
25050
25051
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25051
|
-
className: css(sticky && styles$
|
|
25052
|
+
className: css(sticky && styles$r.sticky)
|
|
25052
25053
|
}, preview)));
|
|
25053
25054
|
});
|
|
25054
25055
|
const TagsNodeContent = props => {
|
|
@@ -25065,9 +25066,9 @@ const TagsNodeContent = props => {
|
|
|
25065
25066
|
return null;
|
|
25066
25067
|
}
|
|
25067
25068
|
return /*#__PURE__*/React.createElement("div", {
|
|
25068
|
-
className: css(styles$
|
|
25069
|
+
className: css(styles$r.columnLeft)
|
|
25069
25070
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25070
|
-
className: css(styles$
|
|
25071
|
+
className: css(styles$r.tagsEditor)
|
|
25071
25072
|
}, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
|
|
25072
25073
|
value: data,
|
|
25073
25074
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25098,23 +25099,23 @@ const ArrayNodeContent = props => {
|
|
|
25098
25099
|
const subpath = path.concat(i);
|
|
25099
25100
|
const controls = [i > 0 && /*#__PURE__*/React.createElement("div", {
|
|
25100
25101
|
key: "moveArrayElementUp",
|
|
25101
|
-
className: css(styles$
|
|
25102
|
+
className: css(styles$r.control)
|
|
25102
25103
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25103
25104
|
color: "orange",
|
|
25104
25105
|
title: "Move up",
|
|
25105
25106
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25106
25107
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25107
|
-
className: css(styles$
|
|
25108
|
+
className: css(styles$r.verticalFlip)
|
|
25108
25109
|
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
|
|
25109
25110
|
key: "moveArrayElementDown",
|
|
25110
|
-
className: css(styles$
|
|
25111
|
+
className: css(styles$r.control)
|
|
25111
25112
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25112
25113
|
color: "orange",
|
|
25113
25114
|
title: "Move down",
|
|
25114
25115
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25115
25116
|
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
|
|
25116
25117
|
key: "removeArrayElement",
|
|
25117
|
-
className: css(styles$
|
|
25118
|
+
className: css(styles$r.control)
|
|
25118
25119
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25119
25120
|
color: "orange",
|
|
25120
25121
|
title: "Delete",
|
|
@@ -25122,7 +25123,7 @@ const ArrayNodeContent = props => {
|
|
|
25122
25123
|
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25123
25124
|
return /*#__PURE__*/React.createElement("div", {
|
|
25124
25125
|
key: i,
|
|
25125
|
-
className: css(styles$
|
|
25126
|
+
className: css(styles$r.arrayElement, !elementIsLeaf && styles$r.arrayElementAndNotLeaf)
|
|
25126
25127
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25127
25128
|
key: i,
|
|
25128
25129
|
shape: shape.elementShape,
|
|
@@ -25148,7 +25149,7 @@ const ObjectNodeContent = props => {
|
|
|
25148
25149
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25149
25150
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React.createElement("div", {
|
|
25150
25151
|
key: subkey,
|
|
25151
|
-
className: css(styles$
|
|
25152
|
+
className: css(styles$r.objectElement)
|
|
25152
25153
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25153
25154
|
shape: shape.shape[subkey],
|
|
25154
25155
|
data: data[subkey],
|
|
@@ -25315,7 +25316,7 @@ class MultiRendererEditor extends React.Component {
|
|
|
25315
25316
|
}, this._renderContent());
|
|
25316
25317
|
}
|
|
25317
25318
|
}
|
|
25318
|
-
const styles$
|
|
25319
|
+
const styles$r = StyleSheet.create({
|
|
25319
25320
|
// This is used in a number of places throughout this file.
|
|
25320
25321
|
container: {},
|
|
25321
25322
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25467,47 +25468,47 @@ const StatefulArticleEditor = createReactClass({
|
|
|
25467
25468
|
screen
|
|
25468
25469
|
} = this.state;
|
|
25469
25470
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
25470
|
-
style: styles$
|
|
25471
|
+
style: styles$q.controlBar
|
|
25471
25472
|
}, /*#__PURE__*/React.createElement("span", {
|
|
25472
|
-
style: styles$
|
|
25473
|
+
style: styles$q.controls
|
|
25473
25474
|
}, "Mode:", " ", /*#__PURE__*/React.createElement("span", {
|
|
25474
25475
|
onClick: () => this.setState({
|
|
25475
25476
|
mode: "edit"
|
|
25476
25477
|
}),
|
|
25477
|
-
style: mode === "edit" ? styles$
|
|
25478
|
+
style: mode === "edit" ? styles$q.controlSelected : styles$q.control
|
|
25478
25479
|
}, "EDIT"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25479
25480
|
onClick: () => this.setState({
|
|
25480
25481
|
mode: "preview"
|
|
25481
25482
|
}),
|
|
25482
|
-
style: mode === "preview" ? styles$
|
|
25483
|
+
style: mode === "preview" ? styles$q.controlSelected : styles$q.control
|
|
25483
25484
|
}, "PREVIEW"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25484
25485
|
onClick: () => this.setState({
|
|
25485
25486
|
mode: "json"
|
|
25486
25487
|
}),
|
|
25487
|
-
style: mode === "json" ? styles$
|
|
25488
|
+
style: mode === "json" ? styles$q.controlSelected : styles$q.control
|
|
25488
25489
|
}, "JSON")), /*#__PURE__*/React.createElement("span", {
|
|
25489
|
-
style: styles$
|
|
25490
|
+
style: styles$q.controls
|
|
25490
25491
|
}, "Screen:", " ", /*#__PURE__*/React.createElement("span", {
|
|
25491
25492
|
onClick: () => this.setState({
|
|
25492
25493
|
screen: "phone"
|
|
25493
25494
|
}),
|
|
25494
|
-
style: screen === "phone" ? styles$
|
|
25495
|
+
style: screen === "phone" ? styles$q.controlSelected : styles$q.control
|
|
25495
25496
|
}, "PHONE"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25496
25497
|
onClick: () => this.setState({
|
|
25497
25498
|
screen: "tablet"
|
|
25498
25499
|
}),
|
|
25499
|
-
style: screen === "tablet" ? styles$
|
|
25500
|
+
style: screen === "tablet" ? styles$q.controlSelected : styles$q.control
|
|
25500
25501
|
}, "TABLET"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25501
25502
|
onClick: () => this.setState({
|
|
25502
25503
|
screen: "desktop"
|
|
25503
25504
|
}),
|
|
25504
|
-
style: screen === "desktop" ? styles$
|
|
25505
|
+
style: screen === "desktop" ? styles$q.controlSelected : styles$q.control
|
|
25505
25506
|
}, "DESKTOP"))), /*#__PURE__*/React.createElement("div", {
|
|
25506
|
-
style: styles$
|
|
25507
|
+
style: styles$q.editor
|
|
25507
25508
|
}, /*#__PURE__*/React.createElement(ArticleEditor, this.state)));
|
|
25508
25509
|
}
|
|
25509
25510
|
});
|
|
25510
|
-
const styles$
|
|
25511
|
+
const styles$q = {
|
|
25511
25512
|
controlBar: {
|
|
25512
25513
|
marginBottom: 25,
|
|
25513
25514
|
marginTop: 5
|
|
@@ -26997,10 +26998,10 @@ class GradedGroupEditor extends React.Component {
|
|
|
26997
26998
|
}, /*#__PURE__*/React.createElement("div", {
|
|
26998
26999
|
className: "perseus-widget-row"
|
|
26999
27000
|
}, /*#__PURE__*/React.createElement("label", {
|
|
27000
|
-
className: css(styles$
|
|
27001
|
+
className: css(styles$p.title)
|
|
27001
27002
|
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
27002
27003
|
value: this.props.title,
|
|
27003
|
-
className: css(styles$
|
|
27004
|
+
className: css(styles$p.input)
|
|
27004
27005
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27005
27006
|
,
|
|
27006
27007
|
onChange: this.change("title")
|
|
@@ -27025,7 +27026,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27025
27026
|
}, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
|
|
27026
27027
|
className: "perseus-hint-editor"
|
|
27027
27028
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27028
|
-
className: css(styles$
|
|
27029
|
+
className: css(styles$p.hintsTitle)
|
|
27029
27030
|
}, "Hint"), /*#__PURE__*/React.createElement(Editor, {
|
|
27030
27031
|
ref: this.hintEditor,
|
|
27031
27032
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27062,7 +27063,7 @@ GradedGroupEditor.defaultProps = {
|
|
|
27062
27063
|
images: {},
|
|
27063
27064
|
hint: null
|
|
27064
27065
|
};
|
|
27065
|
-
const styles$
|
|
27066
|
+
const styles$p = StyleSheet.create({
|
|
27066
27067
|
title: {
|
|
27067
27068
|
fontSize: 18,
|
|
27068
27069
|
fontWeight: "bold"
|
|
@@ -28400,13 +28401,13 @@ function MathquillInput(props) {
|
|
|
28400
28401
|
}
|
|
28401
28402
|
});
|
|
28402
28403
|
return /*#__PURE__*/React.createElement(View, {
|
|
28403
|
-
style: styles$
|
|
28404
|
+
style: styles$o.outerWrapper
|
|
28404
28405
|
}, /*#__PURE__*/React.createElement("span", {
|
|
28405
28406
|
ref: mathFieldWrapperRef,
|
|
28406
28407
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28407
28408
|
}));
|
|
28408
28409
|
}
|
|
28409
|
-
const styles$
|
|
28410
|
+
const styles$o = StyleSheet.create({
|
|
28410
28411
|
outerWrapper: {
|
|
28411
28412
|
display: "inline-block",
|
|
28412
28413
|
borderStyle: "solid",
|
|
@@ -29467,7 +29468,7 @@ const GraphPointsCountSelector = ({
|
|
|
29467
29468
|
// Never uses placeholder, always has value
|
|
29468
29469
|
,
|
|
29469
29470
|
placeholder: "",
|
|
29470
|
-
style: styles$
|
|
29471
|
+
style: styles$n.singleSelectShort
|
|
29471
29472
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
29472
29473
|
key: n,
|
|
29473
29474
|
value: `${n}`,
|
|
@@ -29478,7 +29479,7 @@ const GraphPointsCountSelector = ({
|
|
|
29478
29479
|
label: "unlimited"
|
|
29479
29480
|
})]);
|
|
29480
29481
|
};
|
|
29481
|
-
const styles$
|
|
29482
|
+
const styles$n = StyleSheet.create({
|
|
29482
29483
|
singleSelectShort: {
|
|
29483
29484
|
// Non-standard spacing, but it's the smallest we can go
|
|
29484
29485
|
// without running into styling issues with the dropdown.
|
|
@@ -29491,7 +29492,7 @@ const GraphTypeSelector = props => {
|
|
|
29491
29492
|
selectedValue: props.graphType,
|
|
29492
29493
|
onChange: props.onChange,
|
|
29493
29494
|
placeholder: "Select a graph type",
|
|
29494
|
-
style: styles$
|
|
29495
|
+
style: styles$m.singleSelectShort
|
|
29495
29496
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
29496
29497
|
value: "linear",
|
|
29497
29498
|
label: "Linear function"
|
|
@@ -29524,7 +29525,7 @@ const GraphTypeSelector = props => {
|
|
|
29524
29525
|
label: "Angle"
|
|
29525
29526
|
}));
|
|
29526
29527
|
};
|
|
29527
|
-
const styles$
|
|
29528
|
+
const styles$m = StyleSheet.create({
|
|
29528
29529
|
singleSelectShort: {
|
|
29529
29530
|
// Non-standard spacing, but it's the smallest we can go
|
|
29530
29531
|
// without running into styling issues with the dropdown.
|
|
@@ -29541,16 +29542,16 @@ const LabeledRow = props => {
|
|
|
29541
29542
|
style
|
|
29542
29543
|
} = props;
|
|
29543
29544
|
return /*#__PURE__*/React.createElement("label", {
|
|
29544
|
-
className: css(styles$
|
|
29545
|
+
className: css(styles$l.label)
|
|
29545
29546
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29546
|
-
style: [styles$
|
|
29547
|
+
style: [styles$l.row, style]
|
|
29547
29548
|
}, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29548
|
-
style: styles$
|
|
29549
|
+
style: styles$l.spaceEnd
|
|
29549
29550
|
}, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29550
|
-
style: styles$
|
|
29551
|
+
style: styles$l.spaceStart
|
|
29551
29552
|
}, label)));
|
|
29552
29553
|
};
|
|
29553
|
-
const styles$
|
|
29554
|
+
const styles$l = StyleSheet.create({
|
|
29554
29555
|
label: {
|
|
29555
29556
|
width: "fit-content"
|
|
29556
29557
|
},
|
|
@@ -29944,10 +29945,10 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29944
29945
|
onChange: this.change
|
|
29945
29946
|
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
29946
29947
|
label: "Background image URL:",
|
|
29947
|
-
style: styles$
|
|
29948
|
+
style: styles$k.resetSpaceTop
|
|
29948
29949
|
}, /*#__PURE__*/React.createElement("input", {
|
|
29949
29950
|
type: "text",
|
|
29950
|
-
className: css(styles$
|
|
29951
|
+
className: css(styles$k.backgroundUrlInput),
|
|
29951
29952
|
ref: this.bgUrlRef,
|
|
29952
29953
|
value: this.state.backgroundImage.url || "",
|
|
29953
29954
|
onChange: e => {
|
|
@@ -29961,24 +29962,28 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29961
29962
|
onKeyPress: this.changeBackgroundUrl,
|
|
29962
29963
|
onBlur: this.changeBackgroundUrl
|
|
29963
29964
|
}), /*#__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, {
|
|
29964
|
-
style: styles$
|
|
29965
|
-
}, /*#__PURE__*/React.createElement(
|
|
29966
|
-
|
|
29965
|
+
style: styles$k.rulerSection
|
|
29966
|
+
}, /*#__PURE__*/React.createElement(Banner, {
|
|
29967
|
+
layout: "floating",
|
|
29968
|
+
text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
|
|
29969
|
+
kind: "warning"
|
|
29970
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
29971
|
+
style: styles$k.checkboxRow
|
|
29967
29972
|
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29968
29973
|
label: "Show ruler",
|
|
29969
29974
|
showRuler: this.props.showRuler,
|
|
29970
29975
|
onChange: this.change,
|
|
29971
|
-
style: styles$
|
|
29976
|
+
style: styles$k.resetSpaceTop
|
|
29972
29977
|
}), /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
29973
29978
|
label: "Show protractor",
|
|
29974
29979
|
showProtractor: this.props.showProtractor,
|
|
29975
29980
|
onChange: this.change,
|
|
29976
|
-
style: styles$
|
|
29981
|
+
style: styles$k.resetSpaceTop
|
|
29977
29982
|
})), this.props.showRuler && /*#__PURE__*/React.createElement(View, {
|
|
29978
|
-
style: styles$
|
|
29983
|
+
style: styles$k.spaceTop
|
|
29979
29984
|
}, /*#__PURE__*/React.createElement(LabeledRow, {
|
|
29980
29985
|
label: "Ruler label:",
|
|
29981
|
-
style: styles$
|
|
29986
|
+
style: styles$k.resetSpaceTop
|
|
29982
29987
|
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
29983
29988
|
id: "ruler-label-select",
|
|
29984
29989
|
selectedValue: this.props.rulerLabel,
|
|
@@ -29988,7 +29993,7 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
29988
29993
|
});
|
|
29989
29994
|
},
|
|
29990
29995
|
placeholder: "None",
|
|
29991
|
-
style: styles$
|
|
29996
|
+
style: styles$k.singleSelectShort
|
|
29992
29997
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
29993
29998
|
value: "",
|
|
29994
29999
|
label: "None",
|
|
@@ -30029,7 +30034,7 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
30029
30034
|
});
|
|
30030
30035
|
},
|
|
30031
30036
|
placeholder: "10",
|
|
30032
|
-
style: styles$
|
|
30037
|
+
style: styles$k.singleSelectShort
|
|
30033
30038
|
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React.createElement(OptionItem, {
|
|
30034
30039
|
key: value,
|
|
30035
30040
|
value: `${value}`,
|
|
@@ -30053,7 +30058,7 @@ InteractiveGraphSettings.defaultProps = {
|
|
|
30053
30058
|
rulerLabel: "",
|
|
30054
30059
|
rulerTicks: 10
|
|
30055
30060
|
};
|
|
30056
|
-
const styles$
|
|
30061
|
+
const styles$k = StyleSheet.create({
|
|
30057
30062
|
resetSpaceTop: {
|
|
30058
30063
|
marginTop: 0
|
|
30059
30064
|
},
|
|
@@ -30073,7 +30078,8 @@ const styles$j = StyleSheet.create({
|
|
|
30073
30078
|
checkboxRow: {
|
|
30074
30079
|
flexDirection: "row",
|
|
30075
30080
|
alignItems: "center",
|
|
30076
|
-
justifyContent: "space-between"
|
|
30081
|
+
justifyContent: "space-between",
|
|
30082
|
+
marginTop: spacing.xSmall_8
|
|
30077
30083
|
},
|
|
30078
30084
|
rulerSection: {
|
|
30079
30085
|
marginTop: spacing.xSmall_8,
|
|
@@ -30097,10 +30103,10 @@ const LockedFigureSelect = props => {
|
|
|
30097
30103
|
onChange
|
|
30098
30104
|
} = props;
|
|
30099
30105
|
return /*#__PURE__*/React.createElement(View, {
|
|
30100
|
-
style: styles$
|
|
30106
|
+
style: styles$j.container
|
|
30101
30107
|
}, /*#__PURE__*/React.createElement(ActionMenu, {
|
|
30102
30108
|
menuText: "Add locked figure",
|
|
30103
|
-
style: styles$
|
|
30109
|
+
style: styles$j.addElementSelect
|
|
30104
30110
|
}, [/*#__PURE__*/React.createElement(ActionItem, {
|
|
30105
30111
|
key: `${id}-point`,
|
|
30106
30112
|
label: "Point",
|
|
@@ -30111,9 +30117,9 @@ const LockedFigureSelect = props => {
|
|
|
30111
30117
|
onClick: () => onChange("line")
|
|
30112
30118
|
}, "Line")]));
|
|
30113
30119
|
};
|
|
30114
|
-
const styles$
|
|
30120
|
+
const styles$j = StyleSheet.create({
|
|
30115
30121
|
container: {
|
|
30116
|
-
marginTop: spacing.
|
|
30122
|
+
marginTop: spacing.xSmall_8
|
|
30117
30123
|
},
|
|
30118
30124
|
addElementSelect: {
|
|
30119
30125
|
backgroundColor: color.fadedBlue8,
|
|
@@ -30211,13 +30217,13 @@ const ColorSwatch = props => {
|
|
|
30211
30217
|
"aria-label":
|
|
30212
30218
|
// Don't include an aria label for decorative circles.
|
|
30213
30219
|
!decorative ? `Color: ${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
30214
|
-
style: [styles$
|
|
30220
|
+
style: [styles$i.colorSwatch, {
|
|
30215
30221
|
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
30216
30222
|
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
30217
30223
|
}]
|
|
30218
30224
|
});
|
|
30219
30225
|
};
|
|
30220
|
-
const styles$
|
|
30226
|
+
const styles$i = StyleSheet.create({
|
|
30221
30227
|
colorSwatch: {
|
|
30222
30228
|
// Add a white outline so that the color swatch is visible when
|
|
30223
30229
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30233,15 +30239,16 @@ const ColorSelect = props => {
|
|
|
30233
30239
|
const {
|
|
30234
30240
|
id,
|
|
30235
30241
|
selectedValue,
|
|
30242
|
+
style,
|
|
30236
30243
|
onChange
|
|
30237
30244
|
} = props;
|
|
30238
30245
|
return /*#__PURE__*/React.createElement(View, {
|
|
30239
|
-
style: styles$
|
|
30246
|
+
style: [styles$h.row, style]
|
|
30240
30247
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30241
30248
|
htmlFor: id,
|
|
30242
|
-
style: styles$
|
|
30249
|
+
style: styles$h.label,
|
|
30243
30250
|
tag: "label"
|
|
30244
|
-
}, "
|
|
30251
|
+
}, "color"), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
30245
30252
|
id: id,
|
|
30246
30253
|
selectedValue: selectedValue,
|
|
30247
30254
|
onChange: onChange
|
|
@@ -30258,13 +30265,55 @@ const ColorSelect = props => {
|
|
|
30258
30265
|
})
|
|
30259
30266
|
}, colorName))));
|
|
30260
30267
|
};
|
|
30261
|
-
const styles$
|
|
30268
|
+
const styles$h = StyleSheet.create({
|
|
30262
30269
|
row: {
|
|
30263
30270
|
flexDirection: "row",
|
|
30264
30271
|
alignItems: "center"
|
|
30265
30272
|
},
|
|
30266
30273
|
label: {
|
|
30267
|
-
marginInlineEnd: spacing.
|
|
30274
|
+
marginInlineEnd: spacing.xxxSmall_4
|
|
30275
|
+
}
|
|
30276
|
+
});
|
|
30277
|
+
|
|
30278
|
+
const LockedFigureSettingsAccordion = props => {
|
|
30279
|
+
const {
|
|
30280
|
+
children,
|
|
30281
|
+
header,
|
|
30282
|
+
containerStyle,
|
|
30283
|
+
panelStyle
|
|
30284
|
+
} = props;
|
|
30285
|
+
return /*#__PURE__*/React.createElement(View
|
|
30286
|
+
// More specificity so that we can override the default
|
|
30287
|
+
// .heading > h2 > .header styles from the articles.less
|
|
30288
|
+
// file (which is imported in perseus-renderer.less).
|
|
30289
|
+
, {
|
|
30290
|
+
className: "locked-figure-accordion"
|
|
30291
|
+
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
30292
|
+
style: [styles$g.container, containerStyle],
|
|
30293
|
+
headerStyle: styles$g.accordionHeader,
|
|
30294
|
+
header: header
|
|
30295
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
30296
|
+
style: [styles$g.accordionPanel, panelStyle]
|
|
30297
|
+
}, children)));
|
|
30298
|
+
};
|
|
30299
|
+
const styles$g = StyleSheet.create({
|
|
30300
|
+
container: {
|
|
30301
|
+
backgroundColor: color.fadedBlue8,
|
|
30302
|
+
marginTop: spacing.xSmall_8
|
|
30303
|
+
},
|
|
30304
|
+
accordionHeader: {
|
|
30305
|
+
padding: spacing.small_12,
|
|
30306
|
+
// Don't move the dropdown caret.
|
|
30307
|
+
paddingInlineEnd: 0,
|
|
30308
|
+
// Fixed height so the addition of the color swatch doesn't
|
|
30309
|
+
// change the height of the header when toggling.
|
|
30310
|
+
height: spacing.xxLarge_48
|
|
30311
|
+
},
|
|
30312
|
+
accordionPanel: {
|
|
30313
|
+
paddingTop: spacing.xxSmall_6,
|
|
30314
|
+
paddingBottom: spacing.xxxSmall_4,
|
|
30315
|
+
paddingLeft: spacing.small_12,
|
|
30316
|
+
paddingRight: spacing.small_12
|
|
30268
30317
|
}
|
|
30269
30318
|
});
|
|
30270
30319
|
|
|
@@ -30292,7 +30341,8 @@ const styles$f = StyleSheet.create({
|
|
|
30292
30341
|
container: {
|
|
30293
30342
|
width: "100%",
|
|
30294
30343
|
flexDirection: "row",
|
|
30295
|
-
alignItems: "center"
|
|
30344
|
+
alignItems: "center",
|
|
30345
|
+
marginTop: spacing.xxxSmall_4
|
|
30296
30346
|
},
|
|
30297
30347
|
deleteButton: {
|
|
30298
30348
|
// Line up the delete icon with the rest of the content.
|
|
@@ -30300,6 +30350,35 @@ const styles$f = StyleSheet.create({
|
|
|
30300
30350
|
}
|
|
30301
30351
|
});
|
|
30302
30352
|
|
|
30353
|
+
const LabeledSwitch = props => {
|
|
30354
|
+
const {
|
|
30355
|
+
checked,
|
|
30356
|
+
label,
|
|
30357
|
+
style,
|
|
30358
|
+
onChange
|
|
30359
|
+
} = props;
|
|
30360
|
+
const ids = useUniqueIdWithMock();
|
|
30361
|
+
const switchId = ids.get("switch");
|
|
30362
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30363
|
+
style: [styles$e.row, style]
|
|
30364
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30365
|
+
id: switchId,
|
|
30366
|
+
checked: checked,
|
|
30367
|
+
onChange: onChange
|
|
30368
|
+
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30369
|
+
size: spacing.xSmall_8
|
|
30370
|
+
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30371
|
+
tag: "label",
|
|
30372
|
+
htmlFor: switchId
|
|
30373
|
+
}, label));
|
|
30374
|
+
};
|
|
30375
|
+
const styles$e = StyleSheet.create({
|
|
30376
|
+
row: {
|
|
30377
|
+
flexDirection: "row",
|
|
30378
|
+
alignItems: "center"
|
|
30379
|
+
}
|
|
30380
|
+
});
|
|
30381
|
+
|
|
30303
30382
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
30304
30383
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
30305
30384
|
//
|
|
@@ -30345,13 +30424,14 @@ function getValidNumberFromString(value) {
|
|
|
30345
30424
|
// If the value is not a number, return 0.
|
|
30346
30425
|
return isNaN(parsed) ? 0 : parsed;
|
|
30347
30426
|
}
|
|
30427
|
+
const DEFAULT_COLOR = "grayH";
|
|
30348
30428
|
function getDefaultFigureForType(type) {
|
|
30349
30429
|
switch (type) {
|
|
30350
30430
|
case "point":
|
|
30351
30431
|
return {
|
|
30352
30432
|
type: "point",
|
|
30353
30433
|
coord: [0, 0],
|
|
30354
|
-
color:
|
|
30434
|
+
color: DEFAULT_COLOR,
|
|
30355
30435
|
filled: true
|
|
30356
30436
|
};
|
|
30357
30437
|
case "line":
|
|
@@ -30361,9 +30441,8 @@ function getDefaultFigureForType(type) {
|
|
|
30361
30441
|
points: [getDefaultFigureForType("point"), _extends({}, getDefaultFigureForType("point"), {
|
|
30362
30442
|
coord: [2, 2]
|
|
30363
30443
|
})],
|
|
30364
|
-
color:
|
|
30444
|
+
color: DEFAULT_COLOR,
|
|
30365
30445
|
lineStyle: "solid",
|
|
30366
|
-
showArrows: false,
|
|
30367
30446
|
showStartPoint: false,
|
|
30368
30447
|
showEndPoint: false
|
|
30369
30448
|
};
|
|
@@ -30403,7 +30482,6 @@ const LockedPointSettings = props => {
|
|
|
30403
30482
|
const xCoordId = ids.get("x-coord");
|
|
30404
30483
|
const yCoordId = ids.get("y-coord");
|
|
30405
30484
|
const colorSelectId = ids.get("point-color-select");
|
|
30406
|
-
const showPointToggleId = ids.get("show-point-toggle");
|
|
30407
30485
|
function handleBlur() {
|
|
30408
30486
|
const validCoord = [getValidNumberFromString(coordState[0]), getValidNumberFromString(coordState[1])];
|
|
30409
30487
|
|
|
@@ -30424,20 +30502,14 @@ const LockedPointSettings = props => {
|
|
|
30424
30502
|
color: newValue
|
|
30425
30503
|
});
|
|
30426
30504
|
}
|
|
30427
|
-
return /*#__PURE__*/React.createElement(
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
// file (which is imported in perseus-renderer.less).
|
|
30431
|
-
, {
|
|
30432
|
-
className: "locked-figure-accordion"
|
|
30433
|
-
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
30434
|
-
style: [styles$e.container, style],
|
|
30435
|
-
headerStyle: styles$e.accordionHeader,
|
|
30505
|
+
return /*#__PURE__*/React.createElement(LockedFigureSettingsAccordion, {
|
|
30506
|
+
containerStyle: style,
|
|
30507
|
+
panelStyle: !onRemove && styles$d.accordionPanelWithoutActions,
|
|
30436
30508
|
header:
|
|
30437
30509
|
/*#__PURE__*/
|
|
30438
30510
|
// Summary: Point, coords, color (filled/open)
|
|
30439
30511
|
React.createElement(View, {
|
|
30440
|
-
style: styles$
|
|
30512
|
+
style: styles$d.row
|
|
30441
30513
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30442
30514
|
size: spacing.xSmall_8
|
|
30443
30515
|
}), toggled && /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30445,84 +30517,58 @@ const LockedPointSettings = props => {
|
|
|
30445
30517
|
filled: filled
|
|
30446
30518
|
}))
|
|
30447
30519
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30448
|
-
style: styles$
|
|
30449
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
30450
|
-
style: styles$e.row
|
|
30451
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
30452
|
-
style: [styles$e.row, styles$e.spaceUnder]
|
|
30520
|
+
style: [styles$d.row, styles$d.spaceUnder]
|
|
30453
30521
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30454
30522
|
htmlFor: xCoordId,
|
|
30455
|
-
style: styles$
|
|
30523
|
+
style: styles$d.label,
|
|
30456
30524
|
tag: "label"
|
|
30457
|
-
}, "x
|
|
30525
|
+
}, "x coord"), /*#__PURE__*/React.createElement(TextField, {
|
|
30458
30526
|
id: xCoordId,
|
|
30459
30527
|
type: "number",
|
|
30460
30528
|
value: coordState[0],
|
|
30461
30529
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
30462
30530
|
onBlur: handleBlur,
|
|
30463
|
-
style: styles$
|
|
30464
|
-
})
|
|
30531
|
+
style: styles$d.textField
|
|
30532
|
+
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30465
30533
|
size: spacing.medium_16
|
|
30466
|
-
}), /*#__PURE__*/React.createElement(
|
|
30467
|
-
style: [styles$e.row, styles$e.spaceUnder]
|
|
30468
|
-
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30534
|
+
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30469
30535
|
htmlFor: yCoordId,
|
|
30470
|
-
style: styles$
|
|
30536
|
+
style: styles$d.label,
|
|
30471
30537
|
tag: "label"
|
|
30472
|
-
}, "y
|
|
30538
|
+
}, "y coord"), /*#__PURE__*/React.createElement(TextField, {
|
|
30473
30539
|
id: yCoordId,
|
|
30474
30540
|
type: "number",
|
|
30475
30541
|
value: coordState[1],
|
|
30476
30542
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
30477
30543
|
onBlur: handleBlur,
|
|
30478
|
-
style: styles$
|
|
30479
|
-
}))
|
|
30480
|
-
|
|
30481
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30482
|
-
id: showPointToggleId,
|
|
30544
|
+
style: styles$d.textField
|
|
30545
|
+
})), onToggle && /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30546
|
+
label: "show point on graph",
|
|
30483
30547
|
checked: !!toggled,
|
|
30548
|
+
style: toggled && styles$d.spaceUnder,
|
|
30484
30549
|
onChange: onToggle
|
|
30485
|
-
}), /*#__PURE__*/React.createElement(
|
|
30486
|
-
size: spacing.small_12
|
|
30487
|
-
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30488
|
-
tag: "label",
|
|
30489
|
-
htmlFor: showPointToggleId
|
|
30490
|
-
}, "Show point on graph")), toggled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30550
|
+
}), toggled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30491
30551
|
id: colorSelectId,
|
|
30492
|
-
selectedValue: pointColor
|
|
30493
|
-
onChange: handleColorChange
|
|
30494
|
-
|
|
30495
|
-
|
|
30496
|
-
|
|
30497
|
-
label: "Open point",
|
|
30552
|
+
selectedValue: pointColor,
|
|
30553
|
+
onChange: handleColorChange,
|
|
30554
|
+
style: styles$d.spaceUnder
|
|
30555
|
+
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30556
|
+
label: "open point",
|
|
30498
30557
|
checked: !filled,
|
|
30499
30558
|
onChange: newValue => {
|
|
30500
30559
|
onChangeProps({
|
|
30501
30560
|
filled: !newValue
|
|
30502
30561
|
});
|
|
30503
|
-
}
|
|
30504
|
-
style: styles$e.spaceUnder
|
|
30562
|
+
}
|
|
30505
30563
|
})), onRemove && /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30506
30564
|
onRemove: onRemove,
|
|
30507
30565
|
figureAriaLabel: `locked point at ${coordState[0]}, ${coordState[1]}`
|
|
30508
|
-
}))
|
|
30566
|
+
}));
|
|
30509
30567
|
};
|
|
30510
|
-
const styles$
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30514
|
-
},
|
|
30515
|
-
accordionHeader: {
|
|
30516
|
-
paddingTop: spacing.small_12,
|
|
30517
|
-
paddingBottom: spacing.small_12,
|
|
30518
|
-
paddingInlineStart: spacing.medium_16,
|
|
30519
|
-
// Fixed height so the addition of the color swatch doesn't
|
|
30520
|
-
// change the height of the header when toggling.
|
|
30521
|
-
height: spacing.xxLarge_48
|
|
30522
|
-
},
|
|
30523
|
-
accordionPanel: {
|
|
30524
|
-
padding: spacing.medium_16,
|
|
30525
|
-
paddingBottom: spacing.xSmall_8
|
|
30568
|
+
const styles$d = StyleSheet.create({
|
|
30569
|
+
accordionPanelWithoutActions: {
|
|
30570
|
+
// Need more space since we don't have the actions' margins.
|
|
30571
|
+
paddingBottom: spacing.medium_16
|
|
30526
30572
|
},
|
|
30527
30573
|
row: {
|
|
30528
30574
|
flexDirection: "row",
|
|
@@ -30532,7 +30578,7 @@ const styles$e = StyleSheet.create({
|
|
|
30532
30578
|
marginBottom: spacing.xSmall_8
|
|
30533
30579
|
},
|
|
30534
30580
|
label: {
|
|
30535
|
-
marginInlineEnd: spacing.
|
|
30581
|
+
marginInlineEnd: spacing.xxSmall_6
|
|
30536
30582
|
},
|
|
30537
30583
|
textField: {
|
|
30538
30584
|
width: spacing.xxxLarge_64
|
|
@@ -30543,9 +30589,8 @@ const LockedLineSettings = props => {
|
|
|
30543
30589
|
const {
|
|
30544
30590
|
kind,
|
|
30545
30591
|
points,
|
|
30546
|
-
color: lineColor
|
|
30592
|
+
color: lineColor,
|
|
30547
30593
|
lineStyle = "solid",
|
|
30548
|
-
showArrows,
|
|
30549
30594
|
showStartPoint,
|
|
30550
30595
|
showEndPoint,
|
|
30551
30596
|
onChangeProps,
|
|
@@ -30579,31 +30624,21 @@ const LockedLineSettings = props => {
|
|
|
30579
30624
|
})]
|
|
30580
30625
|
});
|
|
30581
30626
|
}
|
|
30582
|
-
return /*#__PURE__*/React.createElement(
|
|
30583
|
-
// More specificity so that we can override the default
|
|
30584
|
-
// .heading > h2 > .header styles from the articles.less
|
|
30585
|
-
// file (which is imported in perseus-renderer.less).
|
|
30586
|
-
, {
|
|
30587
|
-
className: "locked-figure-accordion"
|
|
30588
|
-
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
30589
|
-
style: styles$d.container,
|
|
30590
|
-
headerStyle: styles$d.accordionHeader,
|
|
30627
|
+
return /*#__PURE__*/React.createElement(LockedFigureSettingsAccordion, {
|
|
30591
30628
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30592
|
-
style: styles$
|
|
30629
|
+
style: styles$c.row
|
|
30593
30630
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30594
30631
|
size: spacing.xSmall_8
|
|
30595
30632
|
}), /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
30596
30633
|
color: lineColor
|
|
30597
30634
|
}))
|
|
30598
30635
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30599
|
-
style: styles$
|
|
30600
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
30601
|
-
style: [styles$d.row, styles$d.spaceUnder]
|
|
30636
|
+
style: [styles$c.row, styles$c.spaceUnder]
|
|
30602
30637
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30603
30638
|
htmlFor: kindSelectId,
|
|
30604
|
-
style: styles$
|
|
30639
|
+
style: styles$c.label,
|
|
30605
30640
|
tag: "label"
|
|
30606
|
-
}, "
|
|
30641
|
+
}, "kind"), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
30607
30642
|
id: kindSelectId,
|
|
30608
30643
|
selectedValue: kind,
|
|
30609
30644
|
onChange: value => onChangeProps({
|
|
@@ -30622,20 +30657,20 @@ const LockedLineSettings = props => {
|
|
|
30622
30657
|
value: "ray",
|
|
30623
30658
|
label: "ray"
|
|
30624
30659
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
30625
|
-
style: [styles$
|
|
30660
|
+
style: [styles$c.row, styles$c.spaceUnder]
|
|
30626
30661
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30627
30662
|
id: colorSelectId,
|
|
30628
|
-
selectedValue: lineColor
|
|
30663
|
+
selectedValue: lineColor,
|
|
30629
30664
|
onChange: handleColorChange
|
|
30630
30665
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30631
|
-
size: spacing.
|
|
30666
|
+
size: spacing.small_12
|
|
30632
30667
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30633
|
-
style: styles$
|
|
30668
|
+
style: styles$c.row
|
|
30634
30669
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30635
30670
|
htmlFor: styleSelectId,
|
|
30636
|
-
style: styles$
|
|
30671
|
+
style: styles$c.label,
|
|
30637
30672
|
tag: "label"
|
|
30638
|
-
}, "
|
|
30673
|
+
}, "style"), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
30639
30674
|
id: styleSelectId,
|
|
30640
30675
|
selectedValue: lineStyle,
|
|
30641
30676
|
onChange: value => onChangeProps({
|
|
@@ -30643,21 +30678,15 @@ const LockedLineSettings = props => {
|
|
|
30643
30678
|
})
|
|
30644
30679
|
// Placeholder is required, but never gets used.
|
|
30645
30680
|
,
|
|
30646
|
-
placeholder: ""
|
|
30681
|
+
placeholder: "",
|
|
30682
|
+
style: styles$c.selectMarginOffset
|
|
30647
30683
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
30648
30684
|
value: "solid",
|
|
30649
30685
|
label: "solid"
|
|
30650
30686
|
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
30651
30687
|
value: "dashed",
|
|
30652
30688
|
label: "dashed"
|
|
30653
|
-
})))), /*#__PURE__*/React.createElement(
|
|
30654
|
-
label: "Show arrows",
|
|
30655
|
-
checked: showArrows,
|
|
30656
|
-
onChange: newValue => onChangeProps({
|
|
30657
|
-
showArrows: newValue
|
|
30658
|
-
}),
|
|
30659
|
-
style: styles$d.spaceUnder
|
|
30660
|
-
}), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
|
|
30689
|
+
})))), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
|
|
30661
30690
|
label: "Start point",
|
|
30662
30691
|
toggled: showStartPoint
|
|
30663
30692
|
}, startPoint, {
|
|
@@ -30665,7 +30694,7 @@ const LockedLineSettings = props => {
|
|
|
30665
30694
|
showStartPoint: newValue
|
|
30666
30695
|
}),
|
|
30667
30696
|
onChangeProps: newProps => handleChangePoint(newProps, 0),
|
|
30668
|
-
style: styles$
|
|
30697
|
+
style: styles$c.lockedPointSettingsContainer
|
|
30669
30698
|
})), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
|
|
30670
30699
|
label: "End point",
|
|
30671
30700
|
toggled: showEndPoint
|
|
@@ -30674,31 +30703,18 @@ const LockedLineSettings = props => {
|
|
|
30674
30703
|
showEndPoint: newValue
|
|
30675
30704
|
}),
|
|
30676
30705
|
onChangeProps: newProps => handleChangePoint(newProps, 1),
|
|
30677
|
-
style: styles$
|
|
30706
|
+
style: styles$c.lockedPointSettingsContainer
|
|
30678
30707
|
})), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
|
|
30679
30708
|
onRemove: onRemove,
|
|
30680
30709
|
figureAriaLabel: `locked line defined by
|
|
30681
30710
|
${startPoint.coord[0]}, ${startPoint.coord[1]} and
|
|
30682
30711
|
${endPoint.coord[0]}, ${endPoint.coord[1]}.`
|
|
30683
|
-
}))
|
|
30712
|
+
}));
|
|
30684
30713
|
};
|
|
30685
|
-
const styles$
|
|
30686
|
-
container: {
|
|
30687
|
-
backgroundColor: color.fadedBlue8,
|
|
30688
|
-
marginBottom: spacing.xSmall_8
|
|
30689
|
-
},
|
|
30690
|
-
accordionHeader: {
|
|
30691
|
-
paddingTop: spacing.small_12,
|
|
30692
|
-
paddingBottom: spacing.small_12,
|
|
30693
|
-
paddingInlineStart: spacing.medium_16
|
|
30694
|
-
},
|
|
30695
|
-
accordionPanel: {
|
|
30696
|
-
padding: spacing.medium_16,
|
|
30697
|
-
paddingBottom: spacing.xSmall_8
|
|
30698
|
-
},
|
|
30714
|
+
const styles$c = StyleSheet.create({
|
|
30699
30715
|
lockedPointSettingsContainer: {
|
|
30700
30716
|
marginTop: spacing.xSmall_8,
|
|
30701
|
-
marginBottom:
|
|
30717
|
+
marginBottom: 0,
|
|
30702
30718
|
marginLeft: -spacing.xxxSmall_4,
|
|
30703
30719
|
marginRight: -spacing.xxxSmall_4,
|
|
30704
30720
|
backgroundColor: color.white
|
|
@@ -30711,7 +30727,11 @@ const styles$d = StyleSheet.create({
|
|
|
30711
30727
|
marginBottom: spacing.xSmall_8
|
|
30712
30728
|
},
|
|
30713
30729
|
label: {
|
|
30714
|
-
marginInlineEnd: spacing.
|
|
30730
|
+
marginInlineEnd: spacing.xxxSmall_4
|
|
30731
|
+
},
|
|
30732
|
+
selectMarginOffset: {
|
|
30733
|
+
// Align with the point settings accordions.
|
|
30734
|
+
marginInlineEnd: -spacing.xxxSmall_4
|
|
30715
30735
|
}
|
|
30716
30736
|
});
|
|
30717
30737
|
|
|
@@ -30766,9 +30786,7 @@ const LockedFiguresSection = props => {
|
|
|
30766
30786
|
};
|
|
30767
30787
|
onChange(newFigures);
|
|
30768
30788
|
}
|
|
30769
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
30770
|
-
style: styles$c.container
|
|
30771
|
-
}, figures == null ? void 0 : figures.map((figure, index) => /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
|
|
30789
|
+
return /*#__PURE__*/React.createElement(View, null, figures == null ? void 0 : figures.map((figure, index) => /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
|
|
30772
30790
|
key: `${uniqueId}-locked-${figure}-${index}`
|
|
30773
30791
|
}, figure, {
|
|
30774
30792
|
onChangeProps: newProps => changeProps(index, newProps),
|
|
@@ -30778,11 +30796,6 @@ const LockedFiguresSection = props => {
|
|
|
30778
30796
|
onChange: addLockedFigure
|
|
30779
30797
|
}));
|
|
30780
30798
|
};
|
|
30781
|
-
const styles$c = StyleSheet.create({
|
|
30782
|
-
container: {
|
|
30783
|
-
paddingTop: spacing.large_24
|
|
30784
|
-
}
|
|
30785
|
-
});
|
|
30786
30799
|
|
|
30787
30800
|
const SegmentCountSelector = ({
|
|
30788
30801
|
numSegments: _numSegments = 1,
|