@khanacademy/perseus-editor 8.0.0 → 8.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/heading.d.ts +2 -1
- package/dist/components/interactive-graph-correct-answer.d.ts +7 -0
- package/dist/components/start-coord-settings.d.ts +9 -0
- package/dist/es/index.js +363 -233
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +356 -223
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +145 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ var Switch = require('@khanacademy/wonder-blocks-switch');
|
|
|
36
36
|
var minusCircle = require('@phosphor-icons/core/regular/minus-circle.svg');
|
|
37
37
|
var plusCircle = require('@phosphor-icons/core/regular/plus-circle.svg');
|
|
38
38
|
var Banner = require('@khanacademy/wonder-blocks-banner');
|
|
39
|
+
var arrowCounterClockwise = require('@phosphor-icons/core/bold/arrow-counter-clockwise-bold.svg');
|
|
39
40
|
|
|
40
41
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
41
42
|
|
|
@@ -78,10 +79,11 @@ var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
|
78
79
|
var minusCircle__default = /*#__PURE__*/_interopDefaultLegacy(minusCircle);
|
|
79
80
|
var plusCircle__default = /*#__PURE__*/_interopDefaultLegacy(plusCircle);
|
|
80
81
|
var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
|
|
82
|
+
var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCounterClockwise);
|
|
81
83
|
|
|
82
84
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
83
85
|
const libName = "@khanacademy/perseus-editor";
|
|
84
|
-
const libVersion = "8.
|
|
86
|
+
const libVersion = "8.2.0";
|
|
85
87
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
86
88
|
|
|
87
89
|
function _extends() {
|
|
@@ -276,13 +278,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
276
278
|
role: "button",
|
|
277
279
|
hideDefaultFocusRing: true,
|
|
278
280
|
"aria-label": title,
|
|
279
|
-
style: styles$
|
|
281
|
+
style: styles$H.button
|
|
280
282
|
}, _ref => {
|
|
281
283
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
|
|
282
284
|
});
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
|
-
const styles$
|
|
287
|
+
const styles$H = aphrodite.StyleSheet.create({
|
|
286
288
|
button: {
|
|
287
289
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
288
290
|
margin: 2,
|
|
@@ -20787,13 +20789,13 @@ class WidgetSelect extends React__namespace.Component {
|
|
|
20787
20789
|
* that collapse a region.
|
|
20788
20790
|
*/
|
|
20789
20791
|
function ToggleableCaret(props) {
|
|
20790
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20792
|
+
const iconStyle = props.isExpanded ? styles$G.expanded : styles$G.collapsed;
|
|
20791
20793
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20792
20794
|
icon: caretRight__default["default"],
|
|
20793
20795
|
style: iconStyle
|
|
20794
20796
|
});
|
|
20795
20797
|
}
|
|
20796
|
-
const styles$
|
|
20798
|
+
const styles$G = aphrodite.StyleSheet.create({
|
|
20797
20799
|
collapsed: {
|
|
20798
20800
|
transition: ".15s"
|
|
20799
20801
|
},
|
|
@@ -20823,16 +20825,16 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20823
20825
|
showErrors
|
|
20824
20826
|
} = this.state;
|
|
20825
20827
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20826
|
-
style: styles$
|
|
20828
|
+
style: styles$F.errorContainer
|
|
20827
20829
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20828
|
-
style: styles$
|
|
20830
|
+
style: styles$F.title,
|
|
20829
20831
|
onClick: this.handleToggleTexErrors
|
|
20830
20832
|
}, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
20831
20833
|
isExpanded: showErrors
|
|
20832
20834
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20833
|
-
style: styles$
|
|
20835
|
+
style: styles$F.errorExplanation
|
|
20834
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, {
|
|
20835
|
-
style: styles$
|
|
20837
|
+
style: styles$F.error,
|
|
20836
20838
|
key: index
|
|
20837
20839
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20838
20840
|
style: {
|
|
@@ -20841,7 +20843,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20841
20843
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20842
20844
|
}
|
|
20843
20845
|
}
|
|
20844
|
-
const styles$
|
|
20846
|
+
const styles$F = aphrodite.StyleSheet.create({
|
|
20845
20847
|
title: {
|
|
20846
20848
|
backgroundColor: "#eee",
|
|
20847
20849
|
fontSize: "1.25em",
|
|
@@ -24591,12 +24593,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24591
24593
|
...otherProps
|
|
24592
24594
|
} = this.props;
|
|
24593
24595
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24594
|
-
className: aphrodite.css(styles$
|
|
24596
|
+
className: aphrodite.css(styles$E.baseButton, color === "green" && styles$E.green, color === "orange" && styles$E.orange),
|
|
24595
24597
|
onClick: onClick
|
|
24596
24598
|
}, otherProps), children);
|
|
24597
24599
|
}
|
|
24598
24600
|
}
|
|
24599
|
-
const styles$
|
|
24601
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
24600
24602
|
baseButton: {
|
|
24601
24603
|
top: "0",
|
|
24602
24604
|
fontSize: "11px",
|
|
@@ -24809,23 +24811,23 @@ const LeafContainer = _ref2 => {
|
|
|
24809
24811
|
} = _ref2;
|
|
24810
24812
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24811
24813
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24812
|
-
className: aphrodite.css(styles$
|
|
24814
|
+
className: aphrodite.css(styles$D.containerHeader)
|
|
24813
24815
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24814
24816
|
depth: path.length,
|
|
24815
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$D.containerTitle)
|
|
24816
24818
|
}, capitalize(name)));
|
|
24817
24819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24818
|
-
className: aphrodite.css(styles$
|
|
24820
|
+
className: aphrodite.css(styles$D.container)
|
|
24819
24821
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24820
|
-
className: aphrodite.css(styles$
|
|
24822
|
+
className: aphrodite.css(styles$D.row, styles$D.rowHeading)
|
|
24821
24823
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24822
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
24823
24825
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24824
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24826
|
+
className: "pod-title " + aphrodite.css(styles$D.containerHeader)
|
|
24825
24827
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24826
|
-
className: aphrodite.css(styles$
|
|
24828
|
+
className: aphrodite.css(styles$D.containerTitle)
|
|
24827
24829
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24828
|
-
className: aphrodite.css(styles$
|
|
24830
|
+
className: aphrodite.css(styles$D.columnRight)
|
|
24829
24831
|
}, previewHeading)), children);
|
|
24830
24832
|
};
|
|
24831
24833
|
const ArrayContainer = props => {
|
|
@@ -24838,11 +24840,11 @@ const ArrayContainer = props => {
|
|
|
24838
24840
|
actions
|
|
24839
24841
|
} = props;
|
|
24840
24842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24841
|
-
className: aphrodite.css(styles$
|
|
24843
|
+
className: aphrodite.css(styles$D.container)
|
|
24842
24844
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24843
|
-
className: aphrodite.css(styles$
|
|
24845
|
+
className: aphrodite.css(styles$D.columnLeft, styles$D.containerHeader)
|
|
24844
24846
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24845
|
-
className: aphrodite.css(styles$
|
|
24847
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
24846
24848
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24847
24849
|
href: "javascript:void 0",
|
|
24848
24850
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24856,28 +24858,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24856
24858
|
path
|
|
24857
24859
|
} = _ref3;
|
|
24858
24860
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24859
|
-
className: aphrodite.css(styles$
|
|
24861
|
+
className: aphrodite.css(styles$D.containerHeader)
|
|
24860
24862
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24861
24863
|
depth: path.length,
|
|
24862
|
-
className: aphrodite.css(styles$
|
|
24864
|
+
className: aphrodite.css(styles$D.containerTitle)
|
|
24863
24865
|
}, capitalize(name)), controls);
|
|
24864
24866
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24865
|
-
className: aphrodite.css(styles$
|
|
24867
|
+
className: aphrodite.css(styles$D.containerHeader, styles$D.previewCollectionHeader)
|
|
24866
24868
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24867
24869
|
depth: path.length,
|
|
24868
|
-
className: aphrodite.css(styles$
|
|
24870
|
+
className: aphrodite.css(styles$D.containerTitle)
|
|
24869
24871
|
}, capitalize(name)));
|
|
24870
24872
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24871
24873
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24872
|
-
className: aphrodite.css(styles$
|
|
24874
|
+
className: aphrodite.css(styles$D.container)
|
|
24873
24875
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24874
|
-
className: aphrodite.css(styles$
|
|
24876
|
+
className: aphrodite.css(styles$D.row)
|
|
24875
24877
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24876
|
-
className: aphrodite.css(styles$
|
|
24878
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
24877
24879
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24878
|
-
className: aphrodite.css(styles$
|
|
24880
|
+
className: aphrodite.css(styles$D.columnRight)
|
|
24879
24881
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24880
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24882
|
+
className: aphrodite.css(path.length > 0 && styles$D.contentIndent)
|
|
24881
24883
|
}, children));
|
|
24882
24884
|
};
|
|
24883
24885
|
|
|
@@ -24997,11 +24999,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24997
24999
|
className: "framework-perseus"
|
|
24998
25000
|
}, lens(renderers).get(path));
|
|
24999
25001
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25000
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$D.row)
|
|
25001
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
25003
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$D.sticky)
|
|
25005
25007
|
},
|
|
25006
25008
|
/*#__PURE__*/
|
|
25007
25009
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25009,9 +25011,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25009
25011
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25010
25012
|
apiOptions: apiOptions
|
|
25011
25013
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25012
|
-
className: aphrodite.css(styles$
|
|
25014
|
+
className: aphrodite.css(styles$D.columnRight)
|
|
25013
25015
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25014
|
-
className: aphrodite.css(sticky && styles$
|
|
25016
|
+
className: aphrodite.css(sticky && styles$D.sticky)
|
|
25015
25017
|
}, preview))));
|
|
25016
25018
|
});
|
|
25017
25019
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25027,13 +25029,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25027
25029
|
className: "framework-perseus"
|
|
25028
25030
|
}, lens(renderers).get(path));
|
|
25029
25031
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25030
|
-
className: aphrodite.css(styles$
|
|
25032
|
+
className: aphrodite.css(styles$D.row)
|
|
25031
25033
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25032
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
25033
25035
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25034
|
-
className: aphrodite.css(sticky && styles$
|
|
25036
|
+
className: aphrodite.css(sticky && styles$D.sticky)
|
|
25035
25037
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25036
|
-
className: aphrodite.css(styles$
|
|
25038
|
+
className: aphrodite.css(styles$D.hintEditor),
|
|
25037
25039
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25038
25040
|
apiOptions: apiOptions,
|
|
25039
25041
|
showTitle: false,
|
|
@@ -25048,9 +25050,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25048
25050
|
isFirst: true,
|
|
25049
25051
|
isLast: true
|
|
25050
25052
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25051
|
-
className: aphrodite.css(styles$
|
|
25053
|
+
className: aphrodite.css(styles$D.columnRight)
|
|
25052
25054
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: aphrodite.css(sticky && styles$
|
|
25055
|
+
className: aphrodite.css(sticky && styles$D.sticky)
|
|
25054
25056
|
}, preview)));
|
|
25055
25057
|
});
|
|
25056
25058
|
const TagsNodeContent = props => {
|
|
@@ -25067,9 +25069,9 @@ const TagsNodeContent = props => {
|
|
|
25067
25069
|
return null;
|
|
25068
25070
|
}
|
|
25069
25071
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25070
|
-
className: aphrodite.css(styles$
|
|
25072
|
+
className: aphrodite.css(styles$D.columnLeft)
|
|
25071
25073
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25074
|
+
className: aphrodite.css(styles$D.tagsEditor)
|
|
25073
25075
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25074
25076
|
value: data,
|
|
25075
25077
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25100,23 +25102,23 @@ const ArrayNodeContent = props => {
|
|
|
25100
25102
|
const subpath = path.concat(i);
|
|
25101
25103
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25102
25104
|
key: "moveArrayElementUp",
|
|
25103
|
-
className: aphrodite.css(styles$
|
|
25105
|
+
className: aphrodite.css(styles$D.control)
|
|
25104
25106
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25105
25107
|
color: "orange",
|
|
25106
25108
|
title: "Move up",
|
|
25107
25109
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25108
25110
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25109
|
-
className: aphrodite.css(styles$
|
|
25111
|
+
className: aphrodite.css(styles$D.verticalFlip)
|
|
25110
25112
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25111
25113
|
key: "moveArrayElementDown",
|
|
25112
|
-
className: aphrodite.css(styles$
|
|
25114
|
+
className: aphrodite.css(styles$D.control)
|
|
25113
25115
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25114
25116
|
color: "orange",
|
|
25115
25117
|
title: "Move down",
|
|
25116
25118
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25117
25119
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25118
25120
|
key: "removeArrayElement",
|
|
25119
|
-
className: aphrodite.css(styles$
|
|
25121
|
+
className: aphrodite.css(styles$D.control)
|
|
25120
25122
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25121
25123
|
color: "orange",
|
|
25122
25124
|
title: "Delete",
|
|
@@ -25124,7 +25126,7 @@ const ArrayNodeContent = props => {
|
|
|
25124
25126
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25125
25127
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25126
25128
|
key: i,
|
|
25127
|
-
className: aphrodite.css(styles$
|
|
25129
|
+
className: aphrodite.css(styles$D.arrayElement, !elementIsLeaf && styles$D.arrayElementAndNotLeaf)
|
|
25128
25130
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25129
25131
|
key: i,
|
|
25130
25132
|
shape: shape.elementShape,
|
|
@@ -25150,7 +25152,7 @@ const ObjectNodeContent = props => {
|
|
|
25150
25152
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25151
25153
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25152
25154
|
key: subkey,
|
|
25153
|
-
className: aphrodite.css(styles$
|
|
25155
|
+
className: aphrodite.css(styles$D.objectElement)
|
|
25154
25156
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25155
25157
|
shape: shape.shape[subkey],
|
|
25156
25158
|
data: data[subkey],
|
|
@@ -25320,7 +25322,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25320
25322
|
}, this._renderContent());
|
|
25321
25323
|
}
|
|
25322
25324
|
}
|
|
25323
|
-
const styles$
|
|
25325
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
25324
25326
|
// This is used in a number of places throughout this file.
|
|
25325
25327
|
container: {},
|
|
25326
25328
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25472,47 +25474,47 @@ const StatefulArticleEditor = createReactClass__default["default"]({
|
|
|
25472
25474
|
screen
|
|
25473
25475
|
} = this.state;
|
|
25474
25476
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25475
|
-
style: styles$
|
|
25477
|
+
style: styles$C.controlBar
|
|
25476
25478
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25477
|
-
style: styles$
|
|
25479
|
+
style: styles$C.controls
|
|
25478
25480
|
}, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25479
25481
|
onClick: () => this.setState({
|
|
25480
25482
|
mode: "edit"
|
|
25481
25483
|
}),
|
|
25482
|
-
style: mode === "edit" ? styles$
|
|
25484
|
+
style: mode === "edit" ? styles$C.controlSelected : styles$C.control
|
|
25483
25485
|
}, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25484
25486
|
onClick: () => this.setState({
|
|
25485
25487
|
mode: "preview"
|
|
25486
25488
|
}),
|
|
25487
|
-
style: mode === "preview" ? styles$
|
|
25489
|
+
style: mode === "preview" ? styles$C.controlSelected : styles$C.control
|
|
25488
25490
|
}, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25489
25491
|
onClick: () => this.setState({
|
|
25490
25492
|
mode: "json"
|
|
25491
25493
|
}),
|
|
25492
|
-
style: mode === "json" ? styles$
|
|
25494
|
+
style: mode === "json" ? styles$C.controlSelected : styles$C.control
|
|
25493
25495
|
}, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25494
|
-
style: styles$
|
|
25496
|
+
style: styles$C.controls
|
|
25495
25497
|
}, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25496
25498
|
onClick: () => this.setState({
|
|
25497
25499
|
screen: "phone"
|
|
25498
25500
|
}),
|
|
25499
|
-
style: screen === "phone" ? styles$
|
|
25501
|
+
style: screen === "phone" ? styles$C.controlSelected : styles$C.control
|
|
25500
25502
|
}, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25501
25503
|
onClick: () => this.setState({
|
|
25502
25504
|
screen: "tablet"
|
|
25503
25505
|
}),
|
|
25504
|
-
style: screen === "tablet" ? styles$
|
|
25506
|
+
style: screen === "tablet" ? styles$C.controlSelected : styles$C.control
|
|
25505
25507
|
}, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25506
25508
|
onClick: () => this.setState({
|
|
25507
25509
|
screen: "desktop"
|
|
25508
25510
|
}),
|
|
25509
|
-
style: screen === "desktop" ? styles$
|
|
25511
|
+
style: screen === "desktop" ? styles$C.controlSelected : styles$C.control
|
|
25510
25512
|
}, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25511
|
-
style: styles$
|
|
25513
|
+
style: styles$C.editor
|
|
25512
25514
|
}, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
|
|
25513
25515
|
}
|
|
25514
25516
|
});
|
|
25515
|
-
const styles$
|
|
25517
|
+
const styles$C = {
|
|
25516
25518
|
controlBar: {
|
|
25517
25519
|
marginBottom: 25,
|
|
25518
25520
|
marginTop: 5
|
|
@@ -27051,10 +27053,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27051
27053
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27052
27054
|
className: "perseus-widget-row"
|
|
27053
27055
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
27054
|
-
className: aphrodite.css(styles$
|
|
27056
|
+
className: aphrodite.css(styles$B.title)
|
|
27055
27057
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
27056
27058
|
value: this.props.title,
|
|
27057
|
-
className: aphrodite.css(styles$
|
|
27059
|
+
className: aphrodite.css(styles$B.input)
|
|
27058
27060
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27059
27061
|
,
|
|
27060
27062
|
onChange: this.change("title")
|
|
@@ -27079,7 +27081,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27079
27081
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27080
27082
|
className: "perseus-hint-editor"
|
|
27081
27083
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27082
|
-
className: aphrodite.css(styles$
|
|
27084
|
+
className: aphrodite.css(styles$B.hintsTitle)
|
|
27083
27085
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
27084
27086
|
ref: this.hintEditor,
|
|
27085
27087
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27111,7 +27113,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27111
27113
|
};
|
|
27112
27114
|
};
|
|
27113
27115
|
}
|
|
27114
|
-
const styles$
|
|
27116
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
27115
27117
|
title: {
|
|
27116
27118
|
fontSize: 18,
|
|
27117
27119
|
fontWeight: "bold"
|
|
@@ -28482,13 +28484,13 @@ function MathquillInput(props) {
|
|
|
28482
28484
|
}
|
|
28483
28485
|
});
|
|
28484
28486
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28485
|
-
style: styles$
|
|
28487
|
+
style: styles$A.outerWrapper
|
|
28486
28488
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28487
28489
|
ref: mathFieldWrapperRef,
|
|
28488
28490
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28489
28491
|
}));
|
|
28490
28492
|
}
|
|
28491
|
-
const styles$
|
|
28493
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
28492
28494
|
outerWrapper: {
|
|
28493
28495
|
display: "inline-block",
|
|
28494
28496
|
borderStyle: "solid",
|
|
@@ -29558,16 +29560,16 @@ const LabeledRow = props => {
|
|
|
29558
29560
|
style
|
|
29559
29561
|
} = props;
|
|
29560
29562
|
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29561
|
-
className: aphrodite.css(styles$
|
|
29563
|
+
className: aphrodite.css(styles$z.label)
|
|
29562
29564
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29563
|
-
style: [styles$
|
|
29565
|
+
style: [styles$z.row, style]
|
|
29564
29566
|
}, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29565
|
-
style: styles$
|
|
29567
|
+
style: styles$z.spaceEnd
|
|
29566
29568
|
}, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29567
|
-
style: styles$
|
|
29569
|
+
style: styles$z.spaceStart
|
|
29568
29570
|
}, label)));
|
|
29569
29571
|
};
|
|
29570
|
-
const styles$
|
|
29572
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
29571
29573
|
label: {
|
|
29572
29574
|
width: "fit-content"
|
|
29573
29575
|
},
|
|
@@ -29644,11 +29646,11 @@ class Spring extends React__namespace.Component {
|
|
|
29644
29646
|
} = this.props;
|
|
29645
29647
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
29646
29648
|
"aria-hidden": "true",
|
|
29647
|
-
style: [styles$
|
|
29649
|
+
style: [styles$y.grow, style]
|
|
29648
29650
|
});
|
|
29649
29651
|
}
|
|
29650
29652
|
}
|
|
29651
|
-
const styles$
|
|
29653
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
29652
29654
|
grow: {
|
|
29653
29655
|
flexGrow: 1
|
|
29654
29656
|
}
|
|
@@ -29677,6 +29679,39 @@ const strutStyle = size => {
|
|
|
29677
29679
|
};
|
|
29678
29680
|
};
|
|
29679
29681
|
|
|
29682
|
+
function Heading(_ref) {
|
|
29683
|
+
let {
|
|
29684
|
+
title,
|
|
29685
|
+
isOpen,
|
|
29686
|
+
isCollapsible,
|
|
29687
|
+
onToggle
|
|
29688
|
+
} = _ref;
|
|
29689
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29690
|
+
style: {
|
|
29691
|
+
flexDirection: "row",
|
|
29692
|
+
justifyContent: "space-between",
|
|
29693
|
+
backgroundColor: wonderBlocksTokens.color.offBlack8,
|
|
29694
|
+
padding: wonderBlocksTokens.spacing.xSmall_8,
|
|
29695
|
+
marginTop: wonderBlocksTokens.spacing.small_12,
|
|
29696
|
+
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
29697
|
+
// variable found in perseus-editor.less. For now, it must
|
|
29698
|
+
// match otherwise there's a gap from this header to the edge
|
|
29699
|
+
// of the editor borders.
|
|
29700
|
+
marginInline: -10,
|
|
29701
|
+
cursor: isCollapsible ? "pointer" : "default",
|
|
29702
|
+
userSelect: "none"
|
|
29703
|
+
},
|
|
29704
|
+
onClick: () => isCollapsible && onToggle?.(!isOpen)
|
|
29705
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
|
|
29706
|
+
style: {
|
|
29707
|
+
fontSize: 14,
|
|
29708
|
+
fontWeight: 600
|
|
29709
|
+
}
|
|
29710
|
+
}, title), isCollapsible && /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
29711
|
+
isExpanded: isOpen
|
|
29712
|
+
}));
|
|
29713
|
+
}
|
|
29714
|
+
|
|
29680
29715
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
29681
29716
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
29682
29717
|
//
|
|
@@ -29798,17 +29833,17 @@ const LockedFigureSelect = props => {
|
|
|
29798
29833
|
} = props;
|
|
29799
29834
|
const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
|
|
29800
29835
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29801
|
-
style: styles$
|
|
29836
|
+
style: styles$x.container
|
|
29802
29837
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29803
29838
|
menuText: "Add locked figure",
|
|
29804
|
-
style: styles$
|
|
29839
|
+
style: styles$x.addElementSelect
|
|
29805
29840
|
}, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29806
29841
|
key: `${id}-${figureType}`,
|
|
29807
29842
|
label: figureType,
|
|
29808
29843
|
onClick: () => onChange(figureType)
|
|
29809
29844
|
}, figureType))));
|
|
29810
29845
|
};
|
|
29811
|
-
const styles$
|
|
29846
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
29812
29847
|
container: {
|
|
29813
29848
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29814
29849
|
},
|
|
@@ -29839,19 +29874,19 @@ const AngleInput = props => {
|
|
|
29839
29874
|
}
|
|
29840
29875
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29841
29876
|
tag: "label",
|
|
29842
|
-
style: styles$
|
|
29877
|
+
style: styles$w.row
|
|
29843
29878
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29844
29879
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29845
29880
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29846
29881
|
type: "number",
|
|
29847
29882
|
value: angleInput,
|
|
29848
29883
|
onChange: handleAngleChange,
|
|
29849
|
-
style: styles$
|
|
29884
|
+
style: styles$w.textField
|
|
29850
29885
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29851
29886
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29852
29887
|
}));
|
|
29853
29888
|
};
|
|
29854
|
-
const styles$
|
|
29889
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
29855
29890
|
row: {
|
|
29856
29891
|
display: "flex",
|
|
29857
29892
|
flexDirection: "row",
|
|
@@ -29876,6 +29911,12 @@ const CoordinatePairInput = props => {
|
|
|
29876
29911
|
const [coordState, setCoordState] = React__namespace.useState([
|
|
29877
29912
|
// Using strings to make it easier to work with the text fields.
|
|
29878
29913
|
coord[0].toString(), coord[1].toString()]);
|
|
29914
|
+
|
|
29915
|
+
// Update the local state when the props change. (Such as when the graph
|
|
29916
|
+
// type is changed, and the coordinates are reset.)
|
|
29917
|
+
React__namespace.useEffect(() => {
|
|
29918
|
+
setCoordState([coord[0].toString(), coord[1].toString()]);
|
|
29919
|
+
}, [coord]);
|
|
29879
29920
|
function handleCoordChange(newValue, coordIndex) {
|
|
29880
29921
|
// Update the local state (update the input field value).
|
|
29881
29922
|
const newCoordState = [...coordState];
|
|
@@ -29894,32 +29935,32 @@ const CoordinatePairInput = props => {
|
|
|
29894
29935
|
onChange(newCoords);
|
|
29895
29936
|
}
|
|
29896
29937
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29897
|
-
style: [styles$
|
|
29938
|
+
style: [styles$v.row, style]
|
|
29898
29939
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29899
29940
|
tag: "label",
|
|
29900
|
-
style: styles$
|
|
29941
|
+
style: styles$v.row
|
|
29901
29942
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29902
29943
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29903
29944
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29904
29945
|
type: "number",
|
|
29905
29946
|
value: coordState[0],
|
|
29906
29947
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29907
|
-
style: [styles$
|
|
29948
|
+
style: [styles$v.textField, error ? styles$v.errorField : undefined]
|
|
29908
29949
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29909
29950
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29910
29951
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29911
29952
|
tag: "label",
|
|
29912
|
-
style: styles$
|
|
29953
|
+
style: styles$v.row
|
|
29913
29954
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29914
29955
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29915
29956
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29916
29957
|
type: "number",
|
|
29917
29958
|
value: coordState[1],
|
|
29918
29959
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29919
|
-
style: [styles$
|
|
29960
|
+
style: [styles$v.textField, error ? styles$v.errorField : undefined]
|
|
29920
29961
|
})));
|
|
29921
29962
|
};
|
|
29922
|
-
const styles$
|
|
29963
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
29923
29964
|
row: {
|
|
29924
29965
|
display: "flex",
|
|
29925
29966
|
flexDirection: "row",
|
|
@@ -29952,14 +29993,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29952
29993
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29953
29994
|
expanded: expanded,
|
|
29954
29995
|
onToggle: onToggle,
|
|
29955
|
-
style: [styles$
|
|
29956
|
-
headerStyle: styles$
|
|
29996
|
+
style: [styles$u.container, containerStyle],
|
|
29997
|
+
headerStyle: styles$u.accordionHeader,
|
|
29957
29998
|
header: header
|
|
29958
29999
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29959
|
-
style: [styles$
|
|
30000
|
+
style: [styles$u.accordionPanel, panelStyle]
|
|
29960
30001
|
}, children)));
|
|
29961
30002
|
};
|
|
29962
|
-
const styles$
|
|
30003
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
29963
30004
|
container: {
|
|
29964
30005
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29965
30006
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -29990,13 +30031,13 @@ const ColorSwatch = props => {
|
|
|
29990
30031
|
"aria-label":
|
|
29991
30032
|
// Don't include an aria label for decorative circles.
|
|
29992
30033
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
29993
|
-
style: [styles$
|
|
30034
|
+
style: [styles$t.colorSwatch, {
|
|
29994
30035
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
29995
30036
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
29996
30037
|
}]
|
|
29997
30038
|
});
|
|
29998
30039
|
};
|
|
29999
|
-
const styles$
|
|
30040
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
30000
30041
|
colorSwatch: {
|
|
30001
30042
|
// Add a white outline so that the color swatch is visible when
|
|
30002
30043
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30015,10 +30056,10 @@ const ColorSelect = props => {
|
|
|
30015
30056
|
onChange
|
|
30016
30057
|
} = props;
|
|
30017
30058
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30018
|
-
style: [styles$
|
|
30059
|
+
style: [styles$s.row, style]
|
|
30019
30060
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30020
30061
|
tag: "label",
|
|
30021
|
-
style: styles$
|
|
30062
|
+
style: styles$s.row
|
|
30022
30063
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30023
30064
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30024
30065
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30037,7 +30078,7 @@ const ColorSelect = props => {
|
|
|
30037
30078
|
})
|
|
30038
30079
|
}, colorName)))));
|
|
30039
30080
|
};
|
|
30040
|
-
const styles$
|
|
30081
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
30041
30082
|
row: {
|
|
30042
30083
|
display: "flex",
|
|
30043
30084
|
flexDirection: "row",
|
|
@@ -30053,17 +30094,17 @@ const EllipseSwatch = props => {
|
|
|
30053
30094
|
} = props;
|
|
30054
30095
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30055
30096
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30056
|
-
style: [styles$
|
|
30097
|
+
style: [styles$r.container, {
|
|
30057
30098
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30058
30099
|
}]
|
|
30059
30100
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30060
|
-
style: [styles$
|
|
30101
|
+
style: [styles$r.innerCircle, {
|
|
30061
30102
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30062
30103
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30063
30104
|
}]
|
|
30064
30105
|
}));
|
|
30065
30106
|
};
|
|
30066
|
-
const styles$
|
|
30107
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
30067
30108
|
container: {
|
|
30068
30109
|
// Add a white outline so that the color swatch is visible when
|
|
30069
30110
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30094,40 +30135,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30094
30135
|
onRemove
|
|
30095
30136
|
} = props;
|
|
30096
30137
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30097
|
-
style: styles$
|
|
30138
|
+
style: styles$q.container
|
|
30098
30139
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30099
30140
|
startIcon: trashIcon__default["default"],
|
|
30100
30141
|
"aria-label": `Delete locked ${figureType}`,
|
|
30101
30142
|
onClick: onRemove,
|
|
30102
30143
|
kind: "tertiary",
|
|
30103
|
-
style: styles$
|
|
30144
|
+
style: styles$q.deleteButton
|
|
30104
30145
|
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30105
30146
|
icon: caretDoubleUpIcon__default["default"],
|
|
30106
30147
|
size: "small",
|
|
30107
30148
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30108
30149
|
onClick: () => onMove("back"),
|
|
30109
|
-
style: styles$
|
|
30150
|
+
style: styles$q.iconButton
|
|
30110
30151
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30111
30152
|
icon: caretUpIcon__default["default"],
|
|
30112
30153
|
size: "small",
|
|
30113
30154
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30114
30155
|
onClick: () => onMove("backward"),
|
|
30115
|
-
style: styles$
|
|
30156
|
+
style: styles$q.iconButton
|
|
30116
30157
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30117
30158
|
icon: caretDownIcon__default["default"],
|
|
30118
30159
|
size: "small",
|
|
30119
30160
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30120
30161
|
onClick: () => onMove("forward"),
|
|
30121
|
-
style: styles$
|
|
30162
|
+
style: styles$q.iconButton
|
|
30122
30163
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30123
30164
|
icon: caretDoubleDownIcon__default["default"],
|
|
30124
30165
|
size: "small",
|
|
30125
30166
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30126
30167
|
onClick: () => onMove("front"),
|
|
30127
|
-
style: styles$
|
|
30168
|
+
style: styles$q.iconButton
|
|
30128
30169
|
})));
|
|
30129
30170
|
};
|
|
30130
|
-
const styles$
|
|
30171
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30131
30172
|
container: {
|
|
30132
30173
|
width: "100%",
|
|
30133
30174
|
flexDirection: "row",
|
|
@@ -30174,7 +30215,7 @@ const LockedEllipseSettings = props => {
|
|
|
30174
30215
|
/*#__PURE__*/
|
|
30175
30216
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30176
30217
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30177
|
-
style: styles$
|
|
30218
|
+
style: styles$p.row
|
|
30178
30219
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30179
30220
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30180
30221
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30183,19 +30224,19 @@ const LockedEllipseSettings = props => {
|
|
|
30183
30224
|
strokeStyle: strokeStyle
|
|
30184
30225
|
}))
|
|
30185
30226
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30186
|
-
style: styles$
|
|
30227
|
+
style: styles$p.row
|
|
30187
30228
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30188
30229
|
coord: center,
|
|
30189
|
-
style: styles$
|
|
30230
|
+
style: styles$p.spaceUnder,
|
|
30190
30231
|
onChange: newCoords => onChangeProps({
|
|
30191
30232
|
center: newCoords
|
|
30192
30233
|
})
|
|
30193
30234
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30194
|
-
style: styles$
|
|
30235
|
+
style: styles$p.spaceUnder
|
|
30195
30236
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30196
30237
|
coord: radius,
|
|
30197
30238
|
labels: ["x radius", "y radius"],
|
|
30198
|
-
style: styles$
|
|
30239
|
+
style: styles$p.spaceUnder,
|
|
30199
30240
|
onChange: newCoords => onChangeProps({
|
|
30200
30241
|
radius: newCoords
|
|
30201
30242
|
})
|
|
@@ -30207,7 +30248,7 @@ const LockedEllipseSettings = props => {
|
|
|
30207
30248
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30208
30249
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30209
30250
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30210
|
-
style: [styles$
|
|
30251
|
+
style: [styles$p.row, styles$p.spaceUnder]
|
|
30211
30252
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30212
30253
|
selectedValue: color,
|
|
30213
30254
|
onChange: handleColorChange
|
|
@@ -30215,7 +30256,7 @@ const LockedEllipseSettings = props => {
|
|
|
30215
30256
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30216
30257
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30217
30258
|
tag: "label",
|
|
30218
|
-
style: styles$
|
|
30259
|
+
style: styles$p.row
|
|
30219
30260
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30220
30261
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30221
30262
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30232,7 +30273,7 @@ const LockedEllipseSettings = props => {
|
|
|
30232
30273
|
label: option
|
|
30233
30274
|
}, option))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30234
30275
|
tag: "label",
|
|
30235
|
-
style: styles$
|
|
30276
|
+
style: styles$p.row
|
|
30236
30277
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30237
30278
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30238
30279
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30256,7 +30297,7 @@ const LockedEllipseSettings = props => {
|
|
|
30256
30297
|
onRemove: onRemove
|
|
30257
30298
|
}));
|
|
30258
30299
|
};
|
|
30259
|
-
const styles$
|
|
30300
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30260
30301
|
row: {
|
|
30261
30302
|
display: "flex",
|
|
30262
30303
|
flexDirection: "row",
|
|
@@ -30277,7 +30318,7 @@ const LabeledSwitch = props => {
|
|
|
30277
30318
|
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30278
30319
|
const switchId = ids.get("switch");
|
|
30279
30320
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30280
|
-
style: [styles$
|
|
30321
|
+
style: [styles$o.row, style]
|
|
30281
30322
|
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30282
30323
|
id: switchId,
|
|
30283
30324
|
checked: checked,
|
|
@@ -30289,7 +30330,7 @@ const LabeledSwitch = props => {
|
|
|
30289
30330
|
htmlFor: switchId
|
|
30290
30331
|
}, label));
|
|
30291
30332
|
};
|
|
30292
|
-
const styles$
|
|
30333
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30293
30334
|
row: {
|
|
30294
30335
|
flexDirection: "row",
|
|
30295
30336
|
alignItems: "center"
|
|
@@ -30323,13 +30364,13 @@ const DefiningPointSettings = props => {
|
|
|
30323
30364
|
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30324
30365
|
expanded: expanded,
|
|
30325
30366
|
onToggle: onToggle,
|
|
30326
|
-
containerStyle: styles$
|
|
30327
|
-
panelStyle: styles$
|
|
30367
|
+
containerStyle: styles$n.container,
|
|
30368
|
+
panelStyle: styles$n.accordionPanel,
|
|
30328
30369
|
header:
|
|
30329
30370
|
/*#__PURE__*/
|
|
30330
30371
|
// Summary: Point, coords, color (filled/open)
|
|
30331
30372
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30332
|
-
style: styles$
|
|
30373
|
+
style: styles$n.row
|
|
30333
30374
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30334
30375
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30335
30376
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30339,7 +30380,7 @@ const DefiningPointSettings = props => {
|
|
|
30339
30380
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30340
30381
|
coord: coord,
|
|
30341
30382
|
error: !!error,
|
|
30342
|
-
style: styles$
|
|
30383
|
+
style: styles$n.spaceUnder,
|
|
30343
30384
|
onChange: newCoords => {
|
|
30344
30385
|
onChangeProps({
|
|
30345
30386
|
coord: newCoords
|
|
@@ -30348,12 +30389,12 @@ const DefiningPointSettings = props => {
|
|
|
30348
30389
|
}), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30349
30390
|
label: "show point on graph",
|
|
30350
30391
|
checked: !!showPoint,
|
|
30351
|
-
style: showPoint && styles$
|
|
30392
|
+
style: showPoint && styles$n.spaceUnder,
|
|
30352
30393
|
onChange: onTogglePoint
|
|
30353
30394
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30354
30395
|
selectedValue: pointColor,
|
|
30355
30396
|
onChange: handleColorChange,
|
|
30356
|
-
style: styles$
|
|
30397
|
+
style: styles$n.spaceUnder
|
|
30357
30398
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30358
30399
|
label: "open point",
|
|
30359
30400
|
checked: !filled,
|
|
@@ -30364,7 +30405,7 @@ const DefiningPointSettings = props => {
|
|
|
30364
30405
|
}
|
|
30365
30406
|
})));
|
|
30366
30407
|
};
|
|
30367
|
-
const styles$
|
|
30408
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30368
30409
|
container: {
|
|
30369
30410
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30370
30411
|
marginBottom: 0,
|
|
@@ -30391,15 +30432,15 @@ const LineSwatch = props => {
|
|
|
30391
30432
|
lineStyle
|
|
30392
30433
|
} = props;
|
|
30393
30434
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30394
|
-
style: styles$
|
|
30435
|
+
style: styles$m.container
|
|
30395
30436
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30396
30437
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30397
|
-
style: [styles$
|
|
30438
|
+
style: [styles$m.lineSwatch, {
|
|
30398
30439
|
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30399
30440
|
}]
|
|
30400
30441
|
}));
|
|
30401
30442
|
};
|
|
30402
|
-
const styles$
|
|
30443
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30403
30444
|
container: {
|
|
30404
30445
|
backgroundColor: wonderBlocksTokens.color.white,
|
|
30405
30446
|
justifyContent: "center",
|
|
@@ -30458,7 +30499,7 @@ const LockedLineSettings = props => {
|
|
|
30458
30499
|
expanded: props.expanded,
|
|
30459
30500
|
onToggle: props.onToggle,
|
|
30460
30501
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30461
|
-
style: styles$
|
|
30502
|
+
style: styles$l.row
|
|
30462
30503
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30463
30504
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30464
30505
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30467,7 +30508,7 @@ const LockedLineSettings = props => {
|
|
|
30467
30508
|
}))
|
|
30468
30509
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30469
30510
|
tag: "label",
|
|
30470
|
-
style: [styles$
|
|
30511
|
+
style: [styles$l.row, styles$l.spaceUnder]
|
|
30471
30512
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30472
30513
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30473
30514
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30488,7 +30529,7 @@ const LockedLineSettings = props => {
|
|
|
30488
30529
|
value: "segment",
|
|
30489
30530
|
label: "segment"
|
|
30490
30531
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30491
|
-
style: styles$
|
|
30532
|
+
style: styles$l.row
|
|
30492
30533
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30493
30534
|
selectedValue: lineColor,
|
|
30494
30535
|
onChange: handleColorChange
|
|
@@ -30496,7 +30537,7 @@ const LockedLineSettings = props => {
|
|
|
30496
30537
|
size: wonderBlocksTokens.spacing.small_12
|
|
30497
30538
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30498
30539
|
tag: "label",
|
|
30499
|
-
style: styles$
|
|
30540
|
+
style: styles$l.row
|
|
30500
30541
|
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30501
30542
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30502
30543
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30507,7 +30548,7 @@ const LockedLineSettings = props => {
|
|
|
30507
30548
|
// Placeholder is required, but never gets used.
|
|
30508
30549
|
,
|
|
30509
30550
|
placeholder: "",
|
|
30510
|
-
style: styles$
|
|
30551
|
+
style: styles$l.selectMarginOffset
|
|
30511
30552
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30512
30553
|
value: "solid",
|
|
30513
30554
|
label: "solid"
|
|
@@ -30515,7 +30556,7 @@ const LockedLineSettings = props => {
|
|
|
30515
30556
|
value: "dashed",
|
|
30516
30557
|
label: "dashed"
|
|
30517
30558
|
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30518
|
-
style: styles$
|
|
30559
|
+
style: styles$l.errorText
|
|
30519
30560
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30520
30561
|
label: "Point 1",
|
|
30521
30562
|
showPoint: showPoint1,
|
|
@@ -30541,7 +30582,7 @@ const LockedLineSettings = props => {
|
|
|
30541
30582
|
onRemove: onRemove
|
|
30542
30583
|
}));
|
|
30543
30584
|
};
|
|
30544
|
-
const styles$
|
|
30585
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
30545
30586
|
row: {
|
|
30546
30587
|
display: "flex",
|
|
30547
30588
|
flexDirection: "row",
|
|
@@ -30586,7 +30627,7 @@ const LockedPointSettings = props => {
|
|
|
30586
30627
|
/*#__PURE__*/
|
|
30587
30628
|
// Summary: Point, coords, color (filled/open)
|
|
30588
30629
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30589
|
-
style: styles$
|
|
30630
|
+
style: styles$k.row
|
|
30590
30631
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30591
30632
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30592
30633
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30595,7 +30636,7 @@ const LockedPointSettings = props => {
|
|
|
30595
30636
|
}))
|
|
30596
30637
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30597
30638
|
coord: coord,
|
|
30598
|
-
style: styles$
|
|
30639
|
+
style: styles$k.spaceUnder,
|
|
30599
30640
|
onChange: newCoord => {
|
|
30600
30641
|
onChangeProps({
|
|
30601
30642
|
coord: newCoord
|
|
@@ -30604,7 +30645,7 @@ const LockedPointSettings = props => {
|
|
|
30604
30645
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30605
30646
|
selectedValue: pointColor,
|
|
30606
30647
|
onChange: handleColorChange,
|
|
30607
|
-
style: styles$
|
|
30648
|
+
style: styles$k.spaceUnder
|
|
30608
30649
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30609
30650
|
label: "open point",
|
|
30610
30651
|
checked: !filled,
|
|
@@ -30620,7 +30661,7 @@ const LockedPointSettings = props => {
|
|
|
30620
30661
|
onRemove: onRemove
|
|
30621
30662
|
}));
|
|
30622
30663
|
};
|
|
30623
|
-
const styles$
|
|
30664
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
30624
30665
|
row: {
|
|
30625
30666
|
flexDirection: "row",
|
|
30626
30667
|
alignItems: "center"
|
|
@@ -30638,17 +30679,17 @@ const PolygonSwatch = props => {
|
|
|
30638
30679
|
} = props;
|
|
30639
30680
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30640
30681
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30641
|
-
style: [styles$
|
|
30682
|
+
style: [styles$j.container, {
|
|
30642
30683
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30643
30684
|
}]
|
|
30644
30685
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30645
|
-
style: [styles$
|
|
30686
|
+
style: [styles$j.innerSquare, {
|
|
30646
30687
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30647
30688
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30648
30689
|
}]
|
|
30649
30690
|
}));
|
|
30650
30691
|
};
|
|
30651
|
-
const styles$
|
|
30692
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
30652
30693
|
container: {
|
|
30653
30694
|
// Add a white outline so that the color swatch is visible when
|
|
30654
30695
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30690,7 +30731,7 @@ const LockedPolygonSettings = props => {
|
|
|
30690
30731
|
/*#__PURE__*/
|
|
30691
30732
|
// Summary: Polygon, number of sides, style swatch
|
|
30692
30733
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30693
|
-
style: styles$
|
|
30734
|
+
style: styles$i.row
|
|
30694
30735
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30695
30736
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30696
30737
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30699,7 +30740,7 @@ const LockedPolygonSettings = props => {
|
|
|
30699
30740
|
strokeStyle: strokeStyle
|
|
30700
30741
|
}))
|
|
30701
30742
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30702
|
-
style: [styles$
|
|
30743
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30703
30744
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30704
30745
|
selectedValue: color,
|
|
30705
30746
|
onChange: handleColorChange
|
|
@@ -30707,7 +30748,7 @@ const LockedPolygonSettings = props => {
|
|
|
30707
30748
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30708
30749
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30709
30750
|
tag: "label",
|
|
30710
|
-
style: styles$
|
|
30751
|
+
style: styles$i.row
|
|
30711
30752
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30712
30753
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30713
30754
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30724,7 +30765,7 @@ const LockedPolygonSettings = props => {
|
|
|
30724
30765
|
label: option
|
|
30725
30766
|
}, option))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30726
30767
|
tag: "label",
|
|
30727
|
-
style: [styles$
|
|
30768
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30728
30769
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30729
30770
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30730
30771
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30747,17 +30788,17 @@ const LockedPolygonSettings = props => {
|
|
|
30747
30788
|
onChange: newValue => onChangeProps({
|
|
30748
30789
|
showVertices: newValue
|
|
30749
30790
|
}),
|
|
30750
|
-
style: styles$
|
|
30791
|
+
style: styles$i.spaceUnder
|
|
30751
30792
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30752
30793
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30753
30794
|
expanded: true,
|
|
30754
|
-
containerStyle: styles$
|
|
30755
|
-
panelStyle: styles$
|
|
30795
|
+
containerStyle: styles$i.pointAccordionContainer,
|
|
30796
|
+
panelStyle: styles$i.pointAccordionPanel
|
|
30756
30797
|
}, points.map((point, index) => {
|
|
30757
30798
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30758
30799
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30759
30800
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30760
|
-
style: [styles$
|
|
30801
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30761
30802
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30762
30803
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30763
30804
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30785,7 +30826,7 @@ const LockedPolygonSettings = props => {
|
|
|
30785
30826
|
points: newPoints
|
|
30786
30827
|
});
|
|
30787
30828
|
},
|
|
30788
|
-
style: styles$
|
|
30829
|
+
style: styles$i.icon
|
|
30789
30830
|
}));
|
|
30790
30831
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30791
30832
|
kind: "tertiary",
|
|
@@ -30802,7 +30843,7 @@ const LockedPolygonSettings = props => {
|
|
|
30802
30843
|
onRemove: onRemove
|
|
30803
30844
|
}));
|
|
30804
30845
|
};
|
|
30805
|
-
const styles$
|
|
30846
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
30806
30847
|
row: {
|
|
30807
30848
|
display: "flex",
|
|
30808
30849
|
flexDirection: "row",
|
|
@@ -30860,7 +30901,7 @@ const LockedVectorSettings = props => {
|
|
|
30860
30901
|
expanded: props.expanded,
|
|
30861
30902
|
onToggle: props.onToggle,
|
|
30862
30903
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30863
|
-
style: styles$
|
|
30904
|
+
style: styles$h.row
|
|
30864
30905
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30865
30906
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30866
30907
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30868,19 +30909,19 @@ const LockedVectorSettings = props => {
|
|
|
30868
30909
|
lineStyle: "solid"
|
|
30869
30910
|
}))
|
|
30870
30911
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30871
|
-
style: [styles$
|
|
30912
|
+
style: [styles$h.row, styles$h.spaceUnder]
|
|
30872
30913
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30873
30914
|
selectedValue: lineColor,
|
|
30874
30915
|
onChange: handleColorChange
|
|
30875
30916
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30876
|
-
style: styles$
|
|
30917
|
+
style: styles$h.errorText
|
|
30877
30918
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30878
30919
|
expanded: true // Initial state is expanded
|
|
30879
30920
|
,
|
|
30880
|
-
containerStyle: styles$
|
|
30881
|
-
panelStyle: styles$
|
|
30921
|
+
containerStyle: styles$h.container,
|
|
30922
|
+
panelStyle: styles$h.accordionPanel,
|
|
30882
30923
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30883
|
-
style: styles$
|
|
30924
|
+
style: styles$h.row
|
|
30884
30925
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30885
30926
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30886
30927
|
coord: tail,
|
|
@@ -30891,10 +30932,10 @@ const LockedVectorSettings = props => {
|
|
|
30891
30932
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30892
30933
|
expanded: true // Initial state is expanded
|
|
30893
30934
|
,
|
|
30894
|
-
containerStyle: styles$
|
|
30895
|
-
panelStyle: styles$
|
|
30935
|
+
containerStyle: styles$h.container,
|
|
30936
|
+
panelStyle: styles$h.accordionPanel,
|
|
30896
30937
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30897
|
-
style: styles$
|
|
30938
|
+
style: styles$h.row
|
|
30898
30939
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30899
30940
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30900
30941
|
coord: tip,
|
|
@@ -30909,7 +30950,7 @@ const LockedVectorSettings = props => {
|
|
|
30909
30950
|
onRemove: onRemove
|
|
30910
30951
|
}));
|
|
30911
30952
|
};
|
|
30912
|
-
const styles$
|
|
30953
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
30913
30954
|
accordionPanel: {
|
|
30914
30955
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30915
30956
|
},
|
|
@@ -30968,6 +31009,7 @@ const LockedFiguresSection = props => {
|
|
|
30968
31009
|
// expand/collapse all button. Set the whole array to false initially.
|
|
30969
31010
|
const collapsedStateArray = Array((props.figures ?? []).length).fill(false);
|
|
30970
31011
|
const [expandedStates, setExpandedStates] = React__namespace.useState(collapsedStateArray);
|
|
31012
|
+
const [isExpanded, setIsExpanded] = React__namespace.useState(true);
|
|
30971
31013
|
const uniqueId = wonderBlocksCore.useUniqueIdWithMock().get("locked-figures-section");
|
|
30972
31014
|
const {
|
|
30973
31015
|
figures,
|
|
@@ -31057,7 +31099,12 @@ const LockedFiguresSection = props => {
|
|
|
31057
31099
|
const allCollapsed = expandedStates.every(value => !value);
|
|
31058
31100
|
const buttonLabel = allCollapsed ? "Expand all" : "Collapse all";
|
|
31059
31101
|
const showExpandButton = !!figures?.length;
|
|
31060
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
31102
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31103
|
+
title: "Locked Figures",
|
|
31104
|
+
isOpen: isExpanded,
|
|
31105
|
+
onToggle: () => setIsExpanded(!isExpanded),
|
|
31106
|
+
isCollapsible: true
|
|
31107
|
+
}), isExpanded && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
|
|
31061
31108
|
if (figure.type === "function") {
|
|
31062
31109
|
// TODO(LEMS-1947): Add locked function settings.
|
|
31063
31110
|
// Remove this block once function locked figure settings are
|
|
@@ -31080,7 +31127,7 @@ const LockedFiguresSection = props => {
|
|
|
31080
31127
|
onRemove: () => removeLockedFigure(index)
|
|
31081
31128
|
}));
|
|
31082
31129
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31083
|
-
style: styles$
|
|
31130
|
+
style: styles$g.buttonContainer
|
|
31084
31131
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31085
31132
|
showM2Features: props.showM2Features,
|
|
31086
31133
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -31091,10 +31138,10 @@ const LockedFiguresSection = props => {
|
|
|
31091
31138
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31092
31139
|
kind: "secondary",
|
|
31093
31140
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31094
|
-
style: styles$
|
|
31095
|
-
}, buttonLabel)));
|
|
31141
|
+
style: styles$g.button
|
|
31142
|
+
}, buttonLabel))));
|
|
31096
31143
|
};
|
|
31097
|
-
const styles$
|
|
31144
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31098
31145
|
buttonContainer: {
|
|
31099
31146
|
flexDirection: "row",
|
|
31100
31147
|
alignItems: "center"
|
|
@@ -31130,7 +31177,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31130
31177
|
// Never uses placeholder, always has value
|
|
31131
31178
|
,
|
|
31132
31179
|
placeholder: "",
|
|
31133
|
-
style: styles$
|
|
31180
|
+
style: styles$f.singleSelectShort
|
|
31134
31181
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31135
31182
|
key: n,
|
|
31136
31183
|
value: `${n}`,
|
|
@@ -31141,7 +31188,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31141
31188
|
label: "unlimited"
|
|
31142
31189
|
})]);
|
|
31143
31190
|
};
|
|
31144
|
-
const styles$
|
|
31191
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31145
31192
|
singleSelectShort: {
|
|
31146
31193
|
// Non-standard spacing, but it's the smallest we can go
|
|
31147
31194
|
// without running into styling issues with the dropdown.
|
|
@@ -31154,7 +31201,7 @@ const GraphTypeSelector = props => {
|
|
|
31154
31201
|
selectedValue: props.graphType,
|
|
31155
31202
|
onChange: props.onChange,
|
|
31156
31203
|
placeholder: "Select a graph type",
|
|
31157
|
-
style: styles$
|
|
31204
|
+
style: styles$e.singleSelectShort
|
|
31158
31205
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31159
31206
|
value: "linear",
|
|
31160
31207
|
label: "Linear function"
|
|
@@ -31187,7 +31234,7 @@ const GraphTypeSelector = props => {
|
|
|
31187
31234
|
label: "Angle"
|
|
31188
31235
|
}));
|
|
31189
31236
|
};
|
|
31190
|
-
const styles$
|
|
31237
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31191
31238
|
singleSelectShort: {
|
|
31192
31239
|
// Non-standard spacing, but it's the smallest we can go
|
|
31193
31240
|
// without running into styling issues with the dropdown.
|
|
@@ -31195,30 +31242,27 @@ const styles$d = aphrodite.StyleSheet.create({
|
|
|
31195
31242
|
}
|
|
31196
31243
|
});
|
|
31197
31244
|
|
|
31198
|
-
function
|
|
31199
|
-
|
|
31200
|
-
title,
|
|
31201
|
-
isOpen,
|
|
31202
|
-
|
|
31203
|
-
}
|
|
31204
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31245
|
+
function InteractiveGraphCorrectAnswer(props) {
|
|
31246
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31247
|
+
title: "Correct Answer",
|
|
31248
|
+
isOpen: true,
|
|
31249
|
+
isCollapsible: false
|
|
31250
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
|
|
31205
31251
|
style: {
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
|
|
31212
|
-
|
|
31213
|
-
|
|
31214
|
-
|
|
31215
|
-
|
|
31216
|
-
|
|
31217
|
-
|
|
31218
|
-
|
|
31219
|
-
},
|
|
31220
|
-
isExpanded: isOpen
|
|
31221
|
-
}));
|
|
31252
|
+
paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
|
|
31253
|
+
paddingBottom: wonderBlocksTokens.spacing.xxSmall_6,
|
|
31254
|
+
color: wonderBlocksTokens.color.offBlack64
|
|
31255
|
+
}
|
|
31256
|
+
}, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer."), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
31257
|
+
style: {
|
|
31258
|
+
fontSize: 12,
|
|
31259
|
+
backgroundColor: "#eee",
|
|
31260
|
+
paddingInline: wonderBlocksTokens.spacing.xxSmall_6,
|
|
31261
|
+
borderColor: "#ccc",
|
|
31262
|
+
borderStyle: "solid",
|
|
31263
|
+
borderWidth: 1
|
|
31264
|
+
}
|
|
31265
|
+
}, props.equationString)), props.children));
|
|
31222
31266
|
}
|
|
31223
31267
|
|
|
31224
31268
|
/* eslint-disable react/forbid-prop-types, react/no-unsafe */
|
|
@@ -31540,6 +31584,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31540
31584
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31541
31585
|
title: "Common Graph Settings",
|
|
31542
31586
|
isOpen: this.state.isExpanded,
|
|
31587
|
+
isCollapsible: true,
|
|
31543
31588
|
onToggle: () => this.setState({
|
|
31544
31589
|
isExpanded: !this.state.isExpanded
|
|
31545
31590
|
})
|
|
@@ -31634,10 +31679,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31634
31679
|
onChange: this.change
|
|
31635
31680
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31636
31681
|
label: "Background image URL:",
|
|
31637
|
-
style: styles$
|
|
31682
|
+
style: styles$d.resetSpaceTop
|
|
31638
31683
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31639
31684
|
type: "text",
|
|
31640
|
-
className: aphrodite.css(styles$
|
|
31685
|
+
className: aphrodite.css(styles$d.backgroundUrlInput),
|
|
31641
31686
|
ref: this.bgUrlRef,
|
|
31642
31687
|
value: this.state.backgroundImage.url || "",
|
|
31643
31688
|
onChange: e => {
|
|
@@ -31653,28 +31698,28 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31653
31698
|
onKeyPress: this.changeBackgroundUrl,
|
|
31654
31699
|
onBlur: this.changeBackgroundUrl
|
|
31655
31700
|
}), /*#__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, {
|
|
31656
|
-
style: styles$
|
|
31701
|
+
style: styles$d.rulerSection
|
|
31657
31702
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31658
|
-
style: styles$
|
|
31703
|
+
style: styles$d.checkboxRow
|
|
31659
31704
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31660
31705
|
label: "Show ruler",
|
|
31661
31706
|
showRuler: this.props.showRuler,
|
|
31662
31707
|
onChange: this.change,
|
|
31663
|
-
style: styles$
|
|
31708
|
+
style: styles$d.resetSpaceTop
|
|
31664
31709
|
}), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31665
31710
|
label: "Show protractor",
|
|
31666
31711
|
showProtractor: this.props.showProtractor,
|
|
31667
31712
|
onChange: this.change,
|
|
31668
|
-
style: styles$
|
|
31713
|
+
style: styles$d.resetSpaceTop
|
|
31669
31714
|
})), (this.props.showRuler || this.props.showProtractor) && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31670
31715
|
layout: "floating",
|
|
31671
31716
|
text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
|
|
31672
31717
|
kind: "warning"
|
|
31673
31718
|
}), this.props.showRuler && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31674
|
-
style: styles$
|
|
31719
|
+
style: styles$d.spaceTop
|
|
31675
31720
|
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31676
31721
|
label: "Ruler label:",
|
|
31677
|
-
style: styles$
|
|
31722
|
+
style: styles$d.resetSpaceTop
|
|
31678
31723
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31679
31724
|
id: "ruler-label-select",
|
|
31680
31725
|
selectedValue: this.props.rulerLabel,
|
|
@@ -31684,7 +31729,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31684
31729
|
});
|
|
31685
31730
|
},
|
|
31686
31731
|
placeholder: "None",
|
|
31687
|
-
style: styles$
|
|
31732
|
+
style: styles$d.singleSelectShort
|
|
31688
31733
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31689
31734
|
value: "",
|
|
31690
31735
|
label: "None",
|
|
@@ -31725,7 +31770,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31725
31770
|
});
|
|
31726
31771
|
},
|
|
31727
31772
|
placeholder: "10",
|
|
31728
|
-
style: styles$
|
|
31773
|
+
style: styles$d.singleSelectShort
|
|
31729
31774
|
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31730
31775
|
key: value,
|
|
31731
31776
|
value: `${value}`,
|
|
@@ -31733,7 +31778,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31733
31778
|
}))))))));
|
|
31734
31779
|
}
|
|
31735
31780
|
}
|
|
31736
|
-
const styles$
|
|
31781
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
31737
31782
|
resetSpaceTop: {
|
|
31738
31783
|
marginTop: 0
|
|
31739
31784
|
},
|
|
@@ -31780,14 +31825,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31780
31825
|
const num = +newValue;
|
|
31781
31826
|
onChange(num);
|
|
31782
31827
|
},
|
|
31783
|
-
style: styles$
|
|
31828
|
+
style: styles$c.singleSelectShort
|
|
31784
31829
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31785
31830
|
key: n,
|
|
31786
31831
|
value: `${n}`,
|
|
31787
31832
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31788
31833
|
})));
|
|
31789
31834
|
};
|
|
31790
|
-
const styles$
|
|
31835
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
31791
31836
|
singleSelectShort: {
|
|
31792
31837
|
// Non-standard spacing, but it's the smallest we can go
|
|
31793
31838
|
// without running into styling issues with the dropdown.
|
|
@@ -31795,6 +31840,77 @@ const styles$b = aphrodite.StyleSheet.create({
|
|
|
31795
31840
|
}
|
|
31796
31841
|
});
|
|
31797
31842
|
|
|
31843
|
+
const StartCoordSettingsInner = props => {
|
|
31844
|
+
const {
|
|
31845
|
+
type,
|
|
31846
|
+
startCoords,
|
|
31847
|
+
onChange
|
|
31848
|
+
} = props;
|
|
31849
|
+
|
|
31850
|
+
// Check if coords is of type CollinearTuple
|
|
31851
|
+
switch (type) {
|
|
31852
|
+
case "linear":
|
|
31853
|
+
case "ray":
|
|
31854
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31855
|
+
style: styles$b.tile
|
|
31856
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1"), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31857
|
+
coord: startCoords[0],
|
|
31858
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31859
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31860
|
+
style: styles$b.tile
|
|
31861
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2"), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31862
|
+
coord: startCoords[1],
|
|
31863
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31864
|
+
})));
|
|
31865
|
+
default:
|
|
31866
|
+
return null;
|
|
31867
|
+
}
|
|
31868
|
+
};
|
|
31869
|
+
const StartCoordSettings = props => {
|
|
31870
|
+
const {
|
|
31871
|
+
type,
|
|
31872
|
+
range,
|
|
31873
|
+
step,
|
|
31874
|
+
onChange
|
|
31875
|
+
} = props;
|
|
31876
|
+
const [isOpen, setIsOpen] = React__namespace.useState(true);
|
|
31877
|
+
if (type !== "linear" && type !== "ray") {
|
|
31878
|
+
return null;
|
|
31879
|
+
}
|
|
31880
|
+
const defaultStartCoords = perseus.getLineCoords({
|
|
31881
|
+
type: type
|
|
31882
|
+
}, range, step);
|
|
31883
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31884
|
+
style: styles$b.container
|
|
31885
|
+
}, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31886
|
+
isCollapsible: true,
|
|
31887
|
+
title: "Start coordinates",
|
|
31888
|
+
isOpen: isOpen,
|
|
31889
|
+
onToggle: () => setIsOpen(!isOpen)
|
|
31890
|
+
}), isOpen && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(StartCoordSettingsInner, {
|
|
31891
|
+
type: type,
|
|
31892
|
+
startCoords: props.startCoords ?? defaultStartCoords,
|
|
31893
|
+
onChange: onChange
|
|
31894
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31895
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31896
|
+
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31897
|
+
startIcon: arrowCounterClockwise__default["default"],
|
|
31898
|
+
kind: "tertiary",
|
|
31899
|
+
size: "small",
|
|
31900
|
+
onClick: () => {
|
|
31901
|
+
onChange(defaultStartCoords);
|
|
31902
|
+
}
|
|
31903
|
+
}, "Use default start coords")));
|
|
31904
|
+
};
|
|
31905
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
31906
|
+
tile: {
|
|
31907
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31908
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31909
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
31910
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8
|
|
31911
|
+
}
|
|
31912
|
+
});
|
|
31913
|
+
|
|
31798
31914
|
const {
|
|
31799
31915
|
InfoTip: InfoTip$b
|
|
31800
31916
|
} = perseus.components;
|
|
@@ -31881,13 +31997,17 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31881
31997
|
let correct = this.props.correct;
|
|
31882
31998
|
// @ts-expect-error - TS2532 - Object is possibly 'undefined'.
|
|
31883
31999
|
if (correct.type === newProps.graph.type) {
|
|
31884
|
-
correct =
|
|
32000
|
+
correct = {
|
|
32001
|
+
...correct,
|
|
32002
|
+
...newProps.graph
|
|
32003
|
+
};
|
|
31885
32004
|
} else {
|
|
31886
32005
|
// Clear options from previous graph
|
|
31887
32006
|
correct = newProps.graph;
|
|
31888
32007
|
}
|
|
31889
32008
|
this.props.onChange({
|
|
31890
|
-
correct: correct
|
|
32009
|
+
correct: correct,
|
|
32010
|
+
graph: this.props.graph
|
|
31891
32011
|
});
|
|
31892
32012
|
}
|
|
31893
32013
|
};
|
|
@@ -31927,7 +32047,9 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31927
32047
|
}
|
|
31928
32048
|
});
|
|
31929
32049
|
}
|
|
31930
|
-
})),
|
|
32050
|
+
})), /*#__PURE__*/React__namespace.createElement(InteractiveGraphCorrectAnswer, {
|
|
32051
|
+
equationString: equationString
|
|
32052
|
+
}, graph), this.props.correct?.type === "point" && /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31931
32053
|
label: "Number of Points:"
|
|
31932
32054
|
}, /*#__PURE__*/React__namespace.createElement(GraphPointsCountSelector, {
|
|
31933
32055
|
numPoints: this.props.correct?.numPoints,
|
|
@@ -32055,6 +32177,10 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32055
32177
|
}
|
|
32056
32178
|
});
|
|
32057
32179
|
}
|
|
32180
|
+
})), (this.props.graph?.type === "linear" || this.props.graph?.type === "ray") && this.props.apiOptions.flags?.mafs?.["start-coords-ui"] && /*#__PURE__*/React__namespace.createElement(StartCoordSettings, _extends({}, this.props.graph, {
|
|
32181
|
+
range: this.props.range,
|
|
32182
|
+
step: this.props.step,
|
|
32183
|
+
onChange: this.changeStartCoords
|
|
32058
32184
|
})), /*#__PURE__*/React__namespace.createElement(InteractiveGraphSettings, {
|
|
32059
32185
|
box: getInteractiveBoxFromSizeClass(sizeClass),
|
|
32060
32186
|
range: this.props.range,
|
|
@@ -32107,18 +32233,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32107
32233
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
32108
32234
|
value: "congruent",
|
|
32109
32235
|
label: "be congruent"
|
|
32110
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))),
|
|
32111
|
-
label: "Correct answer:"
|
|
32112
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
32113
|
-
style: {
|
|
32114
|
-
fontSize: 12,
|
|
32115
|
-
backgroundColor: "#eee",
|
|
32116
|
-
paddingInline: wonderBlocksTokens.spacing.xxSmall_6,
|
|
32117
|
-
borderColor: "#ccc",
|
|
32118
|
-
borderStyle: "solid",
|
|
32119
|
-
borderWidth: 1
|
|
32120
|
-
}
|
|
32121
|
-
}, equationString), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer."))), graph,
|
|
32236
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))),
|
|
32122
32237
|
// Only show the "Add locked figure" dropdown if the graph
|
|
32123
32238
|
// is using Mafs.
|
|
32124
32239
|
this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
|
|
@@ -32137,6 +32252,23 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32137
32252
|
correct: correct
|
|
32138
32253
|
});
|
|
32139
32254
|
};
|
|
32255
|
+
changeStartCoords = coords => {
|
|
32256
|
+
if (this.props.graph?.type !== "linear" && this.props.graph?.type !== "ray") {
|
|
32257
|
+
return;
|
|
32258
|
+
}
|
|
32259
|
+
const graph = {
|
|
32260
|
+
...this.props.graph,
|
|
32261
|
+
startCoords: coords
|
|
32262
|
+
};
|
|
32263
|
+
this.props.onChange({
|
|
32264
|
+
graph: graph
|
|
32265
|
+
});
|
|
32266
|
+
};
|
|
32267
|
+
|
|
32268
|
+
// serialize() is what makes copy/paste work. All the properties included
|
|
32269
|
+
// in the serialization json are included when, for example, a graph
|
|
32270
|
+
// is copied from the question editor and pasted into the hint editor
|
|
32271
|
+
// (double brackets in the markdown).
|
|
32140
32272
|
serialize() {
|
|
32141
32273
|
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showRuler", "showTooltips", "rulerLabel", "rulerTicks", "range", "gridStep", "snapStep", "lockedFigures");
|
|
32142
32274
|
|
|
@@ -32147,7 +32279,8 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32147
32279
|
const correct = graph && graph.getUserInput();
|
|
32148
32280
|
___default["default"].extend(json, {
|
|
32149
32281
|
graph: {
|
|
32150
|
-
type: correct.type
|
|
32282
|
+
type: correct.type,
|
|
32283
|
+
startCoords: this.props.graph?.startCoords
|
|
32151
32284
|
},
|
|
32152
32285
|
correct: correct
|
|
32153
32286
|
});
|