@khanacademy/perseus-editor 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/start-coord-settings.d.ts +9 -0
- package/dist/es/index.js +296 -195
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +289 -185
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +577 -72
- 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.1.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
|
}
|
|
@@ -29798,17 +29800,17 @@ const LockedFigureSelect = props => {
|
|
|
29798
29800
|
} = props;
|
|
29799
29801
|
const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
|
|
29800
29802
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29801
|
-
style: styles$
|
|
29803
|
+
style: styles$x.container
|
|
29802
29804
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29803
29805
|
menuText: "Add locked figure",
|
|
29804
|
-
style: styles$
|
|
29806
|
+
style: styles$x.addElementSelect
|
|
29805
29807
|
}, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29806
29808
|
key: `${id}-${figureType}`,
|
|
29807
29809
|
label: figureType,
|
|
29808
29810
|
onClick: () => onChange(figureType)
|
|
29809
29811
|
}, figureType))));
|
|
29810
29812
|
};
|
|
29811
|
-
const styles$
|
|
29813
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
29812
29814
|
container: {
|
|
29813
29815
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29814
29816
|
},
|
|
@@ -29839,19 +29841,19 @@ const AngleInput = props => {
|
|
|
29839
29841
|
}
|
|
29840
29842
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29841
29843
|
tag: "label",
|
|
29842
|
-
style: styles$
|
|
29844
|
+
style: styles$w.row
|
|
29843
29845
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29844
29846
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29845
29847
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29846
29848
|
type: "number",
|
|
29847
29849
|
value: angleInput,
|
|
29848
29850
|
onChange: handleAngleChange,
|
|
29849
|
-
style: styles$
|
|
29851
|
+
style: styles$w.textField
|
|
29850
29852
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29851
29853
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29852
29854
|
}));
|
|
29853
29855
|
};
|
|
29854
|
-
const styles$
|
|
29856
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
29855
29857
|
row: {
|
|
29856
29858
|
display: "flex",
|
|
29857
29859
|
flexDirection: "row",
|
|
@@ -29876,6 +29878,12 @@ const CoordinatePairInput = props => {
|
|
|
29876
29878
|
const [coordState, setCoordState] = React__namespace.useState([
|
|
29877
29879
|
// Using strings to make it easier to work with the text fields.
|
|
29878
29880
|
coord[0].toString(), coord[1].toString()]);
|
|
29881
|
+
|
|
29882
|
+
// Update the local state when the props change. (Such as when the graph
|
|
29883
|
+
// type is changed, and the coordinates are reset.)
|
|
29884
|
+
React__namespace.useEffect(() => {
|
|
29885
|
+
setCoordState([coord[0].toString(), coord[1].toString()]);
|
|
29886
|
+
}, [coord]);
|
|
29879
29887
|
function handleCoordChange(newValue, coordIndex) {
|
|
29880
29888
|
// Update the local state (update the input field value).
|
|
29881
29889
|
const newCoordState = [...coordState];
|
|
@@ -29894,32 +29902,32 @@ const CoordinatePairInput = props => {
|
|
|
29894
29902
|
onChange(newCoords);
|
|
29895
29903
|
}
|
|
29896
29904
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29897
|
-
style: [styles$
|
|
29905
|
+
style: [styles$v.row, style]
|
|
29898
29906
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29899
29907
|
tag: "label",
|
|
29900
|
-
style: styles$
|
|
29908
|
+
style: styles$v.row
|
|
29901
29909
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29902
29910
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29903
29911
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29904
29912
|
type: "number",
|
|
29905
29913
|
value: coordState[0],
|
|
29906
29914
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29907
|
-
style: [styles$
|
|
29915
|
+
style: [styles$v.textField, error ? styles$v.errorField : undefined]
|
|
29908
29916
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29909
29917
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29910
29918
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29911
29919
|
tag: "label",
|
|
29912
|
-
style: styles$
|
|
29920
|
+
style: styles$v.row
|
|
29913
29921
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29914
29922
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29915
29923
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29916
29924
|
type: "number",
|
|
29917
29925
|
value: coordState[1],
|
|
29918
29926
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29919
|
-
style: [styles$
|
|
29927
|
+
style: [styles$v.textField, error ? styles$v.errorField : undefined]
|
|
29920
29928
|
})));
|
|
29921
29929
|
};
|
|
29922
|
-
const styles$
|
|
29930
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
29923
29931
|
row: {
|
|
29924
29932
|
display: "flex",
|
|
29925
29933
|
flexDirection: "row",
|
|
@@ -29952,14 +29960,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29952
29960
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29953
29961
|
expanded: expanded,
|
|
29954
29962
|
onToggle: onToggle,
|
|
29955
|
-
style: [styles$
|
|
29956
|
-
headerStyle: styles$
|
|
29963
|
+
style: [styles$u.container, containerStyle],
|
|
29964
|
+
headerStyle: styles$u.accordionHeader,
|
|
29957
29965
|
header: header
|
|
29958
29966
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29959
|
-
style: [styles$
|
|
29967
|
+
style: [styles$u.accordionPanel, panelStyle]
|
|
29960
29968
|
}, children)));
|
|
29961
29969
|
};
|
|
29962
|
-
const styles$
|
|
29970
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
29963
29971
|
container: {
|
|
29964
29972
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29965
29973
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -29990,13 +29998,13 @@ const ColorSwatch = props => {
|
|
|
29990
29998
|
"aria-label":
|
|
29991
29999
|
// Don't include an aria label for decorative circles.
|
|
29992
30000
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
29993
|
-
style: [styles$
|
|
30001
|
+
style: [styles$t.colorSwatch, {
|
|
29994
30002
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
29995
30003
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
29996
30004
|
}]
|
|
29997
30005
|
});
|
|
29998
30006
|
};
|
|
29999
|
-
const styles$
|
|
30007
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
30000
30008
|
colorSwatch: {
|
|
30001
30009
|
// Add a white outline so that the color swatch is visible when
|
|
30002
30010
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30015,10 +30023,10 @@ const ColorSelect = props => {
|
|
|
30015
30023
|
onChange
|
|
30016
30024
|
} = props;
|
|
30017
30025
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30018
|
-
style: [styles$
|
|
30026
|
+
style: [styles$s.row, style]
|
|
30019
30027
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30020
30028
|
tag: "label",
|
|
30021
|
-
style: styles$
|
|
30029
|
+
style: styles$s.row
|
|
30022
30030
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30023
30031
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30024
30032
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30037,7 +30045,7 @@ const ColorSelect = props => {
|
|
|
30037
30045
|
})
|
|
30038
30046
|
}, colorName)))));
|
|
30039
30047
|
};
|
|
30040
|
-
const styles$
|
|
30048
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
30041
30049
|
row: {
|
|
30042
30050
|
display: "flex",
|
|
30043
30051
|
flexDirection: "row",
|
|
@@ -30053,17 +30061,17 @@ const EllipseSwatch = props => {
|
|
|
30053
30061
|
} = props;
|
|
30054
30062
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30055
30063
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30056
|
-
style: [styles$
|
|
30064
|
+
style: [styles$r.container, {
|
|
30057
30065
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30058
30066
|
}]
|
|
30059
30067
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30060
|
-
style: [styles$
|
|
30068
|
+
style: [styles$r.innerCircle, {
|
|
30061
30069
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30062
30070
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30063
30071
|
}]
|
|
30064
30072
|
}));
|
|
30065
30073
|
};
|
|
30066
|
-
const styles$
|
|
30074
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
30067
30075
|
container: {
|
|
30068
30076
|
// Add a white outline so that the color swatch is visible when
|
|
30069
30077
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30094,40 +30102,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30094
30102
|
onRemove
|
|
30095
30103
|
} = props;
|
|
30096
30104
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30097
|
-
style: styles$
|
|
30105
|
+
style: styles$q.container
|
|
30098
30106
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30099
30107
|
startIcon: trashIcon__default["default"],
|
|
30100
30108
|
"aria-label": `Delete locked ${figureType}`,
|
|
30101
30109
|
onClick: onRemove,
|
|
30102
30110
|
kind: "tertiary",
|
|
30103
|
-
style: styles$
|
|
30111
|
+
style: styles$q.deleteButton
|
|
30104
30112
|
}, "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
30113
|
icon: caretDoubleUpIcon__default["default"],
|
|
30106
30114
|
size: "small",
|
|
30107
30115
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30108
30116
|
onClick: () => onMove("back"),
|
|
30109
|
-
style: styles$
|
|
30117
|
+
style: styles$q.iconButton
|
|
30110
30118
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30111
30119
|
icon: caretUpIcon__default["default"],
|
|
30112
30120
|
size: "small",
|
|
30113
30121
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30114
30122
|
onClick: () => onMove("backward"),
|
|
30115
|
-
style: styles$
|
|
30123
|
+
style: styles$q.iconButton
|
|
30116
30124
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30117
30125
|
icon: caretDownIcon__default["default"],
|
|
30118
30126
|
size: "small",
|
|
30119
30127
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30120
30128
|
onClick: () => onMove("forward"),
|
|
30121
|
-
style: styles$
|
|
30129
|
+
style: styles$q.iconButton
|
|
30122
30130
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30123
30131
|
icon: caretDoubleDownIcon__default["default"],
|
|
30124
30132
|
size: "small",
|
|
30125
30133
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30126
30134
|
onClick: () => onMove("front"),
|
|
30127
|
-
style: styles$
|
|
30135
|
+
style: styles$q.iconButton
|
|
30128
30136
|
})));
|
|
30129
30137
|
};
|
|
30130
|
-
const styles$
|
|
30138
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30131
30139
|
container: {
|
|
30132
30140
|
width: "100%",
|
|
30133
30141
|
flexDirection: "row",
|
|
@@ -30174,7 +30182,7 @@ const LockedEllipseSettings = props => {
|
|
|
30174
30182
|
/*#__PURE__*/
|
|
30175
30183
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30176
30184
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30177
|
-
style: styles$
|
|
30185
|
+
style: styles$p.row
|
|
30178
30186
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30179
30187
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30180
30188
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30183,19 +30191,19 @@ const LockedEllipseSettings = props => {
|
|
|
30183
30191
|
strokeStyle: strokeStyle
|
|
30184
30192
|
}))
|
|
30185
30193
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30186
|
-
style: styles$
|
|
30194
|
+
style: styles$p.row
|
|
30187
30195
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30188
30196
|
coord: center,
|
|
30189
|
-
style: styles$
|
|
30197
|
+
style: styles$p.spaceUnder,
|
|
30190
30198
|
onChange: newCoords => onChangeProps({
|
|
30191
30199
|
center: newCoords
|
|
30192
30200
|
})
|
|
30193
30201
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30194
|
-
style: styles$
|
|
30202
|
+
style: styles$p.spaceUnder
|
|
30195
30203
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30196
30204
|
coord: radius,
|
|
30197
30205
|
labels: ["x radius", "y radius"],
|
|
30198
|
-
style: styles$
|
|
30206
|
+
style: styles$p.spaceUnder,
|
|
30199
30207
|
onChange: newCoords => onChangeProps({
|
|
30200
30208
|
radius: newCoords
|
|
30201
30209
|
})
|
|
@@ -30207,7 +30215,7 @@ const LockedEllipseSettings = props => {
|
|
|
30207
30215
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30208
30216
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30209
30217
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30210
|
-
style: [styles$
|
|
30218
|
+
style: [styles$p.row, styles$p.spaceUnder]
|
|
30211
30219
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30212
30220
|
selectedValue: color,
|
|
30213
30221
|
onChange: handleColorChange
|
|
@@ -30215,7 +30223,7 @@ const LockedEllipseSettings = props => {
|
|
|
30215
30223
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30216
30224
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30217
30225
|
tag: "label",
|
|
30218
|
-
style: styles$
|
|
30226
|
+
style: styles$p.row
|
|
30219
30227
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30220
30228
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30221
30229
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30232,7 +30240,7 @@ const LockedEllipseSettings = props => {
|
|
|
30232
30240
|
label: option
|
|
30233
30241
|
}, option))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30234
30242
|
tag: "label",
|
|
30235
|
-
style: styles$
|
|
30243
|
+
style: styles$p.row
|
|
30236
30244
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30237
30245
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30238
30246
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30256,7 +30264,7 @@ const LockedEllipseSettings = props => {
|
|
|
30256
30264
|
onRemove: onRemove
|
|
30257
30265
|
}));
|
|
30258
30266
|
};
|
|
30259
|
-
const styles$
|
|
30267
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30260
30268
|
row: {
|
|
30261
30269
|
display: "flex",
|
|
30262
30270
|
flexDirection: "row",
|
|
@@ -30277,7 +30285,7 @@ const LabeledSwitch = props => {
|
|
|
30277
30285
|
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30278
30286
|
const switchId = ids.get("switch");
|
|
30279
30287
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30280
|
-
style: [styles$
|
|
30288
|
+
style: [styles$o.row, style]
|
|
30281
30289
|
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30282
30290
|
id: switchId,
|
|
30283
30291
|
checked: checked,
|
|
@@ -30289,7 +30297,7 @@ const LabeledSwitch = props => {
|
|
|
30289
30297
|
htmlFor: switchId
|
|
30290
30298
|
}, label));
|
|
30291
30299
|
};
|
|
30292
|
-
const styles$
|
|
30300
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30293
30301
|
row: {
|
|
30294
30302
|
flexDirection: "row",
|
|
30295
30303
|
alignItems: "center"
|
|
@@ -30323,13 +30331,13 @@ const DefiningPointSettings = props => {
|
|
|
30323
30331
|
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30324
30332
|
expanded: expanded,
|
|
30325
30333
|
onToggle: onToggle,
|
|
30326
|
-
containerStyle: styles$
|
|
30327
|
-
panelStyle: styles$
|
|
30334
|
+
containerStyle: styles$n.container,
|
|
30335
|
+
panelStyle: styles$n.accordionPanel,
|
|
30328
30336
|
header:
|
|
30329
30337
|
/*#__PURE__*/
|
|
30330
30338
|
// Summary: Point, coords, color (filled/open)
|
|
30331
30339
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30332
|
-
style: styles$
|
|
30340
|
+
style: styles$n.row
|
|
30333
30341
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30334
30342
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30335
30343
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30339,7 +30347,7 @@ const DefiningPointSettings = props => {
|
|
|
30339
30347
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30340
30348
|
coord: coord,
|
|
30341
30349
|
error: !!error,
|
|
30342
|
-
style: styles$
|
|
30350
|
+
style: styles$n.spaceUnder,
|
|
30343
30351
|
onChange: newCoords => {
|
|
30344
30352
|
onChangeProps({
|
|
30345
30353
|
coord: newCoords
|
|
@@ -30348,12 +30356,12 @@ const DefiningPointSettings = props => {
|
|
|
30348
30356
|
}), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30349
30357
|
label: "show point on graph",
|
|
30350
30358
|
checked: !!showPoint,
|
|
30351
|
-
style: showPoint && styles$
|
|
30359
|
+
style: showPoint && styles$n.spaceUnder,
|
|
30352
30360
|
onChange: onTogglePoint
|
|
30353
30361
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30354
30362
|
selectedValue: pointColor,
|
|
30355
30363
|
onChange: handleColorChange,
|
|
30356
|
-
style: styles$
|
|
30364
|
+
style: styles$n.spaceUnder
|
|
30357
30365
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30358
30366
|
label: "open point",
|
|
30359
30367
|
checked: !filled,
|
|
@@ -30364,7 +30372,7 @@ const DefiningPointSettings = props => {
|
|
|
30364
30372
|
}
|
|
30365
30373
|
})));
|
|
30366
30374
|
};
|
|
30367
|
-
const styles$
|
|
30375
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30368
30376
|
container: {
|
|
30369
30377
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30370
30378
|
marginBottom: 0,
|
|
@@ -30391,15 +30399,15 @@ const LineSwatch = props => {
|
|
|
30391
30399
|
lineStyle
|
|
30392
30400
|
} = props;
|
|
30393
30401
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30394
|
-
style: styles$
|
|
30402
|
+
style: styles$m.container
|
|
30395
30403
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30396
30404
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30397
|
-
style: [styles$
|
|
30405
|
+
style: [styles$m.lineSwatch, {
|
|
30398
30406
|
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30399
30407
|
}]
|
|
30400
30408
|
}));
|
|
30401
30409
|
};
|
|
30402
|
-
const styles$
|
|
30410
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30403
30411
|
container: {
|
|
30404
30412
|
backgroundColor: wonderBlocksTokens.color.white,
|
|
30405
30413
|
justifyContent: "center",
|
|
@@ -30458,7 +30466,7 @@ const LockedLineSettings = props => {
|
|
|
30458
30466
|
expanded: props.expanded,
|
|
30459
30467
|
onToggle: props.onToggle,
|
|
30460
30468
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30461
|
-
style: styles$
|
|
30469
|
+
style: styles$l.row
|
|
30462
30470
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30463
30471
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30464
30472
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30467,7 +30475,7 @@ const LockedLineSettings = props => {
|
|
|
30467
30475
|
}))
|
|
30468
30476
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30469
30477
|
tag: "label",
|
|
30470
|
-
style: [styles$
|
|
30478
|
+
style: [styles$l.row, styles$l.spaceUnder]
|
|
30471
30479
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30472
30480
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30473
30481
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30488,7 +30496,7 @@ const LockedLineSettings = props => {
|
|
|
30488
30496
|
value: "segment",
|
|
30489
30497
|
label: "segment"
|
|
30490
30498
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30491
|
-
style: styles$
|
|
30499
|
+
style: styles$l.row
|
|
30492
30500
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30493
30501
|
selectedValue: lineColor,
|
|
30494
30502
|
onChange: handleColorChange
|
|
@@ -30496,7 +30504,7 @@ const LockedLineSettings = props => {
|
|
|
30496
30504
|
size: wonderBlocksTokens.spacing.small_12
|
|
30497
30505
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30498
30506
|
tag: "label",
|
|
30499
|
-
style: styles$
|
|
30507
|
+
style: styles$l.row
|
|
30500
30508
|
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30501
30509
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30502
30510
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30507,7 +30515,7 @@ const LockedLineSettings = props => {
|
|
|
30507
30515
|
// Placeholder is required, but never gets used.
|
|
30508
30516
|
,
|
|
30509
30517
|
placeholder: "",
|
|
30510
|
-
style: styles$
|
|
30518
|
+
style: styles$l.selectMarginOffset
|
|
30511
30519
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30512
30520
|
value: "solid",
|
|
30513
30521
|
label: "solid"
|
|
@@ -30515,7 +30523,7 @@ const LockedLineSettings = props => {
|
|
|
30515
30523
|
value: "dashed",
|
|
30516
30524
|
label: "dashed"
|
|
30517
30525
|
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30518
|
-
style: styles$
|
|
30526
|
+
style: styles$l.errorText
|
|
30519
30527
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30520
30528
|
label: "Point 1",
|
|
30521
30529
|
showPoint: showPoint1,
|
|
@@ -30541,7 +30549,7 @@ const LockedLineSettings = props => {
|
|
|
30541
30549
|
onRemove: onRemove
|
|
30542
30550
|
}));
|
|
30543
30551
|
};
|
|
30544
|
-
const styles$
|
|
30552
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
30545
30553
|
row: {
|
|
30546
30554
|
display: "flex",
|
|
30547
30555
|
flexDirection: "row",
|
|
@@ -30586,7 +30594,7 @@ const LockedPointSettings = props => {
|
|
|
30586
30594
|
/*#__PURE__*/
|
|
30587
30595
|
// Summary: Point, coords, color (filled/open)
|
|
30588
30596
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30589
|
-
style: styles$
|
|
30597
|
+
style: styles$k.row
|
|
30590
30598
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30591
30599
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30592
30600
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30595,7 +30603,7 @@ const LockedPointSettings = props => {
|
|
|
30595
30603
|
}))
|
|
30596
30604
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30597
30605
|
coord: coord,
|
|
30598
|
-
style: styles$
|
|
30606
|
+
style: styles$k.spaceUnder,
|
|
30599
30607
|
onChange: newCoord => {
|
|
30600
30608
|
onChangeProps({
|
|
30601
30609
|
coord: newCoord
|
|
@@ -30604,7 +30612,7 @@ const LockedPointSettings = props => {
|
|
|
30604
30612
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30605
30613
|
selectedValue: pointColor,
|
|
30606
30614
|
onChange: handleColorChange,
|
|
30607
|
-
style: styles$
|
|
30615
|
+
style: styles$k.spaceUnder
|
|
30608
30616
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30609
30617
|
label: "open point",
|
|
30610
30618
|
checked: !filled,
|
|
@@ -30620,7 +30628,7 @@ const LockedPointSettings = props => {
|
|
|
30620
30628
|
onRemove: onRemove
|
|
30621
30629
|
}));
|
|
30622
30630
|
};
|
|
30623
|
-
const styles$
|
|
30631
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
30624
30632
|
row: {
|
|
30625
30633
|
flexDirection: "row",
|
|
30626
30634
|
alignItems: "center"
|
|
@@ -30638,17 +30646,17 @@ const PolygonSwatch = props => {
|
|
|
30638
30646
|
} = props;
|
|
30639
30647
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30640
30648
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30641
|
-
style: [styles$
|
|
30649
|
+
style: [styles$j.container, {
|
|
30642
30650
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30643
30651
|
}]
|
|
30644
30652
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30645
|
-
style: [styles$
|
|
30653
|
+
style: [styles$j.innerSquare, {
|
|
30646
30654
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30647
30655
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30648
30656
|
}]
|
|
30649
30657
|
}));
|
|
30650
30658
|
};
|
|
30651
|
-
const styles$
|
|
30659
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
30652
30660
|
container: {
|
|
30653
30661
|
// Add a white outline so that the color swatch is visible when
|
|
30654
30662
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30690,7 +30698,7 @@ const LockedPolygonSettings = props => {
|
|
|
30690
30698
|
/*#__PURE__*/
|
|
30691
30699
|
// Summary: Polygon, number of sides, style swatch
|
|
30692
30700
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30693
|
-
style: styles$
|
|
30701
|
+
style: styles$i.row
|
|
30694
30702
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30695
30703
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30696
30704
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30699,7 +30707,7 @@ const LockedPolygonSettings = props => {
|
|
|
30699
30707
|
strokeStyle: strokeStyle
|
|
30700
30708
|
}))
|
|
30701
30709
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30702
|
-
style: [styles$
|
|
30710
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30703
30711
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30704
30712
|
selectedValue: color,
|
|
30705
30713
|
onChange: handleColorChange
|
|
@@ -30707,7 +30715,7 @@ const LockedPolygonSettings = props => {
|
|
|
30707
30715
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30708
30716
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30709
30717
|
tag: "label",
|
|
30710
|
-
style: styles$
|
|
30718
|
+
style: styles$i.row
|
|
30711
30719
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30712
30720
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30713
30721
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30724,7 +30732,7 @@ const LockedPolygonSettings = props => {
|
|
|
30724
30732
|
label: option
|
|
30725
30733
|
}, option))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30726
30734
|
tag: "label",
|
|
30727
|
-
style: [styles$
|
|
30735
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30728
30736
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30729
30737
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30730
30738
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30747,17 +30755,17 @@ const LockedPolygonSettings = props => {
|
|
|
30747
30755
|
onChange: newValue => onChangeProps({
|
|
30748
30756
|
showVertices: newValue
|
|
30749
30757
|
}),
|
|
30750
|
-
style: styles$
|
|
30758
|
+
style: styles$i.spaceUnder
|
|
30751
30759
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30752
30760
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30753
30761
|
expanded: true,
|
|
30754
|
-
containerStyle: styles$
|
|
30755
|
-
panelStyle: styles$
|
|
30762
|
+
containerStyle: styles$i.pointAccordionContainer,
|
|
30763
|
+
panelStyle: styles$i.pointAccordionPanel
|
|
30756
30764
|
}, points.map((point, index) => {
|
|
30757
30765
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30758
30766
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30759
30767
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30760
|
-
style: [styles$
|
|
30768
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30761
30769
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30762
30770
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30763
30771
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30785,7 +30793,7 @@ const LockedPolygonSettings = props => {
|
|
|
30785
30793
|
points: newPoints
|
|
30786
30794
|
});
|
|
30787
30795
|
},
|
|
30788
|
-
style: styles$
|
|
30796
|
+
style: styles$i.icon
|
|
30789
30797
|
}));
|
|
30790
30798
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30791
30799
|
kind: "tertiary",
|
|
@@ -30802,7 +30810,7 @@ const LockedPolygonSettings = props => {
|
|
|
30802
30810
|
onRemove: onRemove
|
|
30803
30811
|
}));
|
|
30804
30812
|
};
|
|
30805
|
-
const styles$
|
|
30813
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
30806
30814
|
row: {
|
|
30807
30815
|
display: "flex",
|
|
30808
30816
|
flexDirection: "row",
|
|
@@ -30860,7 +30868,7 @@ const LockedVectorSettings = props => {
|
|
|
30860
30868
|
expanded: props.expanded,
|
|
30861
30869
|
onToggle: props.onToggle,
|
|
30862
30870
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30863
|
-
style: styles$
|
|
30871
|
+
style: styles$h.row
|
|
30864
30872
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30865
30873
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30866
30874
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30868,19 +30876,19 @@ const LockedVectorSettings = props => {
|
|
|
30868
30876
|
lineStyle: "solid"
|
|
30869
30877
|
}))
|
|
30870
30878
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30871
|
-
style: [styles$
|
|
30879
|
+
style: [styles$h.row, styles$h.spaceUnder]
|
|
30872
30880
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30873
30881
|
selectedValue: lineColor,
|
|
30874
30882
|
onChange: handleColorChange
|
|
30875
30883
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30876
|
-
style: styles$
|
|
30884
|
+
style: styles$h.errorText
|
|
30877
30885
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30878
30886
|
expanded: true // Initial state is expanded
|
|
30879
30887
|
,
|
|
30880
|
-
containerStyle: styles$
|
|
30881
|
-
panelStyle: styles$
|
|
30888
|
+
containerStyle: styles$h.container,
|
|
30889
|
+
panelStyle: styles$h.accordionPanel,
|
|
30882
30890
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30883
|
-
style: styles$
|
|
30891
|
+
style: styles$h.row
|
|
30884
30892
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30885
30893
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30886
30894
|
coord: tail,
|
|
@@ -30891,10 +30899,10 @@ const LockedVectorSettings = props => {
|
|
|
30891
30899
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30892
30900
|
expanded: true // Initial state is expanded
|
|
30893
30901
|
,
|
|
30894
|
-
containerStyle: styles$
|
|
30895
|
-
panelStyle: styles$
|
|
30902
|
+
containerStyle: styles$h.container,
|
|
30903
|
+
panelStyle: styles$h.accordionPanel,
|
|
30896
30904
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30897
|
-
style: styles$
|
|
30905
|
+
style: styles$h.row
|
|
30898
30906
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30899
30907
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30900
30908
|
coord: tip,
|
|
@@ -30909,7 +30917,7 @@ const LockedVectorSettings = props => {
|
|
|
30909
30917
|
onRemove: onRemove
|
|
30910
30918
|
}));
|
|
30911
30919
|
};
|
|
30912
|
-
const styles$
|
|
30920
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
30913
30921
|
accordionPanel: {
|
|
30914
30922
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30915
30923
|
},
|
|
@@ -31080,7 +31088,7 @@ const LockedFiguresSection = props => {
|
|
|
31080
31088
|
onRemove: () => removeLockedFigure(index)
|
|
31081
31089
|
}));
|
|
31082
31090
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31083
|
-
style: styles$
|
|
31091
|
+
style: styles$g.buttonContainer
|
|
31084
31092
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31085
31093
|
showM2Features: props.showM2Features,
|
|
31086
31094
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -31091,10 +31099,10 @@ const LockedFiguresSection = props => {
|
|
|
31091
31099
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31092
31100
|
kind: "secondary",
|
|
31093
31101
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31094
|
-
style: styles$
|
|
31102
|
+
style: styles$g.button
|
|
31095
31103
|
}, buttonLabel)));
|
|
31096
31104
|
};
|
|
31097
|
-
const styles$
|
|
31105
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31098
31106
|
buttonContainer: {
|
|
31099
31107
|
flexDirection: "row",
|
|
31100
31108
|
alignItems: "center"
|
|
@@ -31130,7 +31138,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31130
31138
|
// Never uses placeholder, always has value
|
|
31131
31139
|
,
|
|
31132
31140
|
placeholder: "",
|
|
31133
|
-
style: styles$
|
|
31141
|
+
style: styles$f.singleSelectShort
|
|
31134
31142
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31135
31143
|
key: n,
|
|
31136
31144
|
value: `${n}`,
|
|
@@ -31141,7 +31149,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31141
31149
|
label: "unlimited"
|
|
31142
31150
|
})]);
|
|
31143
31151
|
};
|
|
31144
|
-
const styles$
|
|
31152
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31145
31153
|
singleSelectShort: {
|
|
31146
31154
|
// Non-standard spacing, but it's the smallest we can go
|
|
31147
31155
|
// without running into styling issues with the dropdown.
|
|
@@ -31154,7 +31162,7 @@ const GraphTypeSelector = props => {
|
|
|
31154
31162
|
selectedValue: props.graphType,
|
|
31155
31163
|
onChange: props.onChange,
|
|
31156
31164
|
placeholder: "Select a graph type",
|
|
31157
|
-
style: styles$
|
|
31165
|
+
style: styles$e.singleSelectShort
|
|
31158
31166
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31159
31167
|
value: "linear",
|
|
31160
31168
|
label: "Linear function"
|
|
@@ -31187,7 +31195,7 @@ const GraphTypeSelector = props => {
|
|
|
31187
31195
|
label: "Angle"
|
|
31188
31196
|
}));
|
|
31189
31197
|
};
|
|
31190
|
-
const styles$
|
|
31198
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31191
31199
|
singleSelectShort: {
|
|
31192
31200
|
// Non-standard spacing, but it's the smallest we can go
|
|
31193
31201
|
// without running into styling issues with the dropdown.
|
|
@@ -31634,10 +31642,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31634
31642
|
onChange: this.change
|
|
31635
31643
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31636
31644
|
label: "Background image URL:",
|
|
31637
|
-
style: styles$
|
|
31645
|
+
style: styles$d.resetSpaceTop
|
|
31638
31646
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31639
31647
|
type: "text",
|
|
31640
|
-
className: aphrodite.css(styles$
|
|
31648
|
+
className: aphrodite.css(styles$d.backgroundUrlInput),
|
|
31641
31649
|
ref: this.bgUrlRef,
|
|
31642
31650
|
value: this.state.backgroundImage.url || "",
|
|
31643
31651
|
onChange: e => {
|
|
@@ -31653,28 +31661,28 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31653
31661
|
onKeyPress: this.changeBackgroundUrl,
|
|
31654
31662
|
onBlur: this.changeBackgroundUrl
|
|
31655
31663
|
}), /*#__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$
|
|
31664
|
+
style: styles$d.rulerSection
|
|
31657
31665
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31658
|
-
style: styles$
|
|
31666
|
+
style: styles$d.checkboxRow
|
|
31659
31667
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31660
31668
|
label: "Show ruler",
|
|
31661
31669
|
showRuler: this.props.showRuler,
|
|
31662
31670
|
onChange: this.change,
|
|
31663
|
-
style: styles$
|
|
31671
|
+
style: styles$d.resetSpaceTop
|
|
31664
31672
|
}), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31665
31673
|
label: "Show protractor",
|
|
31666
31674
|
showProtractor: this.props.showProtractor,
|
|
31667
31675
|
onChange: this.change,
|
|
31668
|
-
style: styles$
|
|
31676
|
+
style: styles$d.resetSpaceTop
|
|
31669
31677
|
})), (this.props.showRuler || this.props.showProtractor) && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31670
31678
|
layout: "floating",
|
|
31671
31679
|
text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
|
|
31672
31680
|
kind: "warning"
|
|
31673
31681
|
}), this.props.showRuler && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31674
|
-
style: styles$
|
|
31682
|
+
style: styles$d.spaceTop
|
|
31675
31683
|
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31676
31684
|
label: "Ruler label:",
|
|
31677
|
-
style: styles$
|
|
31685
|
+
style: styles$d.resetSpaceTop
|
|
31678
31686
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31679
31687
|
id: "ruler-label-select",
|
|
31680
31688
|
selectedValue: this.props.rulerLabel,
|
|
@@ -31684,7 +31692,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31684
31692
|
});
|
|
31685
31693
|
},
|
|
31686
31694
|
placeholder: "None",
|
|
31687
|
-
style: styles$
|
|
31695
|
+
style: styles$d.singleSelectShort
|
|
31688
31696
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31689
31697
|
value: "",
|
|
31690
31698
|
label: "None",
|
|
@@ -31725,7 +31733,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31725
31733
|
});
|
|
31726
31734
|
},
|
|
31727
31735
|
placeholder: "10",
|
|
31728
|
-
style: styles$
|
|
31736
|
+
style: styles$d.singleSelectShort
|
|
31729
31737
|
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31730
31738
|
key: value,
|
|
31731
31739
|
value: `${value}`,
|
|
@@ -31733,7 +31741,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31733
31741
|
}))))))));
|
|
31734
31742
|
}
|
|
31735
31743
|
}
|
|
31736
|
-
const styles$
|
|
31744
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
31737
31745
|
resetSpaceTop: {
|
|
31738
31746
|
marginTop: 0
|
|
31739
31747
|
},
|
|
@@ -31780,14 +31788,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31780
31788
|
const num = +newValue;
|
|
31781
31789
|
onChange(num);
|
|
31782
31790
|
},
|
|
31783
|
-
style: styles$
|
|
31791
|
+
style: styles$c.singleSelectShort
|
|
31784
31792
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31785
31793
|
key: n,
|
|
31786
31794
|
value: `${n}`,
|
|
31787
31795
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31788
31796
|
})));
|
|
31789
31797
|
};
|
|
31790
|
-
const styles$
|
|
31798
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
31791
31799
|
singleSelectShort: {
|
|
31792
31800
|
// Non-standard spacing, but it's the smallest we can go
|
|
31793
31801
|
// without running into styling issues with the dropdown.
|
|
@@ -31795,6 +31803,76 @@ const styles$b = aphrodite.StyleSheet.create({
|
|
|
31795
31803
|
}
|
|
31796
31804
|
});
|
|
31797
31805
|
|
|
31806
|
+
const StartCoordSettingsInner = props => {
|
|
31807
|
+
const {
|
|
31808
|
+
type,
|
|
31809
|
+
startCoords,
|
|
31810
|
+
onChange
|
|
31811
|
+
} = props;
|
|
31812
|
+
|
|
31813
|
+
// Check if coords is of type CollinearTuple
|
|
31814
|
+
switch (type) {
|
|
31815
|
+
case "linear":
|
|
31816
|
+
case "ray":
|
|
31817
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31818
|
+
style: styles$b.tile
|
|
31819
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1"), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31820
|
+
coord: startCoords[0],
|
|
31821
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31822
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31823
|
+
style: styles$b.tile
|
|
31824
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2"), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31825
|
+
coord: startCoords[1],
|
|
31826
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31827
|
+
})));
|
|
31828
|
+
default:
|
|
31829
|
+
return null;
|
|
31830
|
+
}
|
|
31831
|
+
};
|
|
31832
|
+
const StartCoordSettings = props => {
|
|
31833
|
+
const {
|
|
31834
|
+
type,
|
|
31835
|
+
range,
|
|
31836
|
+
step,
|
|
31837
|
+
onChange
|
|
31838
|
+
} = props;
|
|
31839
|
+
const [isOpen, setIsOpen] = React__namespace.useState(true);
|
|
31840
|
+
if (type !== "linear" && type !== "ray") {
|
|
31841
|
+
return null;
|
|
31842
|
+
}
|
|
31843
|
+
const defaultStartCoords = perseus.getLineCoords({
|
|
31844
|
+
type: type
|
|
31845
|
+
}, range, step);
|
|
31846
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31847
|
+
style: styles$b.container
|
|
31848
|
+
}, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31849
|
+
title: "Start coordinates",
|
|
31850
|
+
isOpen: isOpen,
|
|
31851
|
+
onToggle: () => setIsOpen(!isOpen)
|
|
31852
|
+
}), isOpen && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(StartCoordSettingsInner, {
|
|
31853
|
+
type: type,
|
|
31854
|
+
startCoords: props.startCoords ?? defaultStartCoords,
|
|
31855
|
+
onChange: onChange
|
|
31856
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31857
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31858
|
+
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31859
|
+
startIcon: arrowCounterClockwise__default["default"],
|
|
31860
|
+
kind: "tertiary",
|
|
31861
|
+
size: "small",
|
|
31862
|
+
onClick: () => {
|
|
31863
|
+
onChange(defaultStartCoords);
|
|
31864
|
+
}
|
|
31865
|
+
}, "Use default start coords")));
|
|
31866
|
+
};
|
|
31867
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
31868
|
+
tile: {
|
|
31869
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31870
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31871
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
31872
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8
|
|
31873
|
+
}
|
|
31874
|
+
});
|
|
31875
|
+
|
|
31798
31876
|
const {
|
|
31799
31877
|
InfoTip: InfoTip$b
|
|
31800
31878
|
} = perseus.components;
|
|
@@ -31881,13 +31959,17 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31881
31959
|
let correct = this.props.correct;
|
|
31882
31960
|
// @ts-expect-error - TS2532 - Object is possibly 'undefined'.
|
|
31883
31961
|
if (correct.type === newProps.graph.type) {
|
|
31884
|
-
correct =
|
|
31962
|
+
correct = {
|
|
31963
|
+
...correct,
|
|
31964
|
+
...newProps.graph
|
|
31965
|
+
};
|
|
31885
31966
|
} else {
|
|
31886
31967
|
// Clear options from previous graph
|
|
31887
31968
|
correct = newProps.graph;
|
|
31888
31969
|
}
|
|
31889
31970
|
this.props.onChange({
|
|
31890
|
-
correct: correct
|
|
31971
|
+
correct: correct,
|
|
31972
|
+
graph: this.props.graph
|
|
31891
31973
|
});
|
|
31892
31974
|
}
|
|
31893
31975
|
};
|
|
@@ -32055,6 +32137,10 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32055
32137
|
}
|
|
32056
32138
|
});
|
|
32057
32139
|
}
|
|
32140
|
+
})), (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, {
|
|
32141
|
+
range: this.props.range,
|
|
32142
|
+
step: this.props.step,
|
|
32143
|
+
onChange: this.changeStartCoords
|
|
32058
32144
|
})), /*#__PURE__*/React__namespace.createElement(InteractiveGraphSettings, {
|
|
32059
32145
|
box: getInteractiveBoxFromSizeClass(sizeClass),
|
|
32060
32146
|
range: this.props.range,
|
|
@@ -32137,6 +32223,23 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32137
32223
|
correct: correct
|
|
32138
32224
|
});
|
|
32139
32225
|
};
|
|
32226
|
+
changeStartCoords = coords => {
|
|
32227
|
+
if (this.props.graph?.type !== "linear" && this.props.graph?.type !== "ray") {
|
|
32228
|
+
return;
|
|
32229
|
+
}
|
|
32230
|
+
const graph = {
|
|
32231
|
+
...this.props.graph,
|
|
32232
|
+
startCoords: coords
|
|
32233
|
+
};
|
|
32234
|
+
this.props.onChange({
|
|
32235
|
+
graph: graph
|
|
32236
|
+
});
|
|
32237
|
+
};
|
|
32238
|
+
|
|
32239
|
+
// serialize() is what makes copy/paste work. All the properties included
|
|
32240
|
+
// in the serialization json are included when, for example, a graph
|
|
32241
|
+
// is copied from the question editor and pasted into the hint editor
|
|
32242
|
+
// (double brackets in the markdown).
|
|
32140
32243
|
serialize() {
|
|
32141
32244
|
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showRuler", "showTooltips", "rulerLabel", "rulerTicks", "range", "gridStep", "snapStep", "lockedFigures");
|
|
32142
32245
|
|
|
@@ -32147,7 +32250,8 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32147
32250
|
const correct = graph && graph.getUserInput();
|
|
32148
32251
|
___default["default"].extend(json, {
|
|
32149
32252
|
graph: {
|
|
32150
|
-
type: correct.type
|
|
32253
|
+
type: correct.type,
|
|
32254
|
+
startCoords: this.props.graph?.startCoords
|
|
32151
32255
|
},
|
|
32152
32256
|
correct: correct
|
|
32153
32257
|
});
|