@khanacademy/perseus-editor 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/graph-locked-figures/locked-figure-select.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings-actions.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figures-section.d.ts +0 -1
- package/dist/components/start-coords-quadratic.d.ts +8 -0
- package/dist/components/start-coords-sinusoid.d.ts +8 -0
- package/dist/components/util.d.ts +3 -1
- package/dist/es/index.js +355 -208
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +353 -204
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +128 -140
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
|
|
|
83
83
|
|
|
84
84
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
85
85
|
const libName = "@khanacademy/perseus-editor";
|
|
86
|
-
const libVersion = "11.
|
|
86
|
+
const libVersion = "11.2.0";
|
|
87
87
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
88
88
|
|
|
89
89
|
function _extends() {
|
|
@@ -278,13 +278,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
278
278
|
role: "button",
|
|
279
279
|
hideDefaultFocusRing: true,
|
|
280
280
|
"aria-label": title,
|
|
281
|
-
style: styles$
|
|
281
|
+
style: styles$L.button
|
|
282
282
|
}, _ref => {
|
|
283
283
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$a, icon);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const styles$
|
|
287
|
+
const styles$L = aphrodite.StyleSheet.create({
|
|
288
288
|
button: {
|
|
289
289
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
290
290
|
margin: 2,
|
|
@@ -20789,13 +20789,13 @@ class WidgetSelect extends React__namespace.Component {
|
|
|
20789
20789
|
* that collapse a region.
|
|
20790
20790
|
*/
|
|
20791
20791
|
function ToggleableCaret(props) {
|
|
20792
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20792
|
+
const iconStyle = props.isExpanded ? styles$K.expanded : styles$K.collapsed;
|
|
20793
20793
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20794
20794
|
icon: caretRight__default["default"],
|
|
20795
20795
|
style: iconStyle
|
|
20796
20796
|
});
|
|
20797
20797
|
}
|
|
20798
|
-
const styles$
|
|
20798
|
+
const styles$K = aphrodite.StyleSheet.create({
|
|
20799
20799
|
collapsed: {
|
|
20800
20800
|
transition: ".15s"
|
|
20801
20801
|
},
|
|
@@ -20825,16 +20825,16 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20825
20825
|
showErrors
|
|
20826
20826
|
} = this.state;
|
|
20827
20827
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20828
|
-
style: styles$
|
|
20828
|
+
style: styles$J.errorContainer
|
|
20829
20829
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20830
|
-
style: styles$
|
|
20830
|
+
style: styles$J.title,
|
|
20831
20831
|
onClick: this.handleToggleTexErrors
|
|
20832
20832
|
}, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
20833
20833
|
isExpanded: showErrors
|
|
20834
20834
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20835
|
-
style: styles$
|
|
20835
|
+
style: styles$J.errorExplanation
|
|
20836
20836
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20837
|
-
style: styles$
|
|
20837
|
+
style: styles$J.error,
|
|
20838
20838
|
key: index
|
|
20839
20839
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20840
20840
|
style: {
|
|
@@ -20843,7 +20843,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20843
20843
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20844
20844
|
}
|
|
20845
20845
|
}
|
|
20846
|
-
const styles$
|
|
20846
|
+
const styles$J = aphrodite.StyleSheet.create({
|
|
20847
20847
|
title: {
|
|
20848
20848
|
backgroundColor: "#eee",
|
|
20849
20849
|
fontSize: "1.25em",
|
|
@@ -24593,12 +24593,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24593
24593
|
...otherProps
|
|
24594
24594
|
} = this.props;
|
|
24595
24595
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24596
|
-
className: aphrodite.css(styles$
|
|
24596
|
+
className: aphrodite.css(styles$I.baseButton, color === "green" && styles$I.green, color === "orange" && styles$I.orange),
|
|
24597
24597
|
onClick: onClick
|
|
24598
24598
|
}, otherProps), children);
|
|
24599
24599
|
}
|
|
24600
24600
|
}
|
|
24601
|
-
const styles$
|
|
24601
|
+
const styles$I = aphrodite.StyleSheet.create({
|
|
24602
24602
|
baseButton: {
|
|
24603
24603
|
top: "0",
|
|
24604
24604
|
fontSize: "11px",
|
|
@@ -24811,23 +24811,23 @@ const LeafContainer = _ref2 => {
|
|
|
24811
24811
|
} = _ref2;
|
|
24812
24812
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24813
24813
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24814
|
-
className: aphrodite.css(styles$
|
|
24814
|
+
className: aphrodite.css(styles$H.containerHeader)
|
|
24815
24815
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24816
24816
|
depth: path.length,
|
|
24817
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$H.containerTitle)
|
|
24818
24818
|
}, capitalize(name)));
|
|
24819
24819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24820
|
-
className: aphrodite.css(styles$
|
|
24820
|
+
className: aphrodite.css(styles$H.container)
|
|
24821
24821
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24822
|
-
className: aphrodite.css(styles$
|
|
24822
|
+
className: aphrodite.css(styles$H.row, styles$H.rowHeading)
|
|
24823
24823
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24824
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
24825
24825
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24826
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24826
|
+
className: "pod-title " + aphrodite.css(styles$H.containerHeader)
|
|
24827
24827
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24828
|
-
className: aphrodite.css(styles$
|
|
24828
|
+
className: aphrodite.css(styles$H.containerTitle)
|
|
24829
24829
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24830
|
-
className: aphrodite.css(styles$
|
|
24830
|
+
className: aphrodite.css(styles$H.columnRight)
|
|
24831
24831
|
}, previewHeading)), children);
|
|
24832
24832
|
};
|
|
24833
24833
|
const ArrayContainer = props => {
|
|
@@ -24840,11 +24840,11 @@ const ArrayContainer = props => {
|
|
|
24840
24840
|
actions
|
|
24841
24841
|
} = props;
|
|
24842
24842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24843
|
-
className: aphrodite.css(styles$
|
|
24843
|
+
className: aphrodite.css(styles$H.container)
|
|
24844
24844
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24845
|
-
className: aphrodite.css(styles$
|
|
24845
|
+
className: aphrodite.css(styles$H.columnLeft, styles$H.containerHeader)
|
|
24846
24846
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24847
|
-
className: aphrodite.css(styles$
|
|
24847
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
24848
24848
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24849
24849
|
href: "javascript:void 0",
|
|
24850
24850
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24858,28 +24858,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24858
24858
|
path
|
|
24859
24859
|
} = _ref3;
|
|
24860
24860
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24861
|
-
className: aphrodite.css(styles$
|
|
24861
|
+
className: aphrodite.css(styles$H.containerHeader)
|
|
24862
24862
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24863
24863
|
depth: path.length,
|
|
24864
|
-
className: aphrodite.css(styles$
|
|
24864
|
+
className: aphrodite.css(styles$H.containerTitle)
|
|
24865
24865
|
}, capitalize(name)), controls);
|
|
24866
24866
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24867
|
-
className: aphrodite.css(styles$
|
|
24867
|
+
className: aphrodite.css(styles$H.containerHeader, styles$H.previewCollectionHeader)
|
|
24868
24868
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24869
24869
|
depth: path.length,
|
|
24870
|
-
className: aphrodite.css(styles$
|
|
24870
|
+
className: aphrodite.css(styles$H.containerTitle)
|
|
24871
24871
|
}, capitalize(name)));
|
|
24872
24872
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24873
24873
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24874
|
-
className: aphrodite.css(styles$
|
|
24874
|
+
className: aphrodite.css(styles$H.container)
|
|
24875
24875
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24876
|
-
className: aphrodite.css(styles$
|
|
24876
|
+
className: aphrodite.css(styles$H.row)
|
|
24877
24877
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24878
|
-
className: aphrodite.css(styles$
|
|
24878
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
24879
24879
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24880
|
-
className: aphrodite.css(styles$
|
|
24880
|
+
className: aphrodite.css(styles$H.columnRight)
|
|
24881
24881
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24882
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24882
|
+
className: aphrodite.css(path.length > 0 && styles$H.contentIndent)
|
|
24883
24883
|
}, children));
|
|
24884
24884
|
};
|
|
24885
24885
|
|
|
@@ -24999,11 +24999,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24999
24999
|
className: "framework-perseus"
|
|
25000
25000
|
}, lens(renderers).get(path));
|
|
25001
25001
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$H.row)
|
|
25003
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
25005
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25006
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$H.sticky)
|
|
25007
25007
|
},
|
|
25008
25008
|
/*#__PURE__*/
|
|
25009
25009
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25011,9 +25011,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25011
25011
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25012
25012
|
apiOptions: apiOptions
|
|
25013
25013
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25014
|
-
className: aphrodite.css(styles$
|
|
25014
|
+
className: aphrodite.css(styles$H.columnRight)
|
|
25015
25015
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25016
|
-
className: aphrodite.css(sticky && styles$
|
|
25016
|
+
className: aphrodite.css(sticky && styles$H.sticky)
|
|
25017
25017
|
}, preview))));
|
|
25018
25018
|
});
|
|
25019
25019
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25029,13 +25029,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25029
25029
|
className: "framework-perseus"
|
|
25030
25030
|
}, lens(renderers).get(path));
|
|
25031
25031
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25032
|
-
className: aphrodite.css(styles$
|
|
25032
|
+
className: aphrodite.css(styles$H.row)
|
|
25033
25033
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25034
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
25035
25035
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25036
|
-
className: aphrodite.css(sticky && styles$
|
|
25036
|
+
className: aphrodite.css(sticky && styles$H.sticky)
|
|
25037
25037
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25038
|
-
className: aphrodite.css(styles$
|
|
25038
|
+
className: aphrodite.css(styles$H.hintEditor),
|
|
25039
25039
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25040
25040
|
apiOptions: apiOptions,
|
|
25041
25041
|
showTitle: false,
|
|
@@ -25050,9 +25050,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25050
25050
|
isFirst: true,
|
|
25051
25051
|
isLast: true
|
|
25052
25052
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: aphrodite.css(styles$
|
|
25053
|
+
className: aphrodite.css(styles$H.columnRight)
|
|
25054
25054
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25055
|
-
className: aphrodite.css(sticky && styles$
|
|
25055
|
+
className: aphrodite.css(sticky && styles$H.sticky)
|
|
25056
25056
|
}, preview)));
|
|
25057
25057
|
});
|
|
25058
25058
|
const TagsNodeContent = props => {
|
|
@@ -25069,9 +25069,9 @@ const TagsNodeContent = props => {
|
|
|
25069
25069
|
return null;
|
|
25070
25070
|
}
|
|
25071
25071
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25072
|
+
className: aphrodite.css(styles$H.columnLeft)
|
|
25073
25073
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
|
-
className: aphrodite.css(styles$
|
|
25074
|
+
className: aphrodite.css(styles$H.tagsEditor)
|
|
25075
25075
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25076
25076
|
value: data,
|
|
25077
25077
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25102,23 +25102,23 @@ const ArrayNodeContent = props => {
|
|
|
25102
25102
|
const subpath = path.concat(i);
|
|
25103
25103
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25104
25104
|
key: "moveArrayElementUp",
|
|
25105
|
-
className: aphrodite.css(styles$
|
|
25105
|
+
className: aphrodite.css(styles$H.control)
|
|
25106
25106
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25107
25107
|
color: "orange",
|
|
25108
25108
|
title: "Move up",
|
|
25109
25109
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25110
25110
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25111
|
-
className: aphrodite.css(styles$
|
|
25111
|
+
className: aphrodite.css(styles$H.verticalFlip)
|
|
25112
25112
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25113
25113
|
key: "moveArrayElementDown",
|
|
25114
|
-
className: aphrodite.css(styles$
|
|
25114
|
+
className: aphrodite.css(styles$H.control)
|
|
25115
25115
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25116
25116
|
color: "orange",
|
|
25117
25117
|
title: "Move down",
|
|
25118
25118
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25119
25119
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25120
25120
|
key: "removeArrayElement",
|
|
25121
|
-
className: aphrodite.css(styles$
|
|
25121
|
+
className: aphrodite.css(styles$H.control)
|
|
25122
25122
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25123
25123
|
color: "orange",
|
|
25124
25124
|
title: "Delete",
|
|
@@ -25126,7 +25126,7 @@ const ArrayNodeContent = props => {
|
|
|
25126
25126
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$4)))];
|
|
25127
25127
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25128
25128
|
key: i,
|
|
25129
|
-
className: aphrodite.css(styles$
|
|
25129
|
+
className: aphrodite.css(styles$H.arrayElement, !elementIsLeaf && styles$H.arrayElementAndNotLeaf)
|
|
25130
25130
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25131
25131
|
key: i,
|
|
25132
25132
|
shape: shape.elementShape,
|
|
@@ -25152,7 +25152,7 @@ const ObjectNodeContent = props => {
|
|
|
25152
25152
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25153
25153
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25154
25154
|
key: subkey,
|
|
25155
|
-
className: aphrodite.css(styles$
|
|
25155
|
+
className: aphrodite.css(styles$H.objectElement)
|
|
25156
25156
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25157
25157
|
shape: shape.shape[subkey],
|
|
25158
25158
|
data: data[subkey],
|
|
@@ -25322,7 +25322,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25322
25322
|
}, this._renderContent());
|
|
25323
25323
|
}
|
|
25324
25324
|
}
|
|
25325
|
-
const styles$
|
|
25325
|
+
const styles$H = aphrodite.StyleSheet.create({
|
|
25326
25326
|
// This is used in a number of places throughout this file.
|
|
25327
25327
|
container: {},
|
|
25328
25328
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -26957,10 +26957,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26957
26957
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26958
26958
|
className: "perseus-widget-row"
|
|
26959
26959
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
26960
|
-
className: aphrodite.css(styles$
|
|
26960
|
+
className: aphrodite.css(styles$G.title)
|
|
26961
26961
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
26962
26962
|
value: this.props.title,
|
|
26963
|
-
className: aphrodite.css(styles$
|
|
26963
|
+
className: aphrodite.css(styles$G.input)
|
|
26964
26964
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26965
26965
|
,
|
|
26966
26966
|
onChange: this.change("title")
|
|
@@ -26985,7 +26985,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26985
26985
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
26986
26986
|
className: "perseus-hint-editor"
|
|
26987
26987
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26988
|
-
className: aphrodite.css(styles$
|
|
26988
|
+
className: aphrodite.css(styles$G.hintsTitle)
|
|
26989
26989
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
26990
26990
|
ref: this.hintEditor,
|
|
26991
26991
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27017,7 +27017,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27017
27017
|
};
|
|
27018
27018
|
};
|
|
27019
27019
|
}
|
|
27020
|
-
const styles$
|
|
27020
|
+
const styles$G = aphrodite.StyleSheet.create({
|
|
27021
27021
|
title: {
|
|
27022
27022
|
fontSize: 18,
|
|
27023
27023
|
fontWeight: "bold"
|
|
@@ -28388,13 +28388,13 @@ function MathquillInput(props) {
|
|
|
28388
28388
|
}
|
|
28389
28389
|
});
|
|
28390
28390
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28391
|
-
style: styles$
|
|
28391
|
+
style: styles$F.outerWrapper
|
|
28392
28392
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28393
28393
|
ref: mathFieldWrapperRef,
|
|
28394
28394
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28395
28395
|
}));
|
|
28396
28396
|
}
|
|
28397
|
-
const styles$
|
|
28397
|
+
const styles$F = aphrodite.StyleSheet.create({
|
|
28398
28398
|
outerWrapper: {
|
|
28399
28399
|
display: "inline-block",
|
|
28400
28400
|
borderStyle: "solid",
|
|
@@ -29464,16 +29464,16 @@ const LabeledRow = props => {
|
|
|
29464
29464
|
style
|
|
29465
29465
|
} = props;
|
|
29466
29466
|
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29467
|
-
className: aphrodite.css(styles$
|
|
29467
|
+
className: aphrodite.css(styles$E.label)
|
|
29468
29468
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29469
|
-
style: [styles$
|
|
29469
|
+
style: [styles$E.row, style]
|
|
29470
29470
|
}, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29471
|
-
style: styles$
|
|
29471
|
+
style: styles$E.spaceEnd
|
|
29472
29472
|
}, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29473
|
-
style: styles$
|
|
29473
|
+
style: styles$E.spaceStart
|
|
29474
29474
|
}, label)));
|
|
29475
29475
|
};
|
|
29476
|
-
const styles$
|
|
29476
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
29477
29477
|
label: {
|
|
29478
29478
|
width: "fit-content"
|
|
29479
29479
|
},
|
|
@@ -29550,11 +29550,11 @@ class Spring extends React__namespace.Component {
|
|
|
29550
29550
|
} = this.props;
|
|
29551
29551
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
29552
29552
|
"aria-hidden": "true",
|
|
29553
|
-
style: [styles$
|
|
29553
|
+
style: [styles$D.grow, style]
|
|
29554
29554
|
});
|
|
29555
29555
|
}
|
|
29556
29556
|
}
|
|
29557
|
-
const styles$
|
|
29557
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
29558
29558
|
grow: {
|
|
29559
29559
|
flexGrow: 1
|
|
29560
29560
|
}
|
|
@@ -29591,11 +29591,11 @@ function Heading(_ref) {
|
|
|
29591
29591
|
onToggle
|
|
29592
29592
|
} = _ref;
|
|
29593
29593
|
return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
29594
|
-
style: [styles$
|
|
29594
|
+
style: [styles$C.container, !isCollapsible && styles$C.notClickable],
|
|
29595
29595
|
disabled: !isCollapsible,
|
|
29596
29596
|
onClick: () => isCollapsible && onToggle?.(!isOpen)
|
|
29597
29597
|
}, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29598
|
-
style: styles$
|
|
29598
|
+
style: styles$C.heading
|
|
29599
29599
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
|
|
29600
29600
|
style: {
|
|
29601
29601
|
fontSize: 14,
|
|
@@ -29605,7 +29605,7 @@ function Heading(_ref) {
|
|
|
29605
29605
|
isExpanded: isOpen
|
|
29606
29606
|
})));
|
|
29607
29607
|
}
|
|
29608
|
-
const styles$
|
|
29608
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
29609
29609
|
container: {
|
|
29610
29610
|
marginTop: wonderBlocksTokens.spacing.small_12,
|
|
29611
29611
|
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
@@ -29763,10 +29763,47 @@ function getDefaultGraphStartCoords(graph, range, step) {
|
|
|
29763
29763
|
center: startCoords.center,
|
|
29764
29764
|
radius
|
|
29765
29765
|
};
|
|
29766
|
+
case "sinusoid":
|
|
29767
|
+
return perseus.getSinusoidCoords({
|
|
29768
|
+
...graph,
|
|
29769
|
+
startCoords: undefined
|
|
29770
|
+
}, range, step);
|
|
29771
|
+
case "quadratic":
|
|
29772
|
+
return perseus.getQuadraticCoords({
|
|
29773
|
+
...graph,
|
|
29774
|
+
startCoords: undefined
|
|
29775
|
+
}, range, step);
|
|
29766
29776
|
default:
|
|
29767
29777
|
return undefined;
|
|
29768
29778
|
}
|
|
29769
29779
|
}
|
|
29780
|
+
const getSinusoidEquation = startCoords => {
|
|
29781
|
+
// Get coefficients
|
|
29782
|
+
// It's assumed that p1 is the root and p2 is the first peak
|
|
29783
|
+
const p1 = startCoords[0];
|
|
29784
|
+
const p2 = startCoords[1];
|
|
29785
|
+
|
|
29786
|
+
// Resulting coefficients are canonical for this sine curve
|
|
29787
|
+
const amplitude = p2[1] - p1[1];
|
|
29788
|
+
const angularFrequency = Math.PI / (2 * (p2[0] - p1[0]));
|
|
29789
|
+
const phase = p1[0] * angularFrequency;
|
|
29790
|
+
const verticalOffset = p1[1];
|
|
29791
|
+
return "y = " + amplitude.toFixed(3) + "sin(" + angularFrequency.toFixed(3) + "x - " + phase.toFixed(3) + ") + " + verticalOffset.toFixed(3);
|
|
29792
|
+
};
|
|
29793
|
+
const getQuadraticEquation = startCoords => {
|
|
29794
|
+
const p1 = startCoords[0];
|
|
29795
|
+
const p2 = startCoords[1];
|
|
29796
|
+
const p3 = startCoords[2];
|
|
29797
|
+
const denom = (p1[0] - p2[0]) * (p1[0] - p3[0]) * (p2[0] - p3[0]);
|
|
29798
|
+
if (denom === 0) {
|
|
29799
|
+
// Many of the callers assume that the return value is always defined.
|
|
29800
|
+
return "Division by zero error";
|
|
29801
|
+
}
|
|
29802
|
+
const a = (p3[0] * (p2[1] - p1[1]) + p2[0] * (p1[1] - p3[1]) + p1[0] * (p3[1] - p2[1])) / denom;
|
|
29803
|
+
const b = (p3[0] * p3[0] * (p1[1] - p2[1]) + p2[0] * p2[0] * (p3[1] - p1[1]) + p1[0] * p1[0] * (p2[1] - p3[1])) / denom;
|
|
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
|
+
return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
|
|
29806
|
+
};
|
|
29770
29807
|
|
|
29771
29808
|
/**
|
|
29772
29809
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29780,19 +29817,20 @@ const LockedFigureSelect = props => {
|
|
|
29780
29817
|
id,
|
|
29781
29818
|
onChange
|
|
29782
29819
|
} = props;
|
|
29783
|
-
const figureTypes =
|
|
29820
|
+
const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
|
|
29821
|
+
const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
|
|
29784
29822
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29785
|
-
style: styles$
|
|
29823
|
+
style: styles$B.container
|
|
29786
29824
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29787
29825
|
menuText: "Add locked figure",
|
|
29788
|
-
style: styles$
|
|
29789
|
-
},
|
|
29826
|
+
style: styles$B.addElementSelect
|
|
29827
|
+
}, figureTypesCurrent.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29790
29828
|
key: `${id}-${figureType}`,
|
|
29791
29829
|
label: figureType,
|
|
29792
29830
|
onClick: () => onChange(figureType)
|
|
29793
29831
|
}))));
|
|
29794
29832
|
};
|
|
29795
|
-
const styles$
|
|
29833
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
29796
29834
|
container: {
|
|
29797
29835
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29798
29836
|
},
|
|
@@ -29823,19 +29861,19 @@ const AngleInput = props => {
|
|
|
29823
29861
|
}
|
|
29824
29862
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29825
29863
|
tag: "label",
|
|
29826
|
-
style: styles$
|
|
29864
|
+
style: styles$A.row
|
|
29827
29865
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29828
29866
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29829
29867
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29830
29868
|
type: "number",
|
|
29831
29869
|
value: angleInput,
|
|
29832
29870
|
onChange: handleAngleChange,
|
|
29833
|
-
style: styles$
|
|
29871
|
+
style: styles$A.textField
|
|
29834
29872
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29835
29873
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29836
29874
|
}));
|
|
29837
29875
|
};
|
|
29838
|
-
const styles$
|
|
29876
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
29839
29877
|
row: {
|
|
29840
29878
|
display: "flex",
|
|
29841
29879
|
flexDirection: "row",
|
|
@@ -29884,32 +29922,32 @@ const CoordinatePairInput = props => {
|
|
|
29884
29922
|
onChange(newCoords);
|
|
29885
29923
|
}
|
|
29886
29924
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29887
|
-
style: [styles$
|
|
29925
|
+
style: [styles$z.row, style]
|
|
29888
29926
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29889
29927
|
tag: "label",
|
|
29890
|
-
style: styles$
|
|
29928
|
+
style: styles$z.row
|
|
29891
29929
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29892
29930
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29893
29931
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29894
29932
|
type: "number",
|
|
29895
29933
|
value: coordState[0],
|
|
29896
29934
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29897
|
-
style: [styles$
|
|
29935
|
+
style: [styles$z.textField, error ? styles$z.errorField : undefined]
|
|
29898
29936
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29899
29937
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29900
29938
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29901
29939
|
tag: "label",
|
|
29902
|
-
style: styles$
|
|
29940
|
+
style: styles$z.row
|
|
29903
29941
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29904
29942
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29905
29943
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29906
29944
|
type: "number",
|
|
29907
29945
|
value: coordState[1],
|
|
29908
29946
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29909
|
-
style: [styles$
|
|
29947
|
+
style: [styles$z.textField, error ? styles$z.errorField : undefined]
|
|
29910
29948
|
})));
|
|
29911
29949
|
};
|
|
29912
|
-
const styles$
|
|
29950
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
29913
29951
|
row: {
|
|
29914
29952
|
display: "flex",
|
|
29915
29953
|
flexDirection: "row",
|
|
@@ -29942,14 +29980,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29942
29980
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29943
29981
|
expanded: expanded,
|
|
29944
29982
|
onToggle: onToggle,
|
|
29945
|
-
style: [styles$
|
|
29946
|
-
headerStyle: styles$
|
|
29983
|
+
style: [styles$y.container, containerStyle],
|
|
29984
|
+
headerStyle: styles$y.accordionHeader,
|
|
29947
29985
|
header: header
|
|
29948
29986
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29949
|
-
style: [styles$
|
|
29987
|
+
style: [styles$y.accordionPanel, panelStyle]
|
|
29950
29988
|
}, children)));
|
|
29951
29989
|
};
|
|
29952
|
-
const styles$
|
|
29990
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
29953
29991
|
container: {
|
|
29954
29992
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29955
29993
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -29980,13 +30018,13 @@ const ColorSwatch = props => {
|
|
|
29980
30018
|
"aria-label":
|
|
29981
30019
|
// Don't include an aria label for decorative circles.
|
|
29982
30020
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
29983
|
-
style: [styles$
|
|
30021
|
+
style: [styles$x.colorSwatch, {
|
|
29984
30022
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
29985
30023
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
29986
30024
|
}]
|
|
29987
30025
|
});
|
|
29988
30026
|
};
|
|
29989
|
-
const styles$
|
|
30027
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
29990
30028
|
colorSwatch: {
|
|
29991
30029
|
// Add a white outline so that the color swatch is visible when
|
|
29992
30030
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30005,10 +30043,10 @@ const ColorSelect = props => {
|
|
|
30005
30043
|
onChange
|
|
30006
30044
|
} = props;
|
|
30007
30045
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30008
|
-
style: [styles$
|
|
30046
|
+
style: [styles$w.row, style]
|
|
30009
30047
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30010
30048
|
tag: "label",
|
|
30011
|
-
style: styles$
|
|
30049
|
+
style: styles$w.row
|
|
30012
30050
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30013
30051
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30014
30052
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30027,7 +30065,7 @@ const ColorSelect = props => {
|
|
|
30027
30065
|
})
|
|
30028
30066
|
})))));
|
|
30029
30067
|
};
|
|
30030
|
-
const styles$
|
|
30068
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
30031
30069
|
row: {
|
|
30032
30070
|
display: "flex",
|
|
30033
30071
|
flexDirection: "row",
|
|
@@ -30043,17 +30081,17 @@ const EllipseSwatch = props => {
|
|
|
30043
30081
|
} = props;
|
|
30044
30082
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30045
30083
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30046
|
-
style: [styles$
|
|
30084
|
+
style: [styles$v.container, {
|
|
30047
30085
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30048
30086
|
}]
|
|
30049
30087
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30050
|
-
style: [styles$
|
|
30088
|
+
style: [styles$v.innerCircle, {
|
|
30051
30089
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30052
30090
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30053
30091
|
}]
|
|
30054
30092
|
}));
|
|
30055
30093
|
};
|
|
30056
|
-
const styles$
|
|
30094
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
30057
30095
|
container: {
|
|
30058
30096
|
// Add a white outline so that the color swatch is visible when
|
|
30059
30097
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30084,40 +30122,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30084
30122
|
onRemove
|
|
30085
30123
|
} = props;
|
|
30086
30124
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30087
|
-
style: styles$
|
|
30125
|
+
style: styles$u.container
|
|
30088
30126
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30089
30127
|
startIcon: trashIcon__default["default"],
|
|
30090
30128
|
"aria-label": `Delete locked ${figureType}`,
|
|
30091
30129
|
onClick: onRemove,
|
|
30092
30130
|
kind: "tertiary",
|
|
30093
|
-
style: styles$
|
|
30094
|
-
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null),
|
|
30131
|
+
style: styles$u.deleteButton
|
|
30132
|
+
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30095
30133
|
icon: caretDoubleUpIcon__default["default"],
|
|
30096
30134
|
size: "small",
|
|
30097
30135
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30098
30136
|
onClick: () => onMove("back"),
|
|
30099
|
-
style: styles$
|
|
30137
|
+
style: styles$u.iconButton
|
|
30100
30138
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30101
30139
|
icon: caretUpIcon__default["default"],
|
|
30102
30140
|
size: "small",
|
|
30103
30141
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30104
30142
|
onClick: () => onMove("backward"),
|
|
30105
|
-
style: styles$
|
|
30143
|
+
style: styles$u.iconButton
|
|
30106
30144
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30107
30145
|
icon: caretDownIcon__default["default"],
|
|
30108
30146
|
size: "small",
|
|
30109
30147
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30110
30148
|
onClick: () => onMove("forward"),
|
|
30111
|
-
style: styles$
|
|
30149
|
+
style: styles$u.iconButton
|
|
30112
30150
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30113
30151
|
icon: caretDoubleDownIcon__default["default"],
|
|
30114
30152
|
size: "small",
|
|
30115
30153
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30116
30154
|
onClick: () => onMove("front"),
|
|
30117
|
-
style: styles$
|
|
30118
|
-
}))
|
|
30155
|
+
style: styles$u.iconButton
|
|
30156
|
+
}));
|
|
30119
30157
|
};
|
|
30120
|
-
const styles$
|
|
30158
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
30121
30159
|
container: {
|
|
30122
30160
|
width: "100%",
|
|
30123
30161
|
flexDirection: "row",
|
|
@@ -30164,7 +30202,7 @@ const LockedEllipseSettings = props => {
|
|
|
30164
30202
|
/*#__PURE__*/
|
|
30165
30203
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30166
30204
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30167
|
-
style: styles$
|
|
30205
|
+
style: styles$t.row
|
|
30168
30206
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30169
30207
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30170
30208
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30173,19 +30211,19 @@ const LockedEllipseSettings = props => {
|
|
|
30173
30211
|
strokeStyle: strokeStyle
|
|
30174
30212
|
}))
|
|
30175
30213
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30176
|
-
style: styles$
|
|
30214
|
+
style: styles$t.row
|
|
30177
30215
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30178
30216
|
coord: center,
|
|
30179
|
-
style: styles$
|
|
30217
|
+
style: styles$t.spaceUnder,
|
|
30180
30218
|
onChange: newCoords => onChangeProps({
|
|
30181
30219
|
center: newCoords
|
|
30182
30220
|
})
|
|
30183
30221
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30184
|
-
style: styles$
|
|
30222
|
+
style: styles$t.spaceUnder
|
|
30185
30223
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30186
30224
|
coord: radius,
|
|
30187
30225
|
labels: ["x radius", "y radius"],
|
|
30188
|
-
style: styles$
|
|
30226
|
+
style: styles$t.spaceUnder,
|
|
30189
30227
|
onChange: newCoords => onChangeProps({
|
|
30190
30228
|
radius: newCoords
|
|
30191
30229
|
})
|
|
@@ -30197,7 +30235,7 @@ const LockedEllipseSettings = props => {
|
|
|
30197
30235
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30198
30236
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30199
30237
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30200
|
-
style: [styles$
|
|
30238
|
+
style: [styles$t.row, styles$t.spaceUnder]
|
|
30201
30239
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30202
30240
|
selectedValue: color,
|
|
30203
30241
|
onChange: handleColorChange
|
|
@@ -30205,7 +30243,7 @@ const LockedEllipseSettings = props => {
|
|
|
30205
30243
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30206
30244
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30207
30245
|
tag: "label",
|
|
30208
|
-
style: styles$
|
|
30246
|
+
style: styles$t.row
|
|
30209
30247
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30210
30248
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30211
30249
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30222,7 +30260,7 @@ const LockedEllipseSettings = props => {
|
|
|
30222
30260
|
label: option
|
|
30223
30261
|
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30224
30262
|
tag: "label",
|
|
30225
|
-
style: styles$
|
|
30263
|
+
style: styles$t.row
|
|
30226
30264
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30227
30265
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30228
30266
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30240,13 +30278,12 @@ const LockedEllipseSettings = props => {
|
|
|
30240
30278
|
value: "dashed",
|
|
30241
30279
|
label: "dashed"
|
|
30242
30280
|
}))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30243
|
-
showM2Features: props.showM2Features,
|
|
30244
30281
|
figureType: props.type,
|
|
30245
30282
|
onMove: onMove,
|
|
30246
30283
|
onRemove: onRemove
|
|
30247
30284
|
}));
|
|
30248
30285
|
};
|
|
30249
|
-
const styles$
|
|
30286
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
30250
30287
|
row: {
|
|
30251
30288
|
display: "flex",
|
|
30252
30289
|
flexDirection: "row",
|
|
@@ -30267,7 +30304,7 @@ const LabeledSwitch = props => {
|
|
|
30267
30304
|
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30268
30305
|
const switchId = ids.get("switch");
|
|
30269
30306
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30270
|
-
style: [styles$
|
|
30307
|
+
style: [styles$s.row, style]
|
|
30271
30308
|
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30272
30309
|
id: switchId,
|
|
30273
30310
|
checked: checked,
|
|
@@ -30279,7 +30316,7 @@ const LabeledSwitch = props => {
|
|
|
30279
30316
|
htmlFor: switchId
|
|
30280
30317
|
}, label));
|
|
30281
30318
|
};
|
|
30282
|
-
const styles$
|
|
30319
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
30283
30320
|
row: {
|
|
30284
30321
|
flexDirection: "row",
|
|
30285
30322
|
alignItems: "center"
|
|
@@ -30313,13 +30350,13 @@ const DefiningPointSettings = props => {
|
|
|
30313
30350
|
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30314
30351
|
expanded: expanded,
|
|
30315
30352
|
onToggle: onToggle,
|
|
30316
|
-
containerStyle: styles$
|
|
30317
|
-
panelStyle: styles$
|
|
30353
|
+
containerStyle: styles$r.container,
|
|
30354
|
+
panelStyle: styles$r.accordionPanel,
|
|
30318
30355
|
header:
|
|
30319
30356
|
/*#__PURE__*/
|
|
30320
30357
|
// Summary: Point, coords, color (filled/open)
|
|
30321
30358
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30322
|
-
style: styles$
|
|
30359
|
+
style: styles$r.row
|
|
30323
30360
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30324
30361
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30325
30362
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30329,7 +30366,7 @@ const DefiningPointSettings = props => {
|
|
|
30329
30366
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30330
30367
|
coord: coord,
|
|
30331
30368
|
error: !!error,
|
|
30332
|
-
style: styles$
|
|
30369
|
+
style: styles$r.spaceUnder,
|
|
30333
30370
|
onChange: newCoords => {
|
|
30334
30371
|
onChangeProps({
|
|
30335
30372
|
coord: newCoords
|
|
@@ -30338,12 +30375,12 @@ const DefiningPointSettings = props => {
|
|
|
30338
30375
|
}), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30339
30376
|
label: "show point on graph",
|
|
30340
30377
|
checked: !!showPoint,
|
|
30341
|
-
style: showPoint && styles$
|
|
30378
|
+
style: showPoint && styles$r.spaceUnder,
|
|
30342
30379
|
onChange: onTogglePoint
|
|
30343
30380
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30344
30381
|
selectedValue: pointColor,
|
|
30345
30382
|
onChange: handleColorChange,
|
|
30346
|
-
style: styles$
|
|
30383
|
+
style: styles$r.spaceUnder
|
|
30347
30384
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30348
30385
|
label: "open point",
|
|
30349
30386
|
checked: !filled,
|
|
@@ -30354,7 +30391,7 @@ const DefiningPointSettings = props => {
|
|
|
30354
30391
|
}
|
|
30355
30392
|
})));
|
|
30356
30393
|
};
|
|
30357
|
-
const styles$
|
|
30394
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
30358
30395
|
container: {
|
|
30359
30396
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30360
30397
|
marginBottom: 0,
|
|
@@ -30381,15 +30418,15 @@ const LineSwatch = props => {
|
|
|
30381
30418
|
lineStyle
|
|
30382
30419
|
} = props;
|
|
30383
30420
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30384
|
-
style: styles$
|
|
30421
|
+
style: styles$q.container
|
|
30385
30422
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30386
30423
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30387
|
-
style: [styles$
|
|
30424
|
+
style: [styles$q.lineSwatch, {
|
|
30388
30425
|
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30389
30426
|
}]
|
|
30390
30427
|
}));
|
|
30391
30428
|
};
|
|
30392
|
-
const styles$
|
|
30429
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30393
30430
|
container: {
|
|
30394
30431
|
backgroundColor: wonderBlocksTokens.color.white,
|
|
30395
30432
|
justifyContent: "center",
|
|
@@ -30448,7 +30485,7 @@ const LockedLineSettings = props => {
|
|
|
30448
30485
|
expanded: props.expanded,
|
|
30449
30486
|
onToggle: props.onToggle,
|
|
30450
30487
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30451
|
-
style: styles$
|
|
30488
|
+
style: styles$p.row
|
|
30452
30489
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30453
30490
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30454
30491
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30457,7 +30494,7 @@ const LockedLineSettings = props => {
|
|
|
30457
30494
|
}))
|
|
30458
30495
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30459
30496
|
tag: "label",
|
|
30460
|
-
style: [styles$
|
|
30497
|
+
style: [styles$p.row, styles$p.spaceUnder]
|
|
30461
30498
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30462
30499
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30463
30500
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30478,7 +30515,7 @@ const LockedLineSettings = props => {
|
|
|
30478
30515
|
value: "segment",
|
|
30479
30516
|
label: "segment"
|
|
30480
30517
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30481
|
-
style: styles$
|
|
30518
|
+
style: styles$p.row
|
|
30482
30519
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30483
30520
|
selectedValue: lineColor,
|
|
30484
30521
|
onChange: handleColorChange
|
|
@@ -30486,7 +30523,7 @@ const LockedLineSettings = props => {
|
|
|
30486
30523
|
size: wonderBlocksTokens.spacing.small_12
|
|
30487
30524
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30488
30525
|
tag: "label",
|
|
30489
|
-
style: styles$
|
|
30526
|
+
style: styles$p.row
|
|
30490
30527
|
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30491
30528
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30492
30529
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30497,7 +30534,7 @@ const LockedLineSettings = props => {
|
|
|
30497
30534
|
// Placeholder is required, but never gets used.
|
|
30498
30535
|
,
|
|
30499
30536
|
placeholder: "",
|
|
30500
|
-
style: styles$
|
|
30537
|
+
style: styles$p.selectMarginOffset
|
|
30501
30538
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30502
30539
|
value: "solid",
|
|
30503
30540
|
label: "solid"
|
|
@@ -30505,7 +30542,7 @@ const LockedLineSettings = props => {
|
|
|
30505
30542
|
value: "dashed",
|
|
30506
30543
|
label: "dashed"
|
|
30507
30544
|
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30508
|
-
style: styles$
|
|
30545
|
+
style: styles$p.errorText
|
|
30509
30546
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30510
30547
|
label: "Point 1",
|
|
30511
30548
|
showPoint: showPoint1,
|
|
@@ -30525,13 +30562,12 @@ const LockedLineSettings = props => {
|
|
|
30525
30562
|
}),
|
|
30526
30563
|
onChangeProps: newProps => handleChangePoint(newProps, 1)
|
|
30527
30564
|
})), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30528
|
-
showM2Features: props.showM2Features,
|
|
30529
30565
|
figureType: props.type,
|
|
30530
30566
|
onMove: onMove,
|
|
30531
30567
|
onRemove: onRemove
|
|
30532
30568
|
}));
|
|
30533
30569
|
};
|
|
30534
|
-
const styles$
|
|
30570
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30535
30571
|
row: {
|
|
30536
30572
|
display: "flex",
|
|
30537
30573
|
flexDirection: "row",
|
|
@@ -30576,7 +30612,7 @@ const LockedPointSettings = props => {
|
|
|
30576
30612
|
/*#__PURE__*/
|
|
30577
30613
|
// Summary: Point, coords, color (filled/open)
|
|
30578
30614
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30579
|
-
style: styles$
|
|
30615
|
+
style: styles$o.row
|
|
30580
30616
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30581
30617
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30582
30618
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30585,7 +30621,7 @@ const LockedPointSettings = props => {
|
|
|
30585
30621
|
}))
|
|
30586
30622
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30587
30623
|
coord: coord,
|
|
30588
|
-
style: styles$
|
|
30624
|
+
style: styles$o.spaceUnder,
|
|
30589
30625
|
onChange: newCoord => {
|
|
30590
30626
|
onChangeProps({
|
|
30591
30627
|
coord: newCoord
|
|
@@ -30594,7 +30630,7 @@ const LockedPointSettings = props => {
|
|
|
30594
30630
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30595
30631
|
selectedValue: pointColor,
|
|
30596
30632
|
onChange: handleColorChange,
|
|
30597
|
-
style: styles$
|
|
30633
|
+
style: styles$o.spaceUnder
|
|
30598
30634
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30599
30635
|
label: "open point",
|
|
30600
30636
|
checked: !filled,
|
|
@@ -30604,13 +30640,12 @@ const LockedPointSettings = props => {
|
|
|
30604
30640
|
});
|
|
30605
30641
|
}
|
|
30606
30642
|
}), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30607
|
-
showM2Features: props.showM2Features,
|
|
30608
30643
|
figureType: props.type,
|
|
30609
30644
|
onMove: onMove,
|
|
30610
30645
|
onRemove: onRemove
|
|
30611
30646
|
}));
|
|
30612
30647
|
};
|
|
30613
|
-
const styles$
|
|
30648
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30614
30649
|
row: {
|
|
30615
30650
|
flexDirection: "row",
|
|
30616
30651
|
alignItems: "center"
|
|
@@ -30628,17 +30663,17 @@ const PolygonSwatch = props => {
|
|
|
30628
30663
|
} = props;
|
|
30629
30664
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30630
30665
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30631
|
-
style: [styles$
|
|
30666
|
+
style: [styles$n.container, {
|
|
30632
30667
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30633
30668
|
}]
|
|
30634
30669
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30635
|
-
style: [styles$
|
|
30670
|
+
style: [styles$n.innerSquare, {
|
|
30636
30671
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30637
30672
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30638
30673
|
}]
|
|
30639
30674
|
}));
|
|
30640
30675
|
};
|
|
30641
|
-
const styles$
|
|
30676
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30642
30677
|
container: {
|
|
30643
30678
|
// Add a white outline so that the color swatch is visible when
|
|
30644
30679
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30680,7 +30715,7 @@ const LockedPolygonSettings = props => {
|
|
|
30680
30715
|
/*#__PURE__*/
|
|
30681
30716
|
// Summary: Polygon, number of sides, style swatch
|
|
30682
30717
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30683
|
-
style: styles$
|
|
30718
|
+
style: styles$m.row
|
|
30684
30719
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30685
30720
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30686
30721
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30689,7 +30724,7 @@ const LockedPolygonSettings = props => {
|
|
|
30689
30724
|
strokeStyle: strokeStyle
|
|
30690
30725
|
}))
|
|
30691
30726
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30692
|
-
style: [styles$
|
|
30727
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30693
30728
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30694
30729
|
selectedValue: color,
|
|
30695
30730
|
onChange: handleColorChange
|
|
@@ -30697,7 +30732,7 @@ const LockedPolygonSettings = props => {
|
|
|
30697
30732
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30698
30733
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30699
30734
|
tag: "label",
|
|
30700
|
-
style: styles$
|
|
30735
|
+
style: styles$m.row
|
|
30701
30736
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30702
30737
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30703
30738
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30714,7 +30749,7 @@ const LockedPolygonSettings = props => {
|
|
|
30714
30749
|
label: option
|
|
30715
30750
|
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30716
30751
|
tag: "label",
|
|
30717
|
-
style: [styles$
|
|
30752
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30718
30753
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30719
30754
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30720
30755
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30737,17 +30772,17 @@ const LockedPolygonSettings = props => {
|
|
|
30737
30772
|
onChange: newValue => onChangeProps({
|
|
30738
30773
|
showVertices: newValue
|
|
30739
30774
|
}),
|
|
30740
|
-
style: styles$
|
|
30775
|
+
style: styles$m.spaceUnder
|
|
30741
30776
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30742
30777
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30743
30778
|
expanded: true,
|
|
30744
|
-
containerStyle: styles$
|
|
30745
|
-
panelStyle: styles$
|
|
30779
|
+
containerStyle: styles$m.pointAccordionContainer,
|
|
30780
|
+
panelStyle: styles$m.pointAccordionPanel
|
|
30746
30781
|
}, points.map((point, index) => {
|
|
30747
30782
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30748
30783
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30749
30784
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30750
|
-
style: [styles$
|
|
30785
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30751
30786
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30752
30787
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30753
30788
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30775,7 +30810,7 @@ const LockedPolygonSettings = props => {
|
|
|
30775
30810
|
points: newPoints
|
|
30776
30811
|
});
|
|
30777
30812
|
},
|
|
30778
|
-
style: styles$
|
|
30813
|
+
style: styles$m.icon
|
|
30779
30814
|
}));
|
|
30780
30815
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30781
30816
|
kind: "tertiary",
|
|
@@ -30786,13 +30821,12 @@ const LockedPolygonSettings = props => {
|
|
|
30786
30821
|
});
|
|
30787
30822
|
}
|
|
30788
30823
|
}, "Add point")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30789
|
-
showM2Features: props.showM2Features,
|
|
30790
30824
|
figureType: props.type,
|
|
30791
30825
|
onMove: onMove,
|
|
30792
30826
|
onRemove: onRemove
|
|
30793
30827
|
}));
|
|
30794
30828
|
};
|
|
30795
|
-
const styles$
|
|
30829
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30796
30830
|
row: {
|
|
30797
30831
|
display: "flex",
|
|
30798
30832
|
flexDirection: "row",
|
|
@@ -30850,7 +30884,7 @@ const LockedVectorSettings = props => {
|
|
|
30850
30884
|
expanded: props.expanded,
|
|
30851
30885
|
onToggle: props.onToggle,
|
|
30852
30886
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30853
|
-
style: styles$
|
|
30887
|
+
style: styles$l.row
|
|
30854
30888
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30855
30889
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30856
30890
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30858,19 +30892,19 @@ const LockedVectorSettings = props => {
|
|
|
30858
30892
|
lineStyle: "solid"
|
|
30859
30893
|
}))
|
|
30860
30894
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30861
|
-
style: [styles$
|
|
30895
|
+
style: [styles$l.row, styles$l.spaceUnder]
|
|
30862
30896
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30863
30897
|
selectedValue: lineColor,
|
|
30864
30898
|
onChange: handleColorChange
|
|
30865
30899
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30866
|
-
style: styles$
|
|
30900
|
+
style: styles$l.errorText
|
|
30867
30901
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30868
30902
|
expanded: true // Initial state is expanded
|
|
30869
30903
|
,
|
|
30870
|
-
containerStyle: styles$
|
|
30871
|
-
panelStyle: styles$
|
|
30904
|
+
containerStyle: styles$l.container,
|
|
30905
|
+
panelStyle: styles$l.accordionPanel,
|
|
30872
30906
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30873
|
-
style: styles$
|
|
30907
|
+
style: styles$l.row
|
|
30874
30908
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30875
30909
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30876
30910
|
coord: tail,
|
|
@@ -30881,10 +30915,10 @@ const LockedVectorSettings = props => {
|
|
|
30881
30915
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30882
30916
|
expanded: true // Initial state is expanded
|
|
30883
30917
|
,
|
|
30884
|
-
containerStyle: styles$
|
|
30885
|
-
panelStyle: styles$
|
|
30918
|
+
containerStyle: styles$l.container,
|
|
30919
|
+
panelStyle: styles$l.accordionPanel,
|
|
30886
30920
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30887
|
-
style: styles$
|
|
30921
|
+
style: styles$l.row
|
|
30888
30922
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30889
30923
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30890
30924
|
coord: tip,
|
|
@@ -30893,13 +30927,12 @@ const LockedVectorSettings = props => {
|
|
|
30893
30927
|
handleChangePoint(newProps, 1);
|
|
30894
30928
|
}
|
|
30895
30929
|
})), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30896
|
-
showM2Features: props.showM2Features,
|
|
30897
30930
|
figureType: props.type,
|
|
30898
30931
|
onMove: onMove,
|
|
30899
30932
|
onRemove: onRemove
|
|
30900
30933
|
}));
|
|
30901
30934
|
};
|
|
30902
|
-
const styles$
|
|
30935
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
30903
30936
|
accordionPanel: {
|
|
30904
30937
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30905
30938
|
},
|
|
@@ -30936,19 +30969,11 @@ const LockedFigureSettings = props => {
|
|
|
30936
30969
|
case "line":
|
|
30937
30970
|
return /*#__PURE__*/React__namespace.createElement(LockedLineSettings, props);
|
|
30938
30971
|
case "vector":
|
|
30939
|
-
|
|
30940
|
-
return /*#__PURE__*/React__namespace.createElement(LockedVectorSettings, props);
|
|
30941
|
-
}
|
|
30942
|
-
break;
|
|
30972
|
+
return /*#__PURE__*/React__namespace.createElement(LockedVectorSettings, props);
|
|
30943
30973
|
case "ellipse":
|
|
30944
|
-
|
|
30945
|
-
return /*#__PURE__*/React__namespace.createElement(LockedEllipseSettings, props);
|
|
30946
|
-
}
|
|
30947
|
-
break;
|
|
30974
|
+
return /*#__PURE__*/React__namespace.createElement(LockedEllipseSettings, props);
|
|
30948
30975
|
case "polygon":
|
|
30949
|
-
|
|
30950
|
-
return /*#__PURE__*/React__namespace.createElement(LockedPolygonSettings, props);
|
|
30951
|
-
}
|
|
30976
|
+
return /*#__PURE__*/React__namespace.createElement(LockedPolygonSettings, props);
|
|
30952
30977
|
}
|
|
30953
30978
|
return null;
|
|
30954
30979
|
};
|
|
@@ -31062,7 +31087,6 @@ const LockedFiguresSection = props => {
|
|
|
31062
31087
|
}
|
|
31063
31088
|
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
31064
31089
|
key: `${uniqueId}-locked-${figure}-${index}`,
|
|
31065
|
-
showM2Features: props.showM2Features,
|
|
31066
31090
|
showM2bFeatures: props.showM2bFeatures,
|
|
31067
31091
|
expanded: expandedStates[index],
|
|
31068
31092
|
onToggle: newValue => {
|
|
@@ -31076,9 +31100,8 @@ const LockedFiguresSection = props => {
|
|
|
31076
31100
|
onRemove: () => removeLockedFigure(index)
|
|
31077
31101
|
}));
|
|
31078
31102
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31079
|
-
style: styles$
|
|
31103
|
+
style: styles$k.buttonContainer
|
|
31080
31104
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31081
|
-
showM2Features: props.showM2Features,
|
|
31082
31105
|
showM2bFeatures: props.showM2bFeatures,
|
|
31083
31106
|
id: `${uniqueId}-select`,
|
|
31084
31107
|
onChange: addLockedFigure
|
|
@@ -31087,10 +31110,10 @@ const LockedFiguresSection = props => {
|
|
|
31087
31110
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31088
31111
|
kind: "secondary",
|
|
31089
31112
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31090
|
-
style: styles$
|
|
31113
|
+
style: styles$k.button
|
|
31091
31114
|
}, buttonLabel))));
|
|
31092
31115
|
};
|
|
31093
|
-
const styles$
|
|
31116
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
31094
31117
|
buttonContainer: {
|
|
31095
31118
|
flexDirection: "row",
|
|
31096
31119
|
alignItems: "center"
|
|
@@ -31126,7 +31149,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31126
31149
|
// Never uses placeholder, always has value
|
|
31127
31150
|
,
|
|
31128
31151
|
placeholder: "",
|
|
31129
|
-
style: styles$
|
|
31152
|
+
style: styles$j.singleSelectShort
|
|
31130
31153
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31131
31154
|
key: n,
|
|
31132
31155
|
value: `${n}`,
|
|
@@ -31137,7 +31160,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31137
31160
|
label: "unlimited"
|
|
31138
31161
|
})]);
|
|
31139
31162
|
};
|
|
31140
|
-
const styles$
|
|
31163
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
31141
31164
|
singleSelectShort: {
|
|
31142
31165
|
// Non-standard spacing, but it's the smallest we can go
|
|
31143
31166
|
// without running into styling issues with the dropdown.
|
|
@@ -31150,7 +31173,7 @@ const GraphTypeSelector = props => {
|
|
|
31150
31173
|
selectedValue: props.graphType,
|
|
31151
31174
|
onChange: props.onChange,
|
|
31152
31175
|
placeholder: "Select a graph type",
|
|
31153
|
-
style: styles$
|
|
31176
|
+
style: styles$i.singleSelectShort
|
|
31154
31177
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31155
31178
|
value: "linear",
|
|
31156
31179
|
label: "Linear function"
|
|
@@ -31183,7 +31206,7 @@ const GraphTypeSelector = props => {
|
|
|
31183
31206
|
label: "Angle"
|
|
31184
31207
|
}));
|
|
31185
31208
|
};
|
|
31186
|
-
const styles$
|
|
31209
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
31187
31210
|
singleSelectShort: {
|
|
31188
31211
|
// Non-standard spacing, but it's the smallest we can go
|
|
31189
31212
|
// without running into styling issues with the dropdown.
|
|
@@ -31612,10 +31635,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31612
31635
|
onChange: this.change
|
|
31613
31636
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31614
31637
|
label: "Background image URL:",
|
|
31615
|
-
style: styles$
|
|
31638
|
+
style: styles$h.resetSpaceTop
|
|
31616
31639
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31617
31640
|
type: "text",
|
|
31618
|
-
className: aphrodite.css(styles$
|
|
31641
|
+
className: aphrodite.css(styles$h.backgroundUrlInput),
|
|
31619
31642
|
ref: this.bgUrlRef,
|
|
31620
31643
|
value: this.state.backgroundImage.url || "",
|
|
31621
31644
|
onChange: e => {
|
|
@@ -31631,14 +31654,14 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31631
31654
|
onKeyPress: this.changeBackgroundUrl,
|
|
31632
31655
|
onBlur: this.changeBackgroundUrl
|
|
31633
31656
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31634
|
-
style: styles$
|
|
31657
|
+
style: styles$h.protractorSection
|
|
31635
31658
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31636
|
-
style: styles$
|
|
31659
|
+
style: styles$h.checkboxRow
|
|
31637
31660
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31638
31661
|
label: "Show protractor",
|
|
31639
31662
|
showProtractor: this.props.showProtractor,
|
|
31640
31663
|
onChange: this.change,
|
|
31641
|
-
style: styles$
|
|
31664
|
+
style: styles$h.resetSpaceTop
|
|
31642
31665
|
})), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31643
31666
|
layout: "floating",
|
|
31644
31667
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31646,7 +31669,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31646
31669
|
}))));
|
|
31647
31670
|
}
|
|
31648
31671
|
}
|
|
31649
|
-
const styles$
|
|
31672
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
31650
31673
|
resetSpaceTop: {
|
|
31651
31674
|
marginTop: 0
|
|
31652
31675
|
},
|
|
@@ -31685,14 +31708,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31685
31708
|
const num = +newValue;
|
|
31686
31709
|
onChange(num);
|
|
31687
31710
|
},
|
|
31688
|
-
style: styles$
|
|
31711
|
+
style: styles$g.singleSelectShort
|
|
31689
31712
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31690
31713
|
key: n,
|
|
31691
31714
|
value: `${n}`,
|
|
31692
31715
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31693
31716
|
})));
|
|
31694
31717
|
};
|
|
31695
|
-
const styles$
|
|
31718
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31696
31719
|
singleSelectShort: {
|
|
31697
31720
|
// Non-standard spacing, but it's the smallest we can go
|
|
31698
31721
|
// without running into styling issues with the dropdown.
|
|
@@ -31706,9 +31729,9 @@ const StartCoordsCircle = props => {
|
|
|
31706
31729
|
onChange
|
|
31707
31730
|
} = props;
|
|
31708
31731
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31709
|
-
style: styles$
|
|
31732
|
+
style: styles$f.tile
|
|
31710
31733
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31711
|
-
style: styles$
|
|
31734
|
+
style: styles$f.row
|
|
31712
31735
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Center:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31713
31736
|
size: wonderBlocksTokens.spacing.small_12
|
|
31714
31737
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31721,7 +31744,7 @@ const StartCoordsCircle = props => {
|
|
|
31721
31744
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31722
31745
|
size: wonderBlocksTokens.spacing.small_12
|
|
31723
31746
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31724
|
-
style: styles$
|
|
31747
|
+
style: styles$f.row
|
|
31725
31748
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Radius:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31726
31749
|
size: wonderBlocksTokens.spacing.small_12
|
|
31727
31750
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
@@ -31733,10 +31756,10 @@ const StartCoordsCircle = props => {
|
|
|
31733
31756
|
radius: parseFloat(value)
|
|
31734
31757
|
});
|
|
31735
31758
|
},
|
|
31736
|
-
style: styles$
|
|
31759
|
+
style: styles$f.textField
|
|
31737
31760
|
})));
|
|
31738
31761
|
};
|
|
31739
|
-
const styles$
|
|
31762
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31740
31763
|
tile: {
|
|
31741
31764
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31742
31765
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31758,7 +31781,7 @@ const StartCoordsLine = props => {
|
|
|
31758
31781
|
onChange
|
|
31759
31782
|
} = props;
|
|
31760
31783
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31761
|
-
style: styles$
|
|
31784
|
+
style: styles$e.tile
|
|
31762
31785
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31763
31786
|
size: wonderBlocksTokens.spacing.small_12
|
|
31764
31787
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31766,7 +31789,7 @@ const StartCoordsLine = props => {
|
|
|
31766
31789
|
labels: ["x", "y"],
|
|
31767
31790
|
onChange: value => onChange([value, startCoords[1]])
|
|
31768
31791
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31769
|
-
style: styles$
|
|
31792
|
+
style: styles$e.tile
|
|
31770
31793
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31771
31794
|
size: wonderBlocksTokens.spacing.small_12
|
|
31772
31795
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31775,7 +31798,7 @@ const StartCoordsLine = props => {
|
|
|
31775
31798
|
onChange: value => onChange([startCoords[0], value])
|
|
31776
31799
|
})));
|
|
31777
31800
|
};
|
|
31778
|
-
const styles$
|
|
31801
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31779
31802
|
tile: {
|
|
31780
31803
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31781
31804
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31798,7 +31821,7 @@ const StartCoordsMultiline = props => {
|
|
|
31798
31821
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31799
31822
|
expanded: true
|
|
31800
31823
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31801
|
-
style: styles$
|
|
31824
|
+
style: styles$d.nestedTile
|
|
31802
31825
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31803
31826
|
size: wonderBlocksTokens.spacing.small_12
|
|
31804
31827
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31810,7 +31833,7 @@ const StartCoordsMultiline = props => {
|
|
|
31810
31833
|
onChange(newCoords);
|
|
31811
31834
|
}
|
|
31812
31835
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31813
|
-
style: styles$
|
|
31836
|
+
style: styles$d.nestedTile
|
|
31814
31837
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31815
31838
|
size: wonderBlocksTokens.spacing.small_12
|
|
31816
31839
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31823,7 +31846,7 @@ const StartCoordsMultiline = props => {
|
|
|
31823
31846
|
}
|
|
31824
31847
|
})))));
|
|
31825
31848
|
};
|
|
31826
|
-
const styles$
|
|
31849
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
31827
31850
|
nestedTile: {
|
|
31828
31851
|
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
31829
31852
|
flexDirection: "row",
|
|
@@ -31831,6 +31854,112 @@ const styles$b = aphrodite.StyleSheet.create({
|
|
|
31831
31854
|
}
|
|
31832
31855
|
});
|
|
31833
31856
|
|
|
31857
|
+
const StartCoordsQuadratic = props => {
|
|
31858
|
+
const {
|
|
31859
|
+
startCoords,
|
|
31860
|
+
onChange
|
|
31861
|
+
} = props;
|
|
31862
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31863
|
+
style: styles$c.equationSection
|
|
31864
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Starting equation:"), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
31865
|
+
style: styles$c.equationBody
|
|
31866
|
+
}, getQuadraticEquation(startCoords))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31867
|
+
style: styles$c.tile
|
|
31868
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31869
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31870
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31871
|
+
coord: startCoords[0],
|
|
31872
|
+
labels: ["x", "y"],
|
|
31873
|
+
onChange: value => onChange([value, startCoords[1], startCoords[2]])
|
|
31874
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31875
|
+
style: styles$c.tile
|
|
31876
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31877
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31878
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31879
|
+
coord: startCoords[1],
|
|
31880
|
+
labels: ["x", "y"],
|
|
31881
|
+
onChange: value => onChange([startCoords[0], value, startCoords[2]])
|
|
31882
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31883
|
+
style: styles$c.tile
|
|
31884
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 3:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31885
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31886
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31887
|
+
coord: startCoords[2],
|
|
31888
|
+
labels: ["x", "y"],
|
|
31889
|
+
onChange: value => onChange([startCoords[0], startCoords[1], value])
|
|
31890
|
+
})));
|
|
31891
|
+
};
|
|
31892
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
31893
|
+
tile: {
|
|
31894
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31895
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31896
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
31897
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
31898
|
+
flexDirection: "row",
|
|
31899
|
+
alignItems: "center"
|
|
31900
|
+
},
|
|
31901
|
+
equationSection: {
|
|
31902
|
+
marginTop: wonderBlocksTokens.spacing.small_12
|
|
31903
|
+
},
|
|
31904
|
+
equationBody: {
|
|
31905
|
+
backgroundColor: wonderBlocksTokens.color.fadedOffBlack8,
|
|
31906
|
+
border: `1px solid ${wonderBlocksTokens.color.fadedOffBlack32}`,
|
|
31907
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31908
|
+
paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
|
|
31909
|
+
paddingRight: wonderBlocksTokens.spacing.xSmall_8,
|
|
31910
|
+
fontSize: wonderBlocksTokens.font.size.xSmall
|
|
31911
|
+
}
|
|
31912
|
+
});
|
|
31913
|
+
|
|
31914
|
+
const StartCoordsSinusoid = props => {
|
|
31915
|
+
const {
|
|
31916
|
+
startCoords,
|
|
31917
|
+
onChange
|
|
31918
|
+
} = props;
|
|
31919
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31920
|
+
style: styles$b.equationSection
|
|
31921
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Starting equation:"), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
31922
|
+
style: styles$b.equationBody
|
|
31923
|
+
}, getSinusoidEquation(startCoords))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31924
|
+
style: styles$b.tile
|
|
31925
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31926
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31927
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31928
|
+
coord: startCoords[0],
|
|
31929
|
+
labels: ["x", "y"],
|
|
31930
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31931
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31932
|
+
style: styles$b.tile
|
|
31933
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31934
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31935
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31936
|
+
coord: startCoords[1],
|
|
31937
|
+
labels: ["x", "y"],
|
|
31938
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31939
|
+
})));
|
|
31940
|
+
};
|
|
31941
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
31942
|
+
tile: {
|
|
31943
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31944
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31945
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
31946
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
31947
|
+
flexDirection: "row",
|
|
31948
|
+
alignItems: "center"
|
|
31949
|
+
},
|
|
31950
|
+
equationSection: {
|
|
31951
|
+
marginTop: wonderBlocksTokens.spacing.small_12
|
|
31952
|
+
},
|
|
31953
|
+
equationBody: {
|
|
31954
|
+
backgroundColor: wonderBlocksTokens.color.fadedOffBlack8,
|
|
31955
|
+
border: `1px solid ${wonderBlocksTokens.color.fadedOffBlack32}`,
|
|
31956
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31957
|
+
paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
|
|
31958
|
+
paddingRight: wonderBlocksTokens.spacing.xSmall_8,
|
|
31959
|
+
fontSize: wonderBlocksTokens.font.size.xSmall
|
|
31960
|
+
}
|
|
31961
|
+
});
|
|
31962
|
+
|
|
31834
31963
|
const StartCoordsSettingsInner = props => {
|
|
31835
31964
|
const {
|
|
31836
31965
|
type,
|
|
@@ -31871,6 +32000,18 @@ const StartCoordsSettingsInner = props => {
|
|
|
31871
32000
|
},
|
|
31872
32001
|
onChange: onChange
|
|
31873
32002
|
});
|
|
32003
|
+
case "sinusoid":
|
|
32004
|
+
const sinusoidCoords = perseus.getSinusoidCoords(props, range, step);
|
|
32005
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsSinusoid, {
|
|
32006
|
+
startCoords: sinusoidCoords,
|
|
32007
|
+
onChange: onChange
|
|
32008
|
+
});
|
|
32009
|
+
case "quadratic":
|
|
32010
|
+
const quadraticCoords = perseus.getQuadraticCoords(props, range, step);
|
|
32011
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsQuadratic, {
|
|
32012
|
+
startCoords: quadraticCoords,
|
|
32013
|
+
onChange: onChange
|
|
32014
|
+
});
|
|
31874
32015
|
default:
|
|
31875
32016
|
return null;
|
|
31876
32017
|
}
|
|
@@ -31925,6 +32066,10 @@ const POLYGON_SIDES = ___default["default"].map(___default["default"].range(3, 1
|
|
|
31925
32066
|
label: `${value} sides`
|
|
31926
32067
|
});
|
|
31927
32068
|
});
|
|
32069
|
+
|
|
32070
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32071
|
+
const startCoordsUiPhase1Types = ["linear", "linear-system", "ray", "segment", "circle"];
|
|
32072
|
+
const startCoordsUiPhase2Types = ["sinusoid", "quadratic"];
|
|
31928
32073
|
/**
|
|
31929
32074
|
* An editor for the InteractiveGraph widget, which allows the user to
|
|
31930
32075
|
* specify the graph's properties and the correct answer.
|
|
@@ -32018,6 +32163,9 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32018
32163
|
className: "perseus-error"
|
|
32019
32164
|
}, this.props.valid);
|
|
32020
32165
|
}
|
|
32166
|
+
const startCoordsPhase1 = this.props.apiOptions?.flags?.mafs?.["start-coords-ui-phase-1"];
|
|
32167
|
+
const startCoordsPhase2 = this.props.apiOptions?.flags?.mafs?.["start-coords-ui-phase-2"];
|
|
32168
|
+
const displayStartCoordsUI = this.props.graph && (startCoordsPhase1 && startCoordsUiPhase1Types.includes(this.props.graph.type) || startCoordsPhase2 && startCoordsUiPhase2Types.includes(this.props.graph.type));
|
|
32021
32169
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
32022
32170
|
label: "Type of Graph:"
|
|
32023
32171
|
}, /*#__PURE__*/React__namespace.createElement(GraphTypeSelector, {
|
|
@@ -32162,7 +32310,9 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32162
32310
|
}
|
|
32163
32311
|
});
|
|
32164
32312
|
}
|
|
32165
|
-
})), this.props.graph?.type &&
|
|
32313
|
+
})), this.props.graph?.type &&
|
|
32314
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32315
|
+
displayStartCoordsUI && /*#__PURE__*/React__namespace.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32166
32316
|
range: this.props.range,
|
|
32167
32317
|
step: this.props.step,
|
|
32168
32318
|
onChange: this.changeStartCoords
|
|
@@ -32219,7 +32369,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32219
32369
|
// Only show the "Add locked figure" dropdown if the graph
|
|
32220
32370
|
// is using Mafs.
|
|
32221
32371
|
this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
|
|
32222
|
-
showM2Features: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m2"],
|
|
32223
32372
|
showM2bFeatures: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m2b"],
|
|
32224
32373
|
figures: this.props.lockedFigures,
|
|
32225
32374
|
onChange: this.props.onChange
|