@khanacademy/perseus-editor 10.0.0 → 11.0.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/all-editors.d.ts +1 -2
- package/dist/components/interactive-graph-settings.d.ts +0 -17
- package/dist/components/start-coords-line.d.ts +8 -0
- package/dist/components/start-coords-multiline.d.ts +9 -0
- package/dist/components/start-coords-settings.d.ts +9 -0
- package/dist/components/util.d.ts +2 -1
- package/dist/components/widget-editor.d.ts +1 -1
- package/dist/es/index.js +418 -643
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +411 -639
- package/dist/index.js.map +1 -1
- package/dist/util/object-utils.d.ts +1 -0
- package/dist/widgets/interactive-graph-editor.d.ts +20 -40
- package/package.json +3 -3
- package/dist/components/start-coord-settings.d.ts +0 -9
- package/dist/widgets/unit-editor.d.ts +0 -33
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
|
|
|
83
83
|
|
|
84
84
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
85
85
|
const libName = "@khanacademy/perseus-editor";
|
|
86
|
-
const libVersion = "
|
|
86
|
+
const libVersion = "11.0.0";
|
|
87
87
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
88
88
|
|
|
89
89
|
function _extends() {
|
|
@@ -260,7 +260,7 @@ const JsonEditor = createReactClass__default["default"]({
|
|
|
260
260
|
});
|
|
261
261
|
|
|
262
262
|
const {
|
|
263
|
-
InlineIcon: InlineIcon$
|
|
263
|
+
InlineIcon: InlineIcon$a
|
|
264
264
|
} = perseus.components;
|
|
265
265
|
class SectionControlButton extends React__namespace.Component {
|
|
266
266
|
render() {
|
|
@@ -278,13 +278,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
278
278
|
role: "button",
|
|
279
279
|
hideDefaultFocusRing: true,
|
|
280
280
|
"aria-label": title,
|
|
281
|
-
style: styles$
|
|
281
|
+
style: styles$I.button
|
|
282
282
|
}, _ref => {
|
|
283
|
-
return /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
283
|
+
return /*#__PURE__*/React__namespace.createElement(InlineIcon$a, icon);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const styles$
|
|
287
|
+
const styles$I = aphrodite.StyleSheet.create({
|
|
288
288
|
button: {
|
|
289
289
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
290
290
|
margin: 2,
|
|
@@ -20607,7 +20607,7 @@ const DragTarget = createReactClass__default["default"]({
|
|
|
20607
20607
|
});
|
|
20608
20608
|
|
|
20609
20609
|
const {
|
|
20610
|
-
InlineIcon: InlineIcon$
|
|
20610
|
+
InlineIcon: InlineIcon$9
|
|
20611
20611
|
} = perseus.components;
|
|
20612
20612
|
const {
|
|
20613
20613
|
iconChevronDown: iconChevronDown$1,
|
|
@@ -20717,7 +20717,7 @@ class WidgetEditor extends React__namespace.Component {
|
|
|
20717
20717
|
className: "perseus-widget-editor-title-id",
|
|
20718
20718
|
href: "#",
|
|
20719
20719
|
onClick: this._toggleWidget
|
|
20720
|
-
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
20720
|
+
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconChevronDown$1) : /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement("input", {
|
|
20721
20721
|
type: "button"
|
|
20722
20722
|
// @ts-expect-error - TS2322 - Type '(e: Event) => void' is not assignable to type 'MouseEventHandler<HTMLInputElement>'.
|
|
20723
20723
|
,
|
|
@@ -20789,13 +20789,13 @@ class WidgetSelect extends React__namespace.Component {
|
|
|
20789
20789
|
* that collapse a region.
|
|
20790
20790
|
*/
|
|
20791
20791
|
function ToggleableCaret(props) {
|
|
20792
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20792
|
+
const iconStyle = props.isExpanded ? styles$H.expanded : styles$H.collapsed;
|
|
20793
20793
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20794
20794
|
icon: caretRight__default["default"],
|
|
20795
20795
|
style: iconStyle
|
|
20796
20796
|
});
|
|
20797
20797
|
}
|
|
20798
|
-
const styles$
|
|
20798
|
+
const styles$H = aphrodite.StyleSheet.create({
|
|
20799
20799
|
collapsed: {
|
|
20800
20800
|
transition: ".15s"
|
|
20801
20801
|
},
|
|
@@ -20825,16 +20825,16 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20825
20825
|
showErrors
|
|
20826
20826
|
} = this.state;
|
|
20827
20827
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20828
|
-
style: styles$
|
|
20828
|
+
style: styles$G.errorContainer
|
|
20829
20829
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20830
|
-
style: styles$
|
|
20830
|
+
style: styles$G.title,
|
|
20831
20831
|
onClick: this.handleToggleTexErrors
|
|
20832
20832
|
}, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
20833
20833
|
isExpanded: showErrors
|
|
20834
20834
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20835
|
-
style: styles$
|
|
20835
|
+
style: styles$G.errorExplanation
|
|
20836
20836
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20837
|
-
style: styles$
|
|
20837
|
+
style: styles$G.error,
|
|
20838
20838
|
key: index
|
|
20839
20839
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20840
20840
|
style: {
|
|
@@ -20843,7 +20843,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20843
20843
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20844
20844
|
}
|
|
20845
20845
|
}
|
|
20846
|
-
const styles$
|
|
20846
|
+
const styles$G = aphrodite.StyleSheet.create({
|
|
20847
20847
|
title: {
|
|
20848
20848
|
backgroundColor: "#eee",
|
|
20849
20849
|
fontSize: "1.25em",
|
|
@@ -21826,7 +21826,7 @@ class IframeContentRenderer extends React__namespace.Component {
|
|
|
21826
21826
|
|
|
21827
21827
|
const {
|
|
21828
21828
|
HUD: HUD$1,
|
|
21829
|
-
InlineIcon: InlineIcon$
|
|
21829
|
+
InlineIcon: InlineIcon$8
|
|
21830
21830
|
} = perseus.components;
|
|
21831
21831
|
const {
|
|
21832
21832
|
iconCircleArrowDown: iconCircleArrowDown$1,
|
|
@@ -21981,7 +21981,7 @@ class ArticleEditor extends React__namespace.Component {
|
|
|
21981
21981
|
onClick: () => {
|
|
21982
21982
|
this._handleAddSectionAfter(this._sections().length - 1);
|
|
21983
21983
|
}
|
|
21984
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
21984
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconPlus$4), " Add a section")));
|
|
21985
21985
|
}
|
|
21986
21986
|
_renderLinterHUD() {
|
|
21987
21987
|
return /*#__PURE__*/React__namespace.createElement(HUD$1, {
|
|
@@ -22134,7 +22134,7 @@ class ArticleEditor extends React__namespace.Component {
|
|
|
22134
22134
|
*/
|
|
22135
22135
|
const {
|
|
22136
22136
|
ButtonGroup: ButtonGroup$5,
|
|
22137
|
-
InlineIcon: InlineIcon$
|
|
22137
|
+
InlineIcon: InlineIcon$7
|
|
22138
22138
|
} = perseus.components;
|
|
22139
22139
|
const {
|
|
22140
22140
|
devices
|
|
@@ -22145,9 +22145,9 @@ const {
|
|
|
22145
22145
|
iconTablet
|
|
22146
22146
|
} = perseus.icons;
|
|
22147
22147
|
const ViewportResizer = props => {
|
|
22148
|
-
const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22149
|
-
const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22150
|
-
const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
22148
|
+
const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconMobilePhone), " Phone");
|
|
22149
|
+
const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTablet), " Tablet");
|
|
22150
|
+
const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconDesktop), " Desktop");
|
|
22151
22151
|
|
|
22152
22152
|
// TODO(david): Allow input of custom viewport sizes.
|
|
22153
22153
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -23481,7 +23481,7 @@ class StructuredItemDiff extends React__namespace.Component {
|
|
|
23481
23481
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
23482
23482
|
const {
|
|
23483
23483
|
InfoTip: InfoTip$m,
|
|
23484
|
-
InlineIcon: InlineIcon$
|
|
23484
|
+
InlineIcon: InlineIcon$6
|
|
23485
23485
|
} = perseus.components;
|
|
23486
23486
|
const {
|
|
23487
23487
|
iconCircleArrowDown,
|
|
@@ -23550,11 +23550,11 @@ class HintEditor extends React__namespace.Component {
|
|
|
23550
23550
|
type: "button",
|
|
23551
23551
|
className: this.props.isLast ? "hidden" : "",
|
|
23552
23552
|
onClick: ___default["default"].partial(this.props.onMove, 1)
|
|
23553
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23553
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconCircleArrowDown)), " ", /*#__PURE__*/React__namespace.createElement("button", {
|
|
23554
23554
|
type: "button",
|
|
23555
23555
|
className: this.props.isFirst ? "hidden" : "",
|
|
23556
23556
|
onClick: ___default["default"].partial(this.props.onMove, -1)
|
|
23557
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23557
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
|
|
23558
23558
|
type: "checkbox"
|
|
23559
23559
|
// @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
|
|
23560
23560
|
,
|
|
@@ -23564,7 +23564,7 @@ class HintEditor extends React__namespace.Component {
|
|
|
23564
23564
|
type: "button",
|
|
23565
23565
|
className: "remove-hint simple-button orange",
|
|
23566
23566
|
onClick: this.props.onRemove
|
|
23567
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23567
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$5), "Remove this hint", " ")));
|
|
23568
23568
|
}
|
|
23569
23569
|
}
|
|
23570
23570
|
/* A single hint-row containing a hint editor and preview */
|
|
@@ -23783,7 +23783,7 @@ class CombinedHintsEditor extends React__namespace.Component {
|
|
|
23783
23783
|
type: "button",
|
|
23784
23784
|
className: "add-hint simple-button orange",
|
|
23785
23785
|
onClick: this.addHint
|
|
23786
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
23786
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconPlus$3), " Add a hint"))));
|
|
23787
23787
|
/* eslint-enable max-len */
|
|
23788
23788
|
}
|
|
23789
23789
|
}
|
|
@@ -24593,12 +24593,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24593
24593
|
...otherProps
|
|
24594
24594
|
} = this.props;
|
|
24595
24595
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24596
|
-
className: aphrodite.css(styles$
|
|
24596
|
+
className: aphrodite.css(styles$F.baseButton, color === "green" && styles$F.green, color === "orange" && styles$F.orange),
|
|
24597
24597
|
onClick: onClick
|
|
24598
24598
|
}, otherProps), children);
|
|
24599
24599
|
}
|
|
24600
24600
|
}
|
|
24601
|
-
const styles$
|
|
24601
|
+
const styles$F = aphrodite.StyleSheet.create({
|
|
24602
24602
|
baseButton: {
|
|
24603
24603
|
top: "0",
|
|
24604
24604
|
fontSize: "11px",
|
|
@@ -24643,7 +24643,7 @@ const styles$D = aphrodite.StyleSheet.create({
|
|
|
24643
24643
|
});
|
|
24644
24644
|
|
|
24645
24645
|
const {
|
|
24646
|
-
InlineIcon: InlineIcon$
|
|
24646
|
+
InlineIcon: InlineIcon$5
|
|
24647
24647
|
} = perseus.components;
|
|
24648
24648
|
const {
|
|
24649
24649
|
iconChevronDown,
|
|
@@ -24811,23 +24811,23 @@ const LeafContainer = _ref2 => {
|
|
|
24811
24811
|
} = _ref2;
|
|
24812
24812
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24813
24813
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24814
|
-
className: aphrodite.css(styles$
|
|
24814
|
+
className: aphrodite.css(styles$E.containerHeader)
|
|
24815
24815
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24816
24816
|
depth: path.length,
|
|
24817
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$E.containerTitle)
|
|
24818
24818
|
}, capitalize(name)));
|
|
24819
24819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24820
|
-
className: aphrodite.css(styles$
|
|
24820
|
+
className: aphrodite.css(styles$E.container)
|
|
24821
24821
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24822
|
-
className: aphrodite.css(styles$
|
|
24822
|
+
className: aphrodite.css(styles$E.row, styles$E.rowHeading)
|
|
24823
24823
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24824
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
24825
24825
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24826
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24826
|
+
className: "pod-title " + aphrodite.css(styles$E.containerHeader)
|
|
24827
24827
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24828
|
-
className: aphrodite.css(styles$
|
|
24828
|
+
className: aphrodite.css(styles$E.containerTitle)
|
|
24829
24829
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24830
|
-
className: aphrodite.css(styles$
|
|
24830
|
+
className: aphrodite.css(styles$E.columnRight)
|
|
24831
24831
|
}, previewHeading)), children);
|
|
24832
24832
|
};
|
|
24833
24833
|
const ArrayContainer = props => {
|
|
@@ -24840,11 +24840,11 @@ const ArrayContainer = props => {
|
|
|
24840
24840
|
actions
|
|
24841
24841
|
} = props;
|
|
24842
24842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24843
|
-
className: aphrodite.css(styles$
|
|
24843
|
+
className: aphrodite.css(styles$E.container)
|
|
24844
24844
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24845
|
-
className: aphrodite.css(styles$
|
|
24845
|
+
className: aphrodite.css(styles$E.columnLeft, styles$E.containerHeader)
|
|
24846
24846
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24847
|
-
className: aphrodite.css(styles$
|
|
24847
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
24848
24848
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24849
24849
|
href: "javascript:void 0",
|
|
24850
24850
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24858,28 +24858,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24858
24858
|
path
|
|
24859
24859
|
} = _ref3;
|
|
24860
24860
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24861
|
-
className: aphrodite.css(styles$
|
|
24861
|
+
className: aphrodite.css(styles$E.containerHeader)
|
|
24862
24862
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24863
24863
|
depth: path.length,
|
|
24864
|
-
className: aphrodite.css(styles$
|
|
24864
|
+
className: aphrodite.css(styles$E.containerTitle)
|
|
24865
24865
|
}, capitalize(name)), controls);
|
|
24866
24866
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24867
|
-
className: aphrodite.css(styles$
|
|
24867
|
+
className: aphrodite.css(styles$E.containerHeader, styles$E.previewCollectionHeader)
|
|
24868
24868
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24869
24869
|
depth: path.length,
|
|
24870
|
-
className: aphrodite.css(styles$
|
|
24870
|
+
className: aphrodite.css(styles$E.containerTitle)
|
|
24871
24871
|
}, capitalize(name)));
|
|
24872
24872
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24873
24873
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24874
|
-
className: aphrodite.css(styles$
|
|
24874
|
+
className: aphrodite.css(styles$E.container)
|
|
24875
24875
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24876
|
-
className: aphrodite.css(styles$
|
|
24876
|
+
className: aphrodite.css(styles$E.row)
|
|
24877
24877
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24878
|
-
className: aphrodite.css(styles$
|
|
24878
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
24879
24879
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24880
|
-
className: aphrodite.css(styles$
|
|
24880
|
+
className: aphrodite.css(styles$E.columnRight)
|
|
24881
24881
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24882
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24882
|
+
className: aphrodite.css(path.length > 0 && styles$E.contentIndent)
|
|
24883
24883
|
}, children));
|
|
24884
24884
|
};
|
|
24885
24885
|
|
|
@@ -24999,11 +24999,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24999
24999
|
className: "framework-perseus"
|
|
25000
25000
|
}, lens(renderers).get(path));
|
|
25001
25001
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$E.row)
|
|
25003
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
25005
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25006
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$E.sticky)
|
|
25007
25007
|
},
|
|
25008
25008
|
/*#__PURE__*/
|
|
25009
25009
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25011,9 +25011,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25011
25011
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25012
25012
|
apiOptions: apiOptions
|
|
25013
25013
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25014
|
-
className: aphrodite.css(styles$
|
|
25014
|
+
className: aphrodite.css(styles$E.columnRight)
|
|
25015
25015
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25016
|
-
className: aphrodite.css(sticky && styles$
|
|
25016
|
+
className: aphrodite.css(sticky && styles$E.sticky)
|
|
25017
25017
|
}, preview))));
|
|
25018
25018
|
});
|
|
25019
25019
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25029,13 +25029,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25029
25029
|
className: "framework-perseus"
|
|
25030
25030
|
}, lens(renderers).get(path));
|
|
25031
25031
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25032
|
-
className: aphrodite.css(styles$
|
|
25032
|
+
className: aphrodite.css(styles$E.row)
|
|
25033
25033
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25034
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
25035
25035
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25036
|
-
className: aphrodite.css(sticky && styles$
|
|
25036
|
+
className: aphrodite.css(sticky && styles$E.sticky)
|
|
25037
25037
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25038
|
-
className: aphrodite.css(styles$
|
|
25038
|
+
className: aphrodite.css(styles$E.hintEditor),
|
|
25039
25039
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25040
25040
|
apiOptions: apiOptions,
|
|
25041
25041
|
showTitle: false,
|
|
@@ -25050,9 +25050,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25050
25050
|
isFirst: true,
|
|
25051
25051
|
isLast: true
|
|
25052
25052
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: aphrodite.css(styles$
|
|
25053
|
+
className: aphrodite.css(styles$E.columnRight)
|
|
25054
25054
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25055
|
-
className: aphrodite.css(sticky && styles$
|
|
25055
|
+
className: aphrodite.css(sticky && styles$E.sticky)
|
|
25056
25056
|
}, preview)));
|
|
25057
25057
|
});
|
|
25058
25058
|
const TagsNodeContent = props => {
|
|
@@ -25069,9 +25069,9 @@ const TagsNodeContent = props => {
|
|
|
25069
25069
|
return null;
|
|
25070
25070
|
}
|
|
25071
25071
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25072
|
+
className: aphrodite.css(styles$E.columnLeft)
|
|
25073
25073
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
|
-
className: aphrodite.css(styles$
|
|
25074
|
+
className: aphrodite.css(styles$E.tagsEditor)
|
|
25075
25075
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25076
25076
|
value: data,
|
|
25077
25077
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25102,31 +25102,31 @@ const ArrayNodeContent = props => {
|
|
|
25102
25102
|
const subpath = path.concat(i);
|
|
25103
25103
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25104
25104
|
key: "moveArrayElementUp",
|
|
25105
|
-
className: aphrodite.css(styles$
|
|
25105
|
+
className: aphrodite.css(styles$E.control)
|
|
25106
25106
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25107
25107
|
color: "orange",
|
|
25108
25108
|
title: "Move up",
|
|
25109
25109
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25110
25110
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25111
|
-
className: aphrodite.css(styles$
|
|
25112
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25111
|
+
className: aphrodite.css(styles$E.verticalFlip)
|
|
25112
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25113
25113
|
key: "moveArrayElementDown",
|
|
25114
|
-
className: aphrodite.css(styles$
|
|
25114
|
+
className: aphrodite.css(styles$E.control)
|
|
25115
25115
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25116
25116
|
color: "orange",
|
|
25117
25117
|
title: "Move down",
|
|
25118
25118
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25119
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25119
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25120
25120
|
key: "removeArrayElement",
|
|
25121
|
-
className: aphrodite.css(styles$
|
|
25121
|
+
className: aphrodite.css(styles$E.control)
|
|
25122
25122
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25123
25123
|
color: "orange",
|
|
25124
25124
|
title: "Delete",
|
|
25125
25125
|
onClick: () => actions.removeArrayElement(subpath)
|
|
25126
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
25126
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$4)))];
|
|
25127
25127
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25128
25128
|
key: i,
|
|
25129
|
-
className: aphrodite.css(styles$
|
|
25129
|
+
className: aphrodite.css(styles$E.arrayElement, !elementIsLeaf && styles$E.arrayElementAndNotLeaf)
|
|
25130
25130
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25131
25131
|
key: i,
|
|
25132
25132
|
shape: shape.elementShape,
|
|
@@ -25152,7 +25152,7 @@ const ObjectNodeContent = props => {
|
|
|
25152
25152
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25153
25153
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25154
25154
|
key: subkey,
|
|
25155
|
-
className: aphrodite.css(styles$
|
|
25155
|
+
className: aphrodite.css(styles$E.objectElement)
|
|
25156
25156
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25157
25157
|
shape: shape.shape[subkey],
|
|
25158
25158
|
data: data[subkey],
|
|
@@ -25322,7 +25322,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25322
25322
|
}, this._renderContent());
|
|
25323
25323
|
}
|
|
25324
25324
|
}
|
|
25325
|
-
const styles$
|
|
25325
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
25326
25326
|
// This is used in a number of places throughout this file.
|
|
25327
25327
|
container: {},
|
|
25328
25328
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25893,7 +25893,7 @@ class DeprecatedStandinEditor extends React__namespace.Component {
|
|
|
25893
25893
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
25894
25894
|
const {
|
|
25895
25895
|
InfoTip: InfoTip$j,
|
|
25896
|
-
InlineIcon: InlineIcon$
|
|
25896
|
+
InlineIcon: InlineIcon$4
|
|
25897
25897
|
} = perseus.components;
|
|
25898
25898
|
const {
|
|
25899
25899
|
iconPlus: iconPlus$2,
|
|
@@ -26025,14 +26025,14 @@ class DropdownEditor extends React__namespace.Component {
|
|
|
26025
26025
|
this, i)
|
|
26026
26026
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
26027
26027
|
className: "remove-choice"
|
|
26028
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26028
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$3)))));
|
|
26029
26029
|
}, this)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26030
26030
|
className: "add-choice-container"
|
|
26031
26031
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
26032
26032
|
href: "#",
|
|
26033
26033
|
className: "simple-button orange",
|
|
26034
26034
|
onClick: this.addChoice
|
|
26035
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26035
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$2), " Add a choice", " ")));
|
|
26036
26036
|
}
|
|
26037
26037
|
}
|
|
26038
26038
|
|
|
@@ -26887,7 +26887,7 @@ class AnswerOption extends React__namespace.Component {
|
|
|
26887
26887
|
|
|
26888
26888
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
26889
26889
|
const {
|
|
26890
|
-
InlineIcon: InlineIcon$
|
|
26890
|
+
InlineIcon: InlineIcon$3,
|
|
26891
26891
|
TextInput: TextInput$6
|
|
26892
26892
|
} = perseus.components;
|
|
26893
26893
|
const {
|
|
@@ -26943,10 +26943,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26943
26943
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26944
26944
|
className: "perseus-widget-row"
|
|
26945
26945
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
26946
|
-
className: aphrodite.css(styles$
|
|
26946
|
+
className: aphrodite.css(styles$D.title)
|
|
26947
26947
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
26948
26948
|
value: this.props.title,
|
|
26949
|
-
className: aphrodite.css(styles$
|
|
26949
|
+
className: aphrodite.css(styles$D.input)
|
|
26950
26950
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26951
26951
|
,
|
|
26952
26952
|
onChange: this.change("title")
|
|
@@ -26968,10 +26968,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26968
26968
|
},
|
|
26969
26969
|
className: "add-hint simple-button orange",
|
|
26970
26970
|
onClick: this.handleAddHint
|
|
26971
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26971
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
26972
26972
|
className: "perseus-hint-editor"
|
|
26973
26973
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26974
|
-
className: aphrodite.css(styles$
|
|
26974
|
+
className: aphrodite.css(styles$D.hintsTitle)
|
|
26975
26975
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
26976
26976
|
ref: this.hintEditor,
|
|
26977
26977
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -26990,7 +26990,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26990
26990
|
type: "button",
|
|
26991
26991
|
className: "remove-hint simple-button orange",
|
|
26992
26992
|
onClick: this.handleRemoveHint
|
|
26993
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
26993
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconTrash$2), " Remove this hint")));
|
|
26994
26994
|
}
|
|
26995
26995
|
getSaveWarnings = () => {
|
|
26996
26996
|
return this.editor.current?.getSaveWarnings();
|
|
@@ -27003,7 +27003,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27003
27003
|
};
|
|
27004
27004
|
};
|
|
27005
27005
|
}
|
|
27006
|
-
const styles$
|
|
27006
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
27007
27007
|
title: {
|
|
27008
27008
|
fontSize: 18,
|
|
27009
27009
|
fontWeight: "bold"
|
|
@@ -27939,7 +27939,7 @@ class IframeEditor extends React__namespace.Component {
|
|
|
27939
27939
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
|
|
27940
27940
|
const {
|
|
27941
27941
|
InfoTip: InfoTip$f,
|
|
27942
|
-
InlineIcon: InlineIcon$
|
|
27942
|
+
InlineIcon: InlineIcon$2,
|
|
27943
27943
|
RangeInput: RangeInput$5
|
|
27944
27944
|
} = perseus.components;
|
|
27945
27945
|
const defaultBoxSize = 400;
|
|
@@ -28065,7 +28065,7 @@ class ImageEditor extends React__namespace.Component {
|
|
|
28065
28065
|
// eslint-disable-next-line react/jsx-no-bind
|
|
28066
28066
|
,
|
|
28067
28067
|
onClick: this.removeLabel.bind(this, i)
|
|
28068
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
28068
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconTrash))));
|
|
28069
28069
|
}
|
|
28070
28070
|
change() {
|
|
28071
28071
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -28374,13 +28374,13 @@ function MathquillInput(props) {
|
|
|
28374
28374
|
}
|
|
28375
28375
|
});
|
|
28376
28376
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28377
|
-
style: styles$
|
|
28377
|
+
style: styles$C.outerWrapper
|
|
28378
28378
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28379
28379
|
ref: mathFieldWrapperRef,
|
|
28380
28380
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28381
28381
|
}));
|
|
28382
28382
|
}
|
|
28383
|
-
const styles$
|
|
28383
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
28384
28384
|
outerWrapper: {
|
|
28385
28385
|
display: "inline-block",
|
|
28386
28386
|
borderStyle: "solid",
|
|
@@ -28392,7 +28392,7 @@ const styles$A = aphrodite.StyleSheet.create({
|
|
|
28392
28392
|
});
|
|
28393
28393
|
|
|
28394
28394
|
const {
|
|
28395
|
-
NumberInput: NumberInput$
|
|
28395
|
+
NumberInput: NumberInput$d
|
|
28396
28396
|
} = perseus.components;
|
|
28397
28397
|
const {
|
|
28398
28398
|
getDependencies: getDependencies$8
|
|
@@ -28452,7 +28452,7 @@ class FunctionEditor extends React__namespace.Component {
|
|
|
28452
28452
|
className: "perseus-widget-row"
|
|
28453
28453
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28454
28454
|
className: "perseus-widget-left-col"
|
|
28455
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28455
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$d, {
|
|
28456
28456
|
value: this.props.strokeWidth,
|
|
28457
28457
|
placeholder: 2,
|
|
28458
28458
|
onChange: this.change("strokeWidth")
|
|
@@ -28519,7 +28519,7 @@ class LabelEditor extends React__namespace.Component {
|
|
|
28519
28519
|
}
|
|
28520
28520
|
|
|
28521
28521
|
const {
|
|
28522
|
-
NumberInput: NumberInput$
|
|
28522
|
+
NumberInput: NumberInput$c
|
|
28523
28523
|
} = perseus.components;
|
|
28524
28524
|
const {
|
|
28525
28525
|
getDependencies: getDependencies$6
|
|
@@ -28587,7 +28587,7 @@ class LineEditor extends React__namespace.Component {
|
|
|
28587
28587
|
className: "perseus-widget-row"
|
|
28588
28588
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28589
28589
|
className: "perseus-widget-left-col"
|
|
28590
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28590
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$c, {
|
|
28591
28591
|
value: this.props.strokeWidth,
|
|
28592
28592
|
placeholder: 2,
|
|
28593
28593
|
onChange: this.change("strokeWidth")
|
|
@@ -28597,7 +28597,7 @@ class LineEditor extends React__namespace.Component {
|
|
|
28597
28597
|
|
|
28598
28598
|
const {
|
|
28599
28599
|
ButtonGroup: ButtonGroup$3,
|
|
28600
|
-
NumberInput: NumberInput$
|
|
28600
|
+
NumberInput: NumberInput$b
|
|
28601
28601
|
} = perseus.components;
|
|
28602
28602
|
class ConstraintEditor extends React__namespace.Component {
|
|
28603
28603
|
static defaultProps = {
|
|
@@ -28637,7 +28637,7 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28637
28637
|
onChange: this.change("constraint")
|
|
28638
28638
|
})), this.props.constraint === "snap" && /*#__PURE__*/React__namespace.createElement("div", {
|
|
28639
28639
|
className: "perseus-widget-row"
|
|
28640
|
-
}, "Snap:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28640
|
+
}, "Snap:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$b, {
|
|
28641
28641
|
value: this.props.snap,
|
|
28642
28642
|
placeholder: 0,
|
|
28643
28643
|
onChange: this.change("snap")
|
|
@@ -28680,7 +28680,7 @@ class ConstraintEditor extends React__namespace.Component {
|
|
|
28680
28680
|
}
|
|
28681
28681
|
|
|
28682
28682
|
const {
|
|
28683
|
-
NumberInput: NumberInput$
|
|
28683
|
+
NumberInput: NumberInput$a
|
|
28684
28684
|
} = perseus.components;
|
|
28685
28685
|
const {
|
|
28686
28686
|
getDependencies: getDependencies$5
|
|
@@ -28738,13 +28738,13 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
28738
28738
|
onChange: this.change("endY")
|
|
28739
28739
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28740
28740
|
className: "perseus-widget-row"
|
|
28741
|
-
}, "Start updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28741
|
+
}, "Start updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), /*#__PURE__*/React__namespace.createElement(NumberInput$a, {
|
|
28742
28742
|
value: this.props.startSubscript,
|
|
28743
28743
|
placeholder: 0,
|
|
28744
28744
|
onChange: this.change("startSubscript")
|
|
28745
28745
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28746
28746
|
className: "perseus-widget-row"
|
|
28747
|
-
}, "End updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "m ="), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28747
|
+
}, "End updates ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "m ="), /*#__PURE__*/React__namespace.createElement(NumberInput$a, {
|
|
28748
28748
|
value: this.props.endSubscript,
|
|
28749
28749
|
placeholder: 0,
|
|
28750
28750
|
onChange: this.change("endSubscript")
|
|
@@ -28755,7 +28755,7 @@ class MovableLineEditor extends React__namespace.Component {
|
|
|
28755
28755
|
}
|
|
28756
28756
|
|
|
28757
28757
|
const {
|
|
28758
|
-
NumberInput: NumberInput$
|
|
28758
|
+
NumberInput: NumberInput$9
|
|
28759
28759
|
} = perseus.components;
|
|
28760
28760
|
const {
|
|
28761
28761
|
getDependencies: getDependencies$4
|
|
@@ -28803,7 +28803,7 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
28803
28803
|
onChange: this.change("startY")
|
|
28804
28804
|
}), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
|
|
28805
28805
|
className: "perseus-widget-row"
|
|
28806
|
-
}, "Update ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28806
|
+
}, "Update ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React__namespace.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$9, {
|
|
28807
28807
|
value: this.props.varSubscript,
|
|
28808
28808
|
placeholder: 0,
|
|
28809
28809
|
onChange: this.change("varSubscript")
|
|
@@ -28812,7 +28812,7 @@ class MovablePointEditor extends React__namespace.Component {
|
|
|
28812
28812
|
}
|
|
28813
28813
|
|
|
28814
28814
|
const {
|
|
28815
|
-
NumberInput: NumberInput$
|
|
28815
|
+
NumberInput: NumberInput$8
|
|
28816
28816
|
} = perseus.components;
|
|
28817
28817
|
const {
|
|
28818
28818
|
getDependencies: getDependencies$3
|
|
@@ -28878,7 +28878,7 @@ class ParametricEditor extends React__namespace.Component {
|
|
|
28878
28878
|
className: "perseus-widget-row"
|
|
28879
28879
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
28880
28880
|
className: "perseus-widget-left-col"
|
|
28881
|
-
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
28881
|
+
}, "Width:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$8, {
|
|
28882
28882
|
value: this.props.strokeWidth,
|
|
28883
28883
|
placeholder: 2,
|
|
28884
28884
|
onChange: this.change("strokeWidth")
|
|
@@ -29450,16 +29450,16 @@ const LabeledRow = props => {
|
|
|
29450
29450
|
style
|
|
29451
29451
|
} = props;
|
|
29452
29452
|
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29453
|
-
className: aphrodite.css(styles$
|
|
29453
|
+
className: aphrodite.css(styles$B.label)
|
|
29454
29454
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29455
|
-
style: [styles$
|
|
29455
|
+
style: [styles$B.row, style]
|
|
29456
29456
|
}, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29457
|
-
style: styles$
|
|
29457
|
+
style: styles$B.spaceEnd
|
|
29458
29458
|
}, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29459
|
-
style: styles$
|
|
29459
|
+
style: styles$B.spaceStart
|
|
29460
29460
|
}, label)));
|
|
29461
29461
|
};
|
|
29462
|
-
const styles$
|
|
29462
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
29463
29463
|
label: {
|
|
29464
29464
|
width: "fit-content"
|
|
29465
29465
|
},
|
|
@@ -29536,11 +29536,11 @@ class Spring extends React__namespace.Component {
|
|
|
29536
29536
|
} = this.props;
|
|
29537
29537
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
29538
29538
|
"aria-hidden": "true",
|
|
29539
|
-
style: [styles$
|
|
29539
|
+
style: [styles$A.grow, style]
|
|
29540
29540
|
});
|
|
29541
29541
|
}
|
|
29542
29542
|
}
|
|
29543
|
-
const styles$
|
|
29543
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
29544
29544
|
grow: {
|
|
29545
29545
|
flexGrow: 1
|
|
29546
29546
|
}
|
|
@@ -29576,22 +29576,12 @@ function Heading(_ref) {
|
|
|
29576
29576
|
isCollapsible,
|
|
29577
29577
|
onToggle
|
|
29578
29578
|
} = _ref;
|
|
29579
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
29580
|
-
style:
|
|
29581
|
-
|
|
29582
|
-
justifyContent: "space-between",
|
|
29583
|
-
backgroundColor: wonderBlocksTokens.color.offBlack8,
|
|
29584
|
-
padding: wonderBlocksTokens.spacing.xSmall_8,
|
|
29585
|
-
marginTop: wonderBlocksTokens.spacing.small_12,
|
|
29586
|
-
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
29587
|
-
// variable found in perseus-editor.less. For now, it must
|
|
29588
|
-
// match otherwise there's a gap from this header to the edge
|
|
29589
|
-
// of the editor borders.
|
|
29590
|
-
marginInline: -10,
|
|
29591
|
-
cursor: isCollapsible ? "pointer" : "default",
|
|
29592
|
-
userSelect: "none"
|
|
29593
|
-
},
|
|
29579
|
+
return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
29580
|
+
style: [styles$z.container, !isCollapsible && styles$z.notClickable],
|
|
29581
|
+
disabled: !isCollapsible,
|
|
29594
29582
|
onClick: () => isCollapsible && onToggle?.(!isOpen)
|
|
29583
|
+
}, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29584
|
+
style: styles$z.heading
|
|
29595
29585
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
|
|
29596
29586
|
style: {
|
|
29597
29587
|
fontSize: 14,
|
|
@@ -29599,8 +29589,31 @@ function Heading(_ref) {
|
|
|
29599
29589
|
}
|
|
29600
29590
|
}, title), isCollapsible && /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
29601
29591
|
isExpanded: isOpen
|
|
29602
|
-
}));
|
|
29592
|
+
})));
|
|
29603
29593
|
}
|
|
29594
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
29595
|
+
container: {
|
|
29596
|
+
marginTop: wonderBlocksTokens.spacing.small_12,
|
|
29597
|
+
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
29598
|
+
// variable found in perseus-editor.less. For now, it must
|
|
29599
|
+
// match otherwise there's a gap from this header to the edge
|
|
29600
|
+
// of the editor borders.
|
|
29601
|
+
marginInline: -10,
|
|
29602
|
+
backgroundColor: wonderBlocksTokens.color.offBlack8,
|
|
29603
|
+
padding: wonderBlocksTokens.spacing.xSmall_8
|
|
29604
|
+
},
|
|
29605
|
+
heading: {
|
|
29606
|
+
flexDirection: "row",
|
|
29607
|
+
justifyContent: "space-between",
|
|
29608
|
+
userSelect: "none"
|
|
29609
|
+
},
|
|
29610
|
+
notClickable: {
|
|
29611
|
+
// We don't need the text to be grayed out.
|
|
29612
|
+
color: "inherit",
|
|
29613
|
+
// We don't need the pointer to show the "not allowed" symbol.
|
|
29614
|
+
cursor: "default"
|
|
29615
|
+
}
|
|
29616
|
+
});
|
|
29604
29617
|
|
|
29605
29618
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
29606
29619
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
@@ -29708,6 +29721,28 @@ function degreeToRadian(degrees) {
|
|
|
29708
29721
|
function radianToDegree(radians) {
|
|
29709
29722
|
return radians / Math.PI * 180;
|
|
29710
29723
|
}
|
|
29724
|
+
function getDefaultGraphStartCoords(graph, range, step) {
|
|
29725
|
+
switch (graph.type) {
|
|
29726
|
+
case "linear":
|
|
29727
|
+
case "ray":
|
|
29728
|
+
return perseus.getLineCoords({
|
|
29729
|
+
...graph,
|
|
29730
|
+
startCoords: undefined
|
|
29731
|
+
}, range, step);
|
|
29732
|
+
case "segment":
|
|
29733
|
+
return perseus.getSegmentCoords({
|
|
29734
|
+
...graph,
|
|
29735
|
+
startCoords: undefined
|
|
29736
|
+
}, range, step);
|
|
29737
|
+
case "linear-system":
|
|
29738
|
+
return perseus.getLinearSystemCoords({
|
|
29739
|
+
...graph,
|
|
29740
|
+
startCoords: undefined
|
|
29741
|
+
}, range, step);
|
|
29742
|
+
default:
|
|
29743
|
+
return undefined;
|
|
29744
|
+
}
|
|
29745
|
+
}
|
|
29711
29746
|
|
|
29712
29747
|
/**
|
|
29713
29748
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29723,17 +29758,17 @@ const LockedFigureSelect = props => {
|
|
|
29723
29758
|
} = props;
|
|
29724
29759
|
const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
|
|
29725
29760
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29726
|
-
style: styles$
|
|
29761
|
+
style: styles$y.container
|
|
29727
29762
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29728
29763
|
menuText: "Add locked figure",
|
|
29729
|
-
style: styles$
|
|
29764
|
+
style: styles$y.addElementSelect
|
|
29730
29765
|
}, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29731
29766
|
key: `${id}-${figureType}`,
|
|
29732
29767
|
label: figureType,
|
|
29733
29768
|
onClick: () => onChange(figureType)
|
|
29734
29769
|
}))));
|
|
29735
29770
|
};
|
|
29736
|
-
const styles$
|
|
29771
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
29737
29772
|
container: {
|
|
29738
29773
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29739
29774
|
},
|
|
@@ -29764,19 +29799,19 @@ const AngleInput = props => {
|
|
|
29764
29799
|
}
|
|
29765
29800
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29766
29801
|
tag: "label",
|
|
29767
|
-
style: styles$
|
|
29802
|
+
style: styles$x.row
|
|
29768
29803
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29769
29804
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29770
29805
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29771
29806
|
type: "number",
|
|
29772
29807
|
value: angleInput,
|
|
29773
29808
|
onChange: handleAngleChange,
|
|
29774
|
-
style: styles$
|
|
29809
|
+
style: styles$x.textField
|
|
29775
29810
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29776
29811
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29777
29812
|
}));
|
|
29778
29813
|
};
|
|
29779
|
-
const styles$
|
|
29814
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
29780
29815
|
row: {
|
|
29781
29816
|
display: "flex",
|
|
29782
29817
|
flexDirection: "row",
|
|
@@ -29825,32 +29860,32 @@ const CoordinatePairInput = props => {
|
|
|
29825
29860
|
onChange(newCoords);
|
|
29826
29861
|
}
|
|
29827
29862
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29828
|
-
style: [styles$
|
|
29863
|
+
style: [styles$w.row, style]
|
|
29829
29864
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29830
29865
|
tag: "label",
|
|
29831
|
-
style: styles$
|
|
29866
|
+
style: styles$w.row
|
|
29832
29867
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29833
29868
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29834
29869
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29835
29870
|
type: "number",
|
|
29836
29871
|
value: coordState[0],
|
|
29837
29872
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29838
|
-
style: [styles$
|
|
29873
|
+
style: [styles$w.textField, error ? styles$w.errorField : undefined]
|
|
29839
29874
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29840
29875
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29841
29876
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29842
29877
|
tag: "label",
|
|
29843
|
-
style: styles$
|
|
29878
|
+
style: styles$w.row
|
|
29844
29879
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29845
29880
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29846
29881
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
29847
29882
|
type: "number",
|
|
29848
29883
|
value: coordState[1],
|
|
29849
29884
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29850
|
-
style: [styles$
|
|
29885
|
+
style: [styles$w.textField, error ? styles$w.errorField : undefined]
|
|
29851
29886
|
})));
|
|
29852
29887
|
};
|
|
29853
|
-
const styles$
|
|
29888
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
29854
29889
|
row: {
|
|
29855
29890
|
display: "flex",
|
|
29856
29891
|
flexDirection: "row",
|
|
@@ -29883,14 +29918,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29883
29918
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29884
29919
|
expanded: expanded,
|
|
29885
29920
|
onToggle: onToggle,
|
|
29886
|
-
style: [styles$
|
|
29887
|
-
headerStyle: styles$
|
|
29921
|
+
style: [styles$v.container, containerStyle],
|
|
29922
|
+
headerStyle: styles$v.accordionHeader,
|
|
29888
29923
|
header: header
|
|
29889
29924
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29890
|
-
style: [styles$
|
|
29925
|
+
style: [styles$v.accordionPanel, panelStyle]
|
|
29891
29926
|
}, children)));
|
|
29892
29927
|
};
|
|
29893
|
-
const styles$
|
|
29928
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
29894
29929
|
container: {
|
|
29895
29930
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29896
29931
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -29921,13 +29956,13 @@ const ColorSwatch = props => {
|
|
|
29921
29956
|
"aria-label":
|
|
29922
29957
|
// Don't include an aria label for decorative circles.
|
|
29923
29958
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
29924
|
-
style: [styles$
|
|
29959
|
+
style: [styles$u.colorSwatch, {
|
|
29925
29960
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
29926
29961
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
29927
29962
|
}]
|
|
29928
29963
|
});
|
|
29929
29964
|
};
|
|
29930
|
-
const styles$
|
|
29965
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
29931
29966
|
colorSwatch: {
|
|
29932
29967
|
// Add a white outline so that the color swatch is visible when
|
|
29933
29968
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29946,10 +29981,10 @@ const ColorSelect = props => {
|
|
|
29946
29981
|
onChange
|
|
29947
29982
|
} = props;
|
|
29948
29983
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29949
|
-
style: [styles$
|
|
29984
|
+
style: [styles$t.row, style]
|
|
29950
29985
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29951
29986
|
tag: "label",
|
|
29952
|
-
style: styles$
|
|
29987
|
+
style: styles$t.row
|
|
29953
29988
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29954
29989
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29955
29990
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -29968,7 +30003,7 @@ const ColorSelect = props => {
|
|
|
29968
30003
|
})
|
|
29969
30004
|
})))));
|
|
29970
30005
|
};
|
|
29971
|
-
const styles$
|
|
30006
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
29972
30007
|
row: {
|
|
29973
30008
|
display: "flex",
|
|
29974
30009
|
flexDirection: "row",
|
|
@@ -29984,17 +30019,17 @@ const EllipseSwatch = props => {
|
|
|
29984
30019
|
} = props;
|
|
29985
30020
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29986
30021
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
29987
|
-
style: [styles$
|
|
30022
|
+
style: [styles$s.container, {
|
|
29988
30023
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
29989
30024
|
}]
|
|
29990
30025
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29991
|
-
style: [styles$
|
|
30026
|
+
style: [styles$s.innerCircle, {
|
|
29992
30027
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
29993
30028
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
29994
30029
|
}]
|
|
29995
30030
|
}));
|
|
29996
30031
|
};
|
|
29997
|
-
const styles$
|
|
30032
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
29998
30033
|
container: {
|
|
29999
30034
|
// Add a white outline so that the color swatch is visible when
|
|
30000
30035
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30025,40 +30060,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30025
30060
|
onRemove
|
|
30026
30061
|
} = props;
|
|
30027
30062
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30028
|
-
style: styles$
|
|
30063
|
+
style: styles$r.container
|
|
30029
30064
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30030
30065
|
startIcon: trashIcon__default["default"],
|
|
30031
30066
|
"aria-label": `Delete locked ${figureType}`,
|
|
30032
30067
|
onClick: onRemove,
|
|
30033
30068
|
kind: "tertiary",
|
|
30034
|
-
style: styles$
|
|
30069
|
+
style: styles$r.deleteButton
|
|
30035
30070
|
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30036
30071
|
icon: caretDoubleUpIcon__default["default"],
|
|
30037
30072
|
size: "small",
|
|
30038
30073
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30039
30074
|
onClick: () => onMove("back"),
|
|
30040
|
-
style: styles$
|
|
30075
|
+
style: styles$r.iconButton
|
|
30041
30076
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30042
30077
|
icon: caretUpIcon__default["default"],
|
|
30043
30078
|
size: "small",
|
|
30044
30079
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30045
30080
|
onClick: () => onMove("backward"),
|
|
30046
|
-
style: styles$
|
|
30081
|
+
style: styles$r.iconButton
|
|
30047
30082
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30048
30083
|
icon: caretDownIcon__default["default"],
|
|
30049
30084
|
size: "small",
|
|
30050
30085
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30051
30086
|
onClick: () => onMove("forward"),
|
|
30052
|
-
style: styles$
|
|
30087
|
+
style: styles$r.iconButton
|
|
30053
30088
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30054
30089
|
icon: caretDoubleDownIcon__default["default"],
|
|
30055
30090
|
size: "small",
|
|
30056
30091
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30057
30092
|
onClick: () => onMove("front"),
|
|
30058
|
-
style: styles$
|
|
30093
|
+
style: styles$r.iconButton
|
|
30059
30094
|
})));
|
|
30060
30095
|
};
|
|
30061
|
-
const styles$
|
|
30096
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
30062
30097
|
container: {
|
|
30063
30098
|
width: "100%",
|
|
30064
30099
|
flexDirection: "row",
|
|
@@ -30105,7 +30140,7 @@ const LockedEllipseSettings = props => {
|
|
|
30105
30140
|
/*#__PURE__*/
|
|
30106
30141
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30107
30142
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30108
|
-
style: styles$
|
|
30143
|
+
style: styles$q.row
|
|
30109
30144
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30110
30145
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30111
30146
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30114,19 +30149,19 @@ const LockedEllipseSettings = props => {
|
|
|
30114
30149
|
strokeStyle: strokeStyle
|
|
30115
30150
|
}))
|
|
30116
30151
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30117
|
-
style: styles$
|
|
30152
|
+
style: styles$q.row
|
|
30118
30153
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30119
30154
|
coord: center,
|
|
30120
|
-
style: styles$
|
|
30155
|
+
style: styles$q.spaceUnder,
|
|
30121
30156
|
onChange: newCoords => onChangeProps({
|
|
30122
30157
|
center: newCoords
|
|
30123
30158
|
})
|
|
30124
30159
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30125
|
-
style: styles$
|
|
30160
|
+
style: styles$q.spaceUnder
|
|
30126
30161
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30127
30162
|
coord: radius,
|
|
30128
30163
|
labels: ["x radius", "y radius"],
|
|
30129
|
-
style: styles$
|
|
30164
|
+
style: styles$q.spaceUnder,
|
|
30130
30165
|
onChange: newCoords => onChangeProps({
|
|
30131
30166
|
radius: newCoords
|
|
30132
30167
|
})
|
|
@@ -30138,7 +30173,7 @@ const LockedEllipseSettings = props => {
|
|
|
30138
30173
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30139
30174
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30140
30175
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30141
|
-
style: [styles$
|
|
30176
|
+
style: [styles$q.row, styles$q.spaceUnder]
|
|
30142
30177
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30143
30178
|
selectedValue: color,
|
|
30144
30179
|
onChange: handleColorChange
|
|
@@ -30146,7 +30181,7 @@ const LockedEllipseSettings = props => {
|
|
|
30146
30181
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30147
30182
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30148
30183
|
tag: "label",
|
|
30149
|
-
style: styles$
|
|
30184
|
+
style: styles$q.row
|
|
30150
30185
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30151
30186
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30152
30187
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30163,7 +30198,7 @@ const LockedEllipseSettings = props => {
|
|
|
30163
30198
|
label: option
|
|
30164
30199
|
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30165
30200
|
tag: "label",
|
|
30166
|
-
style: styles$
|
|
30201
|
+
style: styles$q.row
|
|
30167
30202
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30168
30203
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30169
30204
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30187,7 +30222,7 @@ const LockedEllipseSettings = props => {
|
|
|
30187
30222
|
onRemove: onRemove
|
|
30188
30223
|
}));
|
|
30189
30224
|
};
|
|
30190
|
-
const styles$
|
|
30225
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30191
30226
|
row: {
|
|
30192
30227
|
display: "flex",
|
|
30193
30228
|
flexDirection: "row",
|
|
@@ -30208,7 +30243,7 @@ const LabeledSwitch = props => {
|
|
|
30208
30243
|
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30209
30244
|
const switchId = ids.get("switch");
|
|
30210
30245
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30211
|
-
style: [styles$
|
|
30246
|
+
style: [styles$p.row, style]
|
|
30212
30247
|
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30213
30248
|
id: switchId,
|
|
30214
30249
|
checked: checked,
|
|
@@ -30220,7 +30255,7 @@ const LabeledSwitch = props => {
|
|
|
30220
30255
|
htmlFor: switchId
|
|
30221
30256
|
}, label));
|
|
30222
30257
|
};
|
|
30223
|
-
const styles$
|
|
30258
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30224
30259
|
row: {
|
|
30225
30260
|
flexDirection: "row",
|
|
30226
30261
|
alignItems: "center"
|
|
@@ -30254,13 +30289,13 @@ const DefiningPointSettings = props => {
|
|
|
30254
30289
|
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30255
30290
|
expanded: expanded,
|
|
30256
30291
|
onToggle: onToggle,
|
|
30257
|
-
containerStyle: styles$
|
|
30258
|
-
panelStyle: styles$
|
|
30292
|
+
containerStyle: styles$o.container,
|
|
30293
|
+
panelStyle: styles$o.accordionPanel,
|
|
30259
30294
|
header:
|
|
30260
30295
|
/*#__PURE__*/
|
|
30261
30296
|
// Summary: Point, coords, color (filled/open)
|
|
30262
30297
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30263
|
-
style: styles$
|
|
30298
|
+
style: styles$o.row
|
|
30264
30299
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30265
30300
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30266
30301
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30270,7 +30305,7 @@ const DefiningPointSettings = props => {
|
|
|
30270
30305
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30271
30306
|
coord: coord,
|
|
30272
30307
|
error: !!error,
|
|
30273
|
-
style: styles$
|
|
30308
|
+
style: styles$o.spaceUnder,
|
|
30274
30309
|
onChange: newCoords => {
|
|
30275
30310
|
onChangeProps({
|
|
30276
30311
|
coord: newCoords
|
|
@@ -30279,12 +30314,12 @@ const DefiningPointSettings = props => {
|
|
|
30279
30314
|
}), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30280
30315
|
label: "show point on graph",
|
|
30281
30316
|
checked: !!showPoint,
|
|
30282
|
-
style: showPoint && styles$
|
|
30317
|
+
style: showPoint && styles$o.spaceUnder,
|
|
30283
30318
|
onChange: onTogglePoint
|
|
30284
30319
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30285
30320
|
selectedValue: pointColor,
|
|
30286
30321
|
onChange: handleColorChange,
|
|
30287
|
-
style: styles$
|
|
30322
|
+
style: styles$o.spaceUnder
|
|
30288
30323
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30289
30324
|
label: "open point",
|
|
30290
30325
|
checked: !filled,
|
|
@@ -30295,7 +30330,7 @@ const DefiningPointSettings = props => {
|
|
|
30295
30330
|
}
|
|
30296
30331
|
})));
|
|
30297
30332
|
};
|
|
30298
|
-
const styles$
|
|
30333
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30299
30334
|
container: {
|
|
30300
30335
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30301
30336
|
marginBottom: 0,
|
|
@@ -30322,15 +30357,15 @@ const LineSwatch = props => {
|
|
|
30322
30357
|
lineStyle
|
|
30323
30358
|
} = props;
|
|
30324
30359
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30325
|
-
style: styles$
|
|
30360
|
+
style: styles$n.container
|
|
30326
30361
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30327
30362
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30328
|
-
style: [styles$
|
|
30363
|
+
style: [styles$n.lineSwatch, {
|
|
30329
30364
|
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30330
30365
|
}]
|
|
30331
30366
|
}));
|
|
30332
30367
|
};
|
|
30333
|
-
const styles$
|
|
30368
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30334
30369
|
container: {
|
|
30335
30370
|
backgroundColor: wonderBlocksTokens.color.white,
|
|
30336
30371
|
justifyContent: "center",
|
|
@@ -30389,7 +30424,7 @@ const LockedLineSettings = props => {
|
|
|
30389
30424
|
expanded: props.expanded,
|
|
30390
30425
|
onToggle: props.onToggle,
|
|
30391
30426
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30392
|
-
style: styles$
|
|
30427
|
+
style: styles$m.row
|
|
30393
30428
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30394
30429
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30395
30430
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30398,7 +30433,7 @@ const LockedLineSettings = props => {
|
|
|
30398
30433
|
}))
|
|
30399
30434
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30400
30435
|
tag: "label",
|
|
30401
|
-
style: [styles$
|
|
30436
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30402
30437
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30403
30438
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30404
30439
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30419,7 +30454,7 @@ const LockedLineSettings = props => {
|
|
|
30419
30454
|
value: "segment",
|
|
30420
30455
|
label: "segment"
|
|
30421
30456
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30422
|
-
style: styles$
|
|
30457
|
+
style: styles$m.row
|
|
30423
30458
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30424
30459
|
selectedValue: lineColor,
|
|
30425
30460
|
onChange: handleColorChange
|
|
@@ -30427,7 +30462,7 @@ const LockedLineSettings = props => {
|
|
|
30427
30462
|
size: wonderBlocksTokens.spacing.small_12
|
|
30428
30463
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30429
30464
|
tag: "label",
|
|
30430
|
-
style: styles$
|
|
30465
|
+
style: styles$m.row
|
|
30431
30466
|
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30432
30467
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30433
30468
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30438,7 +30473,7 @@ const LockedLineSettings = props => {
|
|
|
30438
30473
|
// Placeholder is required, but never gets used.
|
|
30439
30474
|
,
|
|
30440
30475
|
placeholder: "",
|
|
30441
|
-
style: styles$
|
|
30476
|
+
style: styles$m.selectMarginOffset
|
|
30442
30477
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30443
30478
|
value: "solid",
|
|
30444
30479
|
label: "solid"
|
|
@@ -30446,7 +30481,7 @@ const LockedLineSettings = props => {
|
|
|
30446
30481
|
value: "dashed",
|
|
30447
30482
|
label: "dashed"
|
|
30448
30483
|
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30449
|
-
style: styles$
|
|
30484
|
+
style: styles$m.errorText
|
|
30450
30485
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30451
30486
|
label: "Point 1",
|
|
30452
30487
|
showPoint: showPoint1,
|
|
@@ -30472,7 +30507,7 @@ const LockedLineSettings = props => {
|
|
|
30472
30507
|
onRemove: onRemove
|
|
30473
30508
|
}));
|
|
30474
30509
|
};
|
|
30475
|
-
const styles$
|
|
30510
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30476
30511
|
row: {
|
|
30477
30512
|
display: "flex",
|
|
30478
30513
|
flexDirection: "row",
|
|
@@ -30517,7 +30552,7 @@ const LockedPointSettings = props => {
|
|
|
30517
30552
|
/*#__PURE__*/
|
|
30518
30553
|
// Summary: Point, coords, color (filled/open)
|
|
30519
30554
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30520
|
-
style: styles$
|
|
30555
|
+
style: styles$l.row
|
|
30521
30556
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30522
30557
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30523
30558
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30526,7 +30561,7 @@ const LockedPointSettings = props => {
|
|
|
30526
30561
|
}))
|
|
30527
30562
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30528
30563
|
coord: coord,
|
|
30529
|
-
style: styles$
|
|
30564
|
+
style: styles$l.spaceUnder,
|
|
30530
30565
|
onChange: newCoord => {
|
|
30531
30566
|
onChangeProps({
|
|
30532
30567
|
coord: newCoord
|
|
@@ -30535,7 +30570,7 @@ const LockedPointSettings = props => {
|
|
|
30535
30570
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30536
30571
|
selectedValue: pointColor,
|
|
30537
30572
|
onChange: handleColorChange,
|
|
30538
|
-
style: styles$
|
|
30573
|
+
style: styles$l.spaceUnder
|
|
30539
30574
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30540
30575
|
label: "open point",
|
|
30541
30576
|
checked: !filled,
|
|
@@ -30551,7 +30586,7 @@ const LockedPointSettings = props => {
|
|
|
30551
30586
|
onRemove: onRemove
|
|
30552
30587
|
}));
|
|
30553
30588
|
};
|
|
30554
|
-
const styles$
|
|
30589
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
30555
30590
|
row: {
|
|
30556
30591
|
flexDirection: "row",
|
|
30557
30592
|
alignItems: "center"
|
|
@@ -30569,17 +30604,17 @@ const PolygonSwatch = props => {
|
|
|
30569
30604
|
} = props;
|
|
30570
30605
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30571
30606
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30572
|
-
style: [styles$
|
|
30607
|
+
style: [styles$k.container, {
|
|
30573
30608
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30574
30609
|
}]
|
|
30575
30610
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30576
|
-
style: [styles$
|
|
30611
|
+
style: [styles$k.innerSquare, {
|
|
30577
30612
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30578
30613
|
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30579
30614
|
}]
|
|
30580
30615
|
}));
|
|
30581
30616
|
};
|
|
30582
|
-
const styles$
|
|
30617
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
30583
30618
|
container: {
|
|
30584
30619
|
// Add a white outline so that the color swatch is visible when
|
|
30585
30620
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30621,7 +30656,7 @@ const LockedPolygonSettings = props => {
|
|
|
30621
30656
|
/*#__PURE__*/
|
|
30622
30657
|
// Summary: Polygon, number of sides, style swatch
|
|
30623
30658
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30624
|
-
style: styles$
|
|
30659
|
+
style: styles$j.row
|
|
30625
30660
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30626
30661
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30627
30662
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30630,7 +30665,7 @@ const LockedPolygonSettings = props => {
|
|
|
30630
30665
|
strokeStyle: strokeStyle
|
|
30631
30666
|
}))
|
|
30632
30667
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30633
|
-
style: [styles$
|
|
30668
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30634
30669
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30635
30670
|
selectedValue: color,
|
|
30636
30671
|
onChange: handleColorChange
|
|
@@ -30638,7 +30673,7 @@ const LockedPolygonSettings = props => {
|
|
|
30638
30673
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30639
30674
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30640
30675
|
tag: "label",
|
|
30641
|
-
style: styles$
|
|
30676
|
+
style: styles$j.row
|
|
30642
30677
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30643
30678
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30644
30679
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30655,7 +30690,7 @@ const LockedPolygonSettings = props => {
|
|
|
30655
30690
|
label: option
|
|
30656
30691
|
}))))), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30657
30692
|
tag: "label",
|
|
30658
|
-
style: [styles$
|
|
30693
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30659
30694
|
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30660
30695
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30661
30696
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30678,17 +30713,17 @@ const LockedPolygonSettings = props => {
|
|
|
30678
30713
|
onChange: newValue => onChangeProps({
|
|
30679
30714
|
showVertices: newValue
|
|
30680
30715
|
}),
|
|
30681
|
-
style: styles$
|
|
30716
|
+
style: styles$j.spaceUnder
|
|
30682
30717
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30683
30718
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30684
30719
|
expanded: true,
|
|
30685
|
-
containerStyle: styles$
|
|
30686
|
-
panelStyle: styles$
|
|
30720
|
+
containerStyle: styles$j.pointAccordionContainer,
|
|
30721
|
+
panelStyle: styles$j.pointAccordionPanel
|
|
30687
30722
|
}, points.map((point, index) => {
|
|
30688
30723
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30689
30724
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30690
30725
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30691
|
-
style: [styles$
|
|
30726
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30692
30727
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30693
30728
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30694
30729
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30716,7 +30751,7 @@ const LockedPolygonSettings = props => {
|
|
|
30716
30751
|
points: newPoints
|
|
30717
30752
|
});
|
|
30718
30753
|
},
|
|
30719
|
-
style: styles$
|
|
30754
|
+
style: styles$j.icon
|
|
30720
30755
|
}));
|
|
30721
30756
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30722
30757
|
kind: "tertiary",
|
|
@@ -30733,7 +30768,7 @@ const LockedPolygonSettings = props => {
|
|
|
30733
30768
|
onRemove: onRemove
|
|
30734
30769
|
}));
|
|
30735
30770
|
};
|
|
30736
|
-
const styles$
|
|
30771
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
30737
30772
|
row: {
|
|
30738
30773
|
display: "flex",
|
|
30739
30774
|
flexDirection: "row",
|
|
@@ -30791,7 +30826,7 @@ const LockedVectorSettings = props => {
|
|
|
30791
30826
|
expanded: props.expanded,
|
|
30792
30827
|
onToggle: props.onToggle,
|
|
30793
30828
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30794
|
-
style: styles$
|
|
30829
|
+
style: styles$i.row
|
|
30795
30830
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30796
30831
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30797
30832
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30799,19 +30834,19 @@ const LockedVectorSettings = props => {
|
|
|
30799
30834
|
lineStyle: "solid"
|
|
30800
30835
|
}))
|
|
30801
30836
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30802
|
-
style: [styles$
|
|
30837
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30803
30838
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30804
30839
|
selectedValue: lineColor,
|
|
30805
30840
|
onChange: handleColorChange
|
|
30806
30841
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30807
|
-
style: styles$
|
|
30842
|
+
style: styles$i.errorText
|
|
30808
30843
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30809
30844
|
expanded: true // Initial state is expanded
|
|
30810
30845
|
,
|
|
30811
|
-
containerStyle: styles$
|
|
30812
|
-
panelStyle: styles$
|
|
30846
|
+
containerStyle: styles$i.container,
|
|
30847
|
+
panelStyle: styles$i.accordionPanel,
|
|
30813
30848
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30814
|
-
style: styles$
|
|
30849
|
+
style: styles$i.row
|
|
30815
30850
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30816
30851
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30817
30852
|
coord: tail,
|
|
@@ -30822,10 +30857,10 @@ const LockedVectorSettings = props => {
|
|
|
30822
30857
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30823
30858
|
expanded: true // Initial state is expanded
|
|
30824
30859
|
,
|
|
30825
|
-
containerStyle: styles$
|
|
30826
|
-
panelStyle: styles$
|
|
30860
|
+
containerStyle: styles$i.container,
|
|
30861
|
+
panelStyle: styles$i.accordionPanel,
|
|
30827
30862
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30828
|
-
style: styles$
|
|
30863
|
+
style: styles$i.row
|
|
30829
30864
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30830
30865
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30831
30866
|
coord: tip,
|
|
@@ -30840,7 +30875,7 @@ const LockedVectorSettings = props => {
|
|
|
30840
30875
|
onRemove: onRemove
|
|
30841
30876
|
}));
|
|
30842
30877
|
};
|
|
30843
|
-
const styles$
|
|
30878
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
30844
30879
|
accordionPanel: {
|
|
30845
30880
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30846
30881
|
},
|
|
@@ -31017,7 +31052,7 @@ const LockedFiguresSection = props => {
|
|
|
31017
31052
|
onRemove: () => removeLockedFigure(index)
|
|
31018
31053
|
}));
|
|
31019
31054
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31020
|
-
style: styles$
|
|
31055
|
+
style: styles$h.buttonContainer
|
|
31021
31056
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31022
31057
|
showM2Features: props.showM2Features,
|
|
31023
31058
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -31028,10 +31063,10 @@ const LockedFiguresSection = props => {
|
|
|
31028
31063
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31029
31064
|
kind: "secondary",
|
|
31030
31065
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31031
|
-
style: styles$
|
|
31066
|
+
style: styles$h.button
|
|
31032
31067
|
}, buttonLabel))));
|
|
31033
31068
|
};
|
|
31034
|
-
const styles$
|
|
31069
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
31035
31070
|
buttonContainer: {
|
|
31036
31071
|
flexDirection: "row",
|
|
31037
31072
|
alignItems: "center"
|
|
@@ -31067,7 +31102,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31067
31102
|
// Never uses placeholder, always has value
|
|
31068
31103
|
,
|
|
31069
31104
|
placeholder: "",
|
|
31070
|
-
style: styles$
|
|
31105
|
+
style: styles$g.singleSelectShort
|
|
31071
31106
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31072
31107
|
key: n,
|
|
31073
31108
|
value: `${n}`,
|
|
@@ -31078,7 +31113,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31078
31113
|
label: "unlimited"
|
|
31079
31114
|
})]);
|
|
31080
31115
|
};
|
|
31081
|
-
const styles$
|
|
31116
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31082
31117
|
singleSelectShort: {
|
|
31083
31118
|
// Non-standard spacing, but it's the smallest we can go
|
|
31084
31119
|
// without running into styling issues with the dropdown.
|
|
@@ -31091,7 +31126,7 @@ const GraphTypeSelector = props => {
|
|
|
31091
31126
|
selectedValue: props.graphType,
|
|
31092
31127
|
onChange: props.onChange,
|
|
31093
31128
|
placeholder: "Select a graph type",
|
|
31094
|
-
style: styles$
|
|
31129
|
+
style: styles$f.singleSelectShort
|
|
31095
31130
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31096
31131
|
value: "linear",
|
|
31097
31132
|
label: "Linear function"
|
|
@@ -31124,7 +31159,7 @@ const GraphTypeSelector = props => {
|
|
|
31124
31159
|
label: "Angle"
|
|
31125
31160
|
}));
|
|
31126
31161
|
};
|
|
31127
|
-
const styles$
|
|
31162
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31128
31163
|
singleSelectShort: {
|
|
31129
31164
|
// Non-standard spacing, but it's the smallest we can go
|
|
31130
31165
|
// without running into styling issues with the dropdown.
|
|
@@ -31206,10 +31241,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31206
31241
|
backgroundImage: defaultBackgroundImage$1,
|
|
31207
31242
|
markings: "graph",
|
|
31208
31243
|
showProtractor: false,
|
|
31209
|
-
|
|
31210
|
-
showTooltips: false,
|
|
31211
|
-
rulerLabel: "",
|
|
31212
|
-
rulerTicks: 10
|
|
31244
|
+
showTooltips: false
|
|
31213
31245
|
};
|
|
31214
31246
|
componentDidMount() {
|
|
31215
31247
|
// TODO(scottgrant): This is a hack to remove the deprecated call to
|
|
@@ -31236,19 +31268,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31236
31268
|
return perseus.Changeable.change.apply(_this, args);
|
|
31237
31269
|
};
|
|
31238
31270
|
})();
|
|
31239
|
-
|
|
31240
|
-
// TODO(aria): Make either a wrapper for standard events to work
|
|
31241
|
-
// with this.change, or make these use some TextInput/NumberInput box
|
|
31242
|
-
changeRulerLabel = e => {
|
|
31243
|
-
this.change({
|
|
31244
|
-
rulerLabel: e.target.value
|
|
31245
|
-
});
|
|
31246
|
-
};
|
|
31247
|
-
changeRulerTicks = e => {
|
|
31248
|
-
this.change({
|
|
31249
|
-
rulerTicks: +e.target.value
|
|
31250
|
-
});
|
|
31251
|
-
};
|
|
31252
31271
|
changeBackgroundUrl = e => {
|
|
31253
31272
|
// Only continue on blur or "enter"
|
|
31254
31273
|
if (e.type === "keypress" && e.key !== "Enter") {
|
|
@@ -31569,10 +31588,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31569
31588
|
onChange: this.change
|
|
31570
31589
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31571
31590
|
label: "Background image URL:",
|
|
31572
|
-
style: styles$
|
|
31591
|
+
style: styles$e.resetSpaceTop
|
|
31573
31592
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31574
31593
|
type: "text",
|
|
31575
|
-
className: aphrodite.css(styles$
|
|
31594
|
+
className: aphrodite.css(styles$e.backgroundUrlInput),
|
|
31576
31595
|
ref: this.bgUrlRef,
|
|
31577
31596
|
value: this.state.backgroundImage.url || "",
|
|
31578
31597
|
onChange: e => {
|
|
@@ -31588,98 +31607,25 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31588
31607
|
onKeyPress: this.changeBackgroundUrl,
|
|
31589
31608
|
onBlur: this.changeBackgroundUrl
|
|
31590
31609
|
}), /*#__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, {
|
|
31591
|
-
style: styles$
|
|
31610
|
+
style: styles$e.protractorSection
|
|
31592
31611
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31593
|
-
style: styles$
|
|
31612
|
+
style: styles$e.checkboxRow
|
|
31594
31613
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31595
|
-
label: "Show ruler",
|
|
31596
|
-
showRuler: this.props.showRuler,
|
|
31597
|
-
onChange: this.change,
|
|
31598
|
-
style: styles$d.resetSpaceTop
|
|
31599
|
-
}), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
31600
31614
|
label: "Show protractor",
|
|
31601
31615
|
showProtractor: this.props.showProtractor,
|
|
31602
31616
|
onChange: this.change,
|
|
31603
|
-
style: styles$
|
|
31604
|
-
})),
|
|
31617
|
+
style: styles$e.resetSpaceTop
|
|
31618
|
+
})), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31605
31619
|
layout: "floating",
|
|
31606
|
-
text: "The
|
|
31620
|
+
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
31607
31621
|
kind: "warning"
|
|
31608
|
-
})
|
|
31609
|
-
style: styles$d.spaceTop
|
|
31610
|
-
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31611
|
-
label: "Ruler label:",
|
|
31612
|
-
style: styles$d.resetSpaceTop
|
|
31613
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31614
|
-
id: "ruler-label-select",
|
|
31615
|
-
selectedValue: this.props.rulerLabel,
|
|
31616
|
-
onChange: newValue => {
|
|
31617
|
-
this.change({
|
|
31618
|
-
rulerLabel: newValue
|
|
31619
|
-
});
|
|
31620
|
-
},
|
|
31621
|
-
placeholder: "None",
|
|
31622
|
-
style: styles$d.singleSelectShort
|
|
31623
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31624
|
-
value: "",
|
|
31625
|
-
label: "None",
|
|
31626
|
-
horizontalRule: "full-width"
|
|
31627
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31628
|
-
value: "mm",
|
|
31629
|
-
label: "Milimeters"
|
|
31630
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31631
|
-
value: "cm",
|
|
31632
|
-
label: "Centimeters"
|
|
31633
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31634
|
-
value: "m",
|
|
31635
|
-
label: "Meters"
|
|
31636
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31637
|
-
value: "km",
|
|
31638
|
-
label: "Kilometers",
|
|
31639
|
-
horizontalRule: "full-width"
|
|
31640
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31641
|
-
value: "in",
|
|
31642
|
-
label: "Inches"
|
|
31643
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31644
|
-
value: "ft",
|
|
31645
|
-
label: "Feet"
|
|
31646
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31647
|
-
value: "yd",
|
|
31648
|
-
label: "Yards"
|
|
31649
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31650
|
-
value: "mi",
|
|
31651
|
-
label: "Miles"
|
|
31652
|
-
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31653
|
-
label: "Ruler ticks:"
|
|
31654
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31655
|
-
id: "ruler-ticks-select",
|
|
31656
|
-
selectedValue: `${this.props.rulerTicks}`,
|
|
31657
|
-
onChange: newValue => {
|
|
31658
|
-
this.change({
|
|
31659
|
-
rulerTicks: newValue
|
|
31660
|
-
});
|
|
31661
|
-
},
|
|
31662
|
-
placeholder: "10",
|
|
31663
|
-
style: styles$d.singleSelectShort
|
|
31664
|
-
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31665
|
-
key: value,
|
|
31666
|
-
value: `${value}`,
|
|
31667
|
-
label: `${value}`
|
|
31668
|
-
}))))))));
|
|
31622
|
+
}))));
|
|
31669
31623
|
}
|
|
31670
31624
|
}
|
|
31671
|
-
const styles$
|
|
31625
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31672
31626
|
resetSpaceTop: {
|
|
31673
31627
|
marginTop: 0
|
|
31674
31628
|
},
|
|
31675
|
-
spaceTop: {
|
|
31676
|
-
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
31677
|
-
},
|
|
31678
|
-
singleSelectShort: {
|
|
31679
|
-
// Non-standard spacing, but it's the smallest we can go
|
|
31680
|
-
// without running into styling issues with the dropdown.
|
|
31681
|
-
height: 26
|
|
31682
|
-
},
|
|
31683
31629
|
backgroundUrlInput: {
|
|
31684
31630
|
border: `1px solid ${wonderBlocksTokens.color.offBlack32}`,
|
|
31685
31631
|
borderRadius: wonderBlocksTokens.spacing.xxxSmall_4,
|
|
@@ -31691,7 +31637,7 @@ const styles$d = aphrodite.StyleSheet.create({
|
|
|
31691
31637
|
justifyContent: "space-between",
|
|
31692
31638
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
31693
31639
|
},
|
|
31694
|
-
|
|
31640
|
+
protractorSection: {
|
|
31695
31641
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31696
31642
|
borderTop: `1px solid ${wonderBlocksTokens.color.offBlack16}`,
|
|
31697
31643
|
paddingTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31715,14 +31661,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31715
31661
|
const num = +newValue;
|
|
31716
31662
|
onChange(num);
|
|
31717
31663
|
},
|
|
31718
|
-
style: styles$
|
|
31664
|
+
style: styles$d.singleSelectShort
|
|
31719
31665
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31720
31666
|
key: n,
|
|
31721
31667
|
value: `${n}`,
|
|
31722
31668
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31723
31669
|
})));
|
|
31724
31670
|
};
|
|
31725
|
-
const styles$
|
|
31671
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
31726
31672
|
singleSelectShort: {
|
|
31727
31673
|
// Non-standard spacing, but it's the smallest we can go
|
|
31728
31674
|
// without running into styling issues with the dropdown.
|
|
@@ -31730,76 +31676,142 @@ const styles$c = aphrodite.StyleSheet.create({
|
|
|
31730
31676
|
}
|
|
31731
31677
|
});
|
|
31732
31678
|
|
|
31733
|
-
const
|
|
31679
|
+
const StartCoordsLine = props => {
|
|
31680
|
+
const {
|
|
31681
|
+
startCoords,
|
|
31682
|
+
onChange
|
|
31683
|
+
} = props;
|
|
31684
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31685
|
+
style: styles$c.tile
|
|
31686
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31687
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31688
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31689
|
+
coord: startCoords[0],
|
|
31690
|
+
labels: ["x", "y"],
|
|
31691
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31692
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31693
|
+
style: styles$c.tile
|
|
31694
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31695
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31696
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31697
|
+
coord: startCoords[1],
|
|
31698
|
+
labels: ["x", "y"],
|
|
31699
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31700
|
+
})));
|
|
31701
|
+
};
|
|
31702
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
31703
|
+
tile: {
|
|
31704
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31705
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31706
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
31707
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
31708
|
+
flexDirection: "row",
|
|
31709
|
+
alignItems: "center"
|
|
31710
|
+
}
|
|
31711
|
+
});
|
|
31712
|
+
|
|
31713
|
+
const StartCoordsMultiline = props => {
|
|
31734
31714
|
const {
|
|
31735
|
-
type,
|
|
31736
31715
|
startCoords,
|
|
31716
|
+
type,
|
|
31737
31717
|
onChange
|
|
31738
31718
|
} = props;
|
|
31719
|
+
const graphName = type === "segment" ? "Segment" : "Line";
|
|
31720
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, startCoords.map((coordPair, i) => /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
31721
|
+
key: `segment-${i}-start-coords`,
|
|
31722
|
+
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31723
|
+
expanded: true
|
|
31724
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31725
|
+
style: styles$b.nestedTile
|
|
31726
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31727
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31728
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31729
|
+
coord: coordPair[0],
|
|
31730
|
+
labels: ["x", "y"],
|
|
31731
|
+
onChange: value => {
|
|
31732
|
+
const newCoords = [...startCoords];
|
|
31733
|
+
newCoords[i] = [value, coordPair[1]];
|
|
31734
|
+
onChange(newCoords);
|
|
31735
|
+
}
|
|
31736
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31737
|
+
style: styles$b.nestedTile
|
|
31738
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31739
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
31740
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
31741
|
+
coord: coordPair[1],
|
|
31742
|
+
labels: ["x", "y"],
|
|
31743
|
+
onChange: value => {
|
|
31744
|
+
const newCoords = [...startCoords];
|
|
31745
|
+
newCoords[i] = [coordPair[0], value];
|
|
31746
|
+
onChange(newCoords);
|
|
31747
|
+
}
|
|
31748
|
+
})))));
|
|
31749
|
+
};
|
|
31750
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
31751
|
+
nestedTile: {
|
|
31752
|
+
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
31753
|
+
flexDirection: "row",
|
|
31754
|
+
alignItems: "center"
|
|
31755
|
+
}
|
|
31756
|
+
});
|
|
31739
31757
|
|
|
31740
|
-
|
|
31758
|
+
const StartCoordsSettingsInner = props => {
|
|
31759
|
+
const {
|
|
31760
|
+
type,
|
|
31761
|
+
range,
|
|
31762
|
+
step,
|
|
31763
|
+
onChange
|
|
31764
|
+
} = props;
|
|
31741
31765
|
switch (type) {
|
|
31766
|
+
// Graphs with startCoords of type CollinearTuple
|
|
31742
31767
|
case "linear":
|
|
31743
31768
|
case "ray":
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
|
|
31754
|
-
|
|
31769
|
+
// Gets the startCoords from props if they're passed in,
|
|
31770
|
+
// otherwise calculates the default startCoords.
|
|
31771
|
+
const linearCoords = perseus.getLineCoords(props, range, step);
|
|
31772
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsLine, {
|
|
31773
|
+
startCoords: linearCoords,
|
|
31774
|
+
onChange: onChange
|
|
31775
|
+
});
|
|
31776
|
+
// Graphs with startCoords of type CollinearTuple[]
|
|
31777
|
+
case "linear-system":
|
|
31778
|
+
case "segment":
|
|
31779
|
+
const multiLineCoords =
|
|
31780
|
+
// Gets the startCoords from props if they're passed in,
|
|
31781
|
+
// otherwise calculates the default startCoords.
|
|
31782
|
+
type === "segment" ? perseus.getSegmentCoords(props, range, step) : perseus.getLinearSystemCoords(props, range, step);
|
|
31783
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsMultiline, {
|
|
31784
|
+
type: type,
|
|
31785
|
+
startCoords: multiLineCoords,
|
|
31786
|
+
onChange: onChange
|
|
31787
|
+
});
|
|
31755
31788
|
default:
|
|
31756
31789
|
return null;
|
|
31757
31790
|
}
|
|
31758
31791
|
};
|
|
31759
|
-
const
|
|
31792
|
+
const StartCoordsSettings = props => {
|
|
31760
31793
|
const {
|
|
31761
|
-
type,
|
|
31762
31794
|
range,
|
|
31763
31795
|
step,
|
|
31764
31796
|
onChange
|
|
31765
31797
|
} = props;
|
|
31766
31798
|
const [isOpen, setIsOpen] = React__namespace.useState(true);
|
|
31767
|
-
|
|
31768
|
-
return null;
|
|
31769
|
-
}
|
|
31770
|
-
const defaultStartCoords = perseus.getLineCoords({
|
|
31771
|
-
type: type
|
|
31772
|
-
}, range, step);
|
|
31773
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31774
|
-
style: styles$b.container
|
|
31775
|
-
}, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31799
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
31776
31800
|
isCollapsible: true,
|
|
31777
31801
|
title: "Start coordinates",
|
|
31778
31802
|
isOpen: isOpen,
|
|
31779
31803
|
onToggle: () => setIsOpen(!isOpen)
|
|
31780
|
-
}), isOpen && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(
|
|
31781
|
-
type: type,
|
|
31782
|
-
startCoords: props.startCoords ?? defaultStartCoords,
|
|
31783
|
-
onChange: onChange
|
|
31784
|
-
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31804
|
+
}), isOpen && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(StartCoordsSettingsInner, props), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31785
31805
|
size: wonderBlocksTokens.spacing.small_12
|
|
31786
31806
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31787
31807
|
startIcon: arrowCounterClockwise__default["default"],
|
|
31788
31808
|
kind: "tertiary",
|
|
31789
31809
|
size: "small",
|
|
31790
31810
|
onClick: () => {
|
|
31791
|
-
onChange(
|
|
31811
|
+
onChange(getDefaultGraphStartCoords(props, range, step));
|
|
31792
31812
|
}
|
|
31793
|
-
}, "Use default start
|
|
31813
|
+
}, "Use default start coordinates")));
|
|
31794
31814
|
};
|
|
31795
|
-
const styles$b = aphrodite.StyleSheet.create({
|
|
31796
|
-
tile: {
|
|
31797
|
-
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31798
|
-
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
31799
|
-
padding: wonderBlocksTokens.spacing.small_12,
|
|
31800
|
-
borderRadius: wonderBlocksTokens.spacing.xSmall_8
|
|
31801
|
-
}
|
|
31802
|
-
});
|
|
31803
31815
|
|
|
31804
31816
|
const {
|
|
31805
31817
|
InfoTip: InfoTip$b
|
|
@@ -31877,10 +31889,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31877
31889
|
backgroundImage: this.props.backgroundImage,
|
|
31878
31890
|
markings: this.props.markings,
|
|
31879
31891
|
showProtractor: this.props.showProtractor,
|
|
31880
|
-
showRuler: this.props.showRuler,
|
|
31881
31892
|
showTooltips: this.props.showTooltips,
|
|
31882
|
-
rulerLabel: this.props.rulerLabel,
|
|
31883
|
-
rulerTicks: this.props.rulerTicks,
|
|
31884
31893
|
lockedFigures: this.props.lockedFigures,
|
|
31885
31894
|
trackInteraction: function () {},
|
|
31886
31895
|
onChange: newProps => {
|
|
@@ -32067,7 +32076,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32067
32076
|
}
|
|
32068
32077
|
});
|
|
32069
32078
|
}
|
|
32070
|
-
})),
|
|
32079
|
+
})), this.props.graph?.type && this.props.apiOptions.flags?.mafs?.["start-coords-ui"] && /*#__PURE__*/React__namespace.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32071
32080
|
range: this.props.range,
|
|
32072
32081
|
step: this.props.step,
|
|
32073
32082
|
onChange: this.changeStartCoords
|
|
@@ -32082,10 +32091,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32082
32091
|
backgroundImage: this.props.backgroundImage,
|
|
32083
32092
|
markings: this.props.markings,
|
|
32084
32093
|
showProtractor: this.props.showProtractor,
|
|
32085
|
-
showRuler: this.props.showRuler,
|
|
32086
32094
|
showTooltips: this.props.showTooltips,
|
|
32087
|
-
rulerLabel: this.props.rulerLabel,
|
|
32088
|
-
rulerTicks: this.props.rulerTicks,
|
|
32089
32095
|
onChange: this.props.onChange
|
|
32090
32096
|
}), this.props.correct.type === "polygon" && /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
32091
32097
|
label: "Student answer must"
|
|
@@ -32143,7 +32149,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32143
32149
|
});
|
|
32144
32150
|
};
|
|
32145
32151
|
changeStartCoords = coords => {
|
|
32146
|
-
if (this.props.graph?.type
|
|
32152
|
+
if (!this.props.graph?.type) {
|
|
32147
32153
|
return;
|
|
32148
32154
|
}
|
|
32149
32155
|
const graph = {
|
|
@@ -32160,7 +32166,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32160
32166
|
// is copied from the question editor and pasted into the hint editor
|
|
32161
32167
|
// (double brackets in the markdown).
|
|
32162
32168
|
serialize() {
|
|
32163
|
-
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "
|
|
32169
|
+
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures");
|
|
32164
32170
|
|
|
32165
32171
|
// eslint-disable-next-line react/no-string-refs
|
|
32166
32172
|
const graph = this.refs.graph;
|
|
@@ -32176,7 +32182,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32176
32182
|
});
|
|
32177
32183
|
___default["default"].each(["allowReflexAngles", "angleOffsetDeg", "numPoints", "numSides", "numSegments", "showAngles", "showSides", "snapTo", "snapDegrees"], function (key) {
|
|
32178
32184
|
if (___default["default"].has(correct, key)) {
|
|
32179
|
-
// @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor"
|
|
32185
|
+
// @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor">'.
|
|
32180
32186
|
json.graph[key] = correct[key];
|
|
32181
32187
|
}
|
|
32182
32188
|
});
|
|
@@ -33908,7 +33914,7 @@ class MatrixEditor extends React__namespace.Component {
|
|
|
33908
33914
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
33909
33915
|
const {
|
|
33910
33916
|
InfoTip: InfoTip$9,
|
|
33911
|
-
NumberInput: NumberInput$
|
|
33917
|
+
NumberInput: NumberInput$7,
|
|
33912
33918
|
PropCheckBox: PropCheckBox$5,
|
|
33913
33919
|
RangeInput: RangeInput$2
|
|
33914
33920
|
} = perseus.components;
|
|
@@ -33961,14 +33967,14 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
33961
33967
|
className: "perseus-widget-row"
|
|
33962
33968
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
33963
33969
|
className: "perseus-widget-left-col"
|
|
33964
|
-
}, "Pixels from top:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33970
|
+
}, "Pixels from top:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
|
|
33965
33971
|
placeholder: 0,
|
|
33966
33972
|
onChange: this._changeTop,
|
|
33967
33973
|
value: image.top,
|
|
33968
33974
|
useArrowKeys: true
|
|
33969
33975
|
})), /*#__PURE__*/React__namespace.createElement("label", {
|
|
33970
33976
|
className: "perseus-widget-right-col"
|
|
33971
|
-
}, "Pixels from left:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
33977
|
+
}, "Pixels from left:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
|
|
33972
33978
|
placeholder: 0,
|
|
33973
33979
|
onChange: this._changeLeft,
|
|
33974
33980
|
value: image.left,
|
|
@@ -34014,14 +34020,14 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
34014
34020
|
key: n,
|
|
34015
34021
|
value: n
|
|
34016
34022
|
}, n);
|
|
34017
|
-
})))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34023
|
+
})))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
|
|
34018
34024
|
placeholder: 40
|
|
34019
34025
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34020
34026
|
,
|
|
34021
34027
|
onChange: this.change("rulerPixels"),
|
|
34022
34028
|
value: this.props.rulerPixels,
|
|
34023
34029
|
useArrowKeys: true
|
|
34024
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34030
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
|
|
34025
34031
|
placeholder: 10
|
|
34026
34032
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34027
34033
|
,
|
|
@@ -34069,7 +34075,7 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
34069
34075
|
}
|
|
34070
34076
|
|
|
34071
34077
|
const {
|
|
34072
|
-
NumberInput: NumberInput$
|
|
34078
|
+
NumberInput: NumberInput$6,
|
|
34073
34079
|
TextInput: TextInput$4
|
|
34074
34080
|
} = perseus.components;
|
|
34075
34081
|
class MoleculeWidgetEditor extends React__namespace.Component {
|
|
@@ -34107,7 +34113,7 @@ class MoleculeWidgetEditor extends React__namespace.Component {
|
|
|
34107
34113
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React__namespace.createElement(TextInput$4, {
|
|
34108
34114
|
onChange: this.updateMolecule,
|
|
34109
34115
|
value: this.props.smiles
|
|
34110
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34116
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React__namespace.createElement(NumberInput$6, {
|
|
34111
34117
|
onChange: this.updateRotation,
|
|
34112
34118
|
value: this.props.rotationAngle
|
|
34113
34119
|
}))));
|
|
@@ -34118,7 +34124,7 @@ class MoleculeWidgetEditor extends React__namespace.Component {
|
|
|
34118
34124
|
const {
|
|
34119
34125
|
ButtonGroup: ButtonGroup$1,
|
|
34120
34126
|
InfoTip: InfoTip$8,
|
|
34121
|
-
NumberInput: NumberInput$
|
|
34127
|
+
NumberInput: NumberInput$5,
|
|
34122
34128
|
PropCheckBox: PropCheckBox$4,
|
|
34123
34129
|
RangeInput: RangeInput$1
|
|
34124
34130
|
} = perseus.components;
|
|
@@ -34298,7 +34304,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34298
34304
|
}, "\u2264"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
34299
34305
|
value: "ge",
|
|
34300
34306
|
"aria-label": "Greater than or equal"
|
|
34301
|
-
}, "\u2265")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34307
|
+
}, "\u2265")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34302
34308
|
value: this.props.correctX,
|
|
34303
34309
|
format: this.props.labelStyle
|
|
34304
34310
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -34310,7 +34316,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34310
34316
|
useArrowKeys: true
|
|
34311
34317
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, \u2264, \u2265)."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34312
34318
|
className: "perseus-widget-row"
|
|
34313
|
-
}, this.props.static ? /*#__PURE__*/React__namespace.createElement("label", null, "Range:") : /*#__PURE__*/React__namespace.createElement("label", null, "Position:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34319
|
+
}, this.props.static ? /*#__PURE__*/React__namespace.createElement("label", null, "Range:") : /*#__PURE__*/React__namespace.createElement("label", null, "Position:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34314
34320
|
value: this.props.initialX,
|
|
34315
34321
|
format: this.props.labelStyle
|
|
34316
34322
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -34330,7 +34336,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34330
34336
|
className: "perseus-widget-row"
|
|
34331
34337
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34332
34338
|
className: "perseus-widget-left-col"
|
|
34333
|
-
}, "Labels:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34339
|
+
}, "Labels:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34334
34340
|
value: labelRange[0],
|
|
34335
34341
|
placeholder: range[0],
|
|
34336
34342
|
format: this.props.labelStyle,
|
|
@@ -34339,7 +34345,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34339
34345
|
,
|
|
34340
34346
|
onChange: this.onLabelRangeChange.bind(this, 0),
|
|
34341
34347
|
useArrowKeys: true
|
|
34342
|
-
}), /*#__PURE__*/React__namespace.createElement("span", null, " & "), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34348
|
+
}), /*#__PURE__*/React__namespace.createElement("span", null, " & "), /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34343
34349
|
value: labelRange[1],
|
|
34344
34350
|
placeholder: range[1],
|
|
34345
34351
|
format: this.props.labelStyle,
|
|
@@ -34377,7 +34383,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34377
34383
|
onChange: this.props.onChange
|
|
34378
34384
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34379
34385
|
className: "perseus-widget-row"
|
|
34380
|
-
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34386
|
+
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34381
34387
|
value: this.props.numDivisions || null,
|
|
34382
34388
|
format: "decimal",
|
|
34383
34389
|
onChange: this.onNumDivisionsChange,
|
|
@@ -34386,7 +34392,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34386
34392
|
},
|
|
34387
34393
|
placeholder: width / this.props.tickStep,
|
|
34388
34394
|
useArrowKeys: true
|
|
34389
|
-
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number (and position) of the tick marks. The number of divisions is constrained to", " " + divisionRange[0] + EN_DASH + divisionRange[1], ".", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34395
|
+
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number (and position) of the tick marks. The number of divisions is constrained to", " " + divisionRange[0] + EN_DASH + divisionRange[1], ".", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34390
34396
|
value: this.props.numDivisions || null,
|
|
34391
34397
|
format: "decimal",
|
|
34392
34398
|
onChange: this.onNumDivisionsChange,
|
|
@@ -34395,7 +34401,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34395
34401
|
},
|
|
34396
34402
|
placeholder: width / this.props.tickStep,
|
|
34397
34403
|
useArrowKeys: true
|
|
34398
|
-
})), " ", /*#__PURE__*/React__namespace.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34404
|
+
})), " ", /*#__PURE__*/React__namespace.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34399
34405
|
value: this.props.tickStep || null,
|
|
34400
34406
|
format: this.props.labelStyle,
|
|
34401
34407
|
onChange: this.onTickStepChange,
|
|
@@ -34406,7 +34412,7 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34406
34412
|
useArrowKeys: true
|
|
34407
34413
|
})), /*#__PURE__*/React__namespace.createElement(InfoTip$8, null, /*#__PURE__*/React__namespace.createElement("p", null, "This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly.", " ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("strong", null, "Note:"), " There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.")))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34408
34414
|
className: "perseus-widget-row"
|
|
34409
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34415
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
34410
34416
|
value: snapDivisions,
|
|
34411
34417
|
checkValidity: val => val > 0,
|
|
34412
34418
|
format: this.props.labelStyle
|
|
@@ -34422,9 +34428,9 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34422
34428
|
const {
|
|
34423
34429
|
ButtonGroup,
|
|
34424
34430
|
InfoTip: InfoTip$7,
|
|
34425
|
-
InlineIcon: InlineIcon$
|
|
34431
|
+
InlineIcon: InlineIcon$1,
|
|
34426
34432
|
MultiButtonGroup,
|
|
34427
|
-
NumberInput: NumberInput$
|
|
34433
|
+
NumberInput: NumberInput$4,
|
|
34428
34434
|
PropCheckBox: PropCheckBox$3,
|
|
34429
34435
|
TextInput: TextInput$3
|
|
34430
34436
|
} = perseus.components;
|
|
@@ -34528,7 +34534,7 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34528
34534
|
})));
|
|
34529
34535
|
const maxError = i => /*#__PURE__*/React__namespace.createElement("div", {
|
|
34530
34536
|
className: "perseus-widget-row"
|
|
34531
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Max error", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34537
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Max error", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$4, {
|
|
34532
34538
|
className: "max-error",
|
|
34533
34539
|
value: answers[i]["maxError"],
|
|
34534
34540
|
onChange: this.updateAnswer(i, "maxError"),
|
|
@@ -34603,7 +34609,7 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34603
34609
|
key: i
|
|
34604
34610
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34605
34611
|
className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
|
|
34606
|
-
}, /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34612
|
+
}, /*#__PURE__*/React__namespace.createElement(NumberInput$4, {
|
|
34607
34613
|
value: answer.value,
|
|
34608
34614
|
className: "numeric-input-value",
|
|
34609
34615
|
placeholder: "answer",
|
|
@@ -34650,7 +34656,7 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34650
34656
|
className: "max-error-container"
|
|
34651
34657
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34652
34658
|
className: "max-error-plusmn"
|
|
34653
|
-
}, "\xB1"), /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
34659
|
+
}, "\xB1"), /*#__PURE__*/React__namespace.createElement(NumberInput$4, {
|
|
34654
34660
|
placeholder: 0,
|
|
34655
34661
|
value: answers[i]["maxError"],
|
|
34656
34662
|
format: ___default["default"].last(answer.answerForms || []),
|
|
@@ -34678,7 +34684,7 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34678
34684
|
this.onTrashAnswer(i);
|
|
34679
34685
|
},
|
|
34680
34686
|
onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
|
|
34681
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
34687
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconTrash$1)), /*#__PURE__*/React__namespace.createElement("a", {
|
|
34682
34688
|
href: "#",
|
|
34683
34689
|
className: "options-toggle",
|
|
34684
34690
|
"aria-label": "Toggle options",
|
|
@@ -34689,7 +34695,7 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34689
34695
|
this.onToggleOptions(i);
|
|
34690
34696
|
},
|
|
34691
34697
|
onKeyDown: e => this.onSpace(e, this.onToggleOptions)
|
|
34692
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$
|
|
34698
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconGear))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34693
34699
|
className: "input-answer-editor-message"
|
|
34694
34700
|
}, editor), this.state.showOptions[i] && /*#__PURE__*/React__namespace.createElement("div", {
|
|
34695
34701
|
className: "options-container"
|
|
@@ -35004,7 +35010,7 @@ class PassageEditor extends React__namespace.Component {
|
|
|
35004
35010
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
35005
35011
|
const {
|
|
35006
35012
|
InfoTip: InfoTip$4,
|
|
35007
|
-
NumberInput: NumberInput$
|
|
35013
|
+
NumberInput: NumberInput$3,
|
|
35008
35014
|
TextInput: TextInput$2
|
|
35009
35015
|
} = perseus.components;
|
|
35010
35016
|
class PassageRefEditor extends React__namespace.Component {
|
|
@@ -35033,12 +35039,12 @@ class PassageRefEditor extends React__namespace.Component {
|
|
|
35033
35039
|
return perseus.EditorJsonify.serialize.call(this);
|
|
35034
35040
|
};
|
|
35035
35041
|
render() {
|
|
35036
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Passage Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
35042
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Passage Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
35037
35043
|
value: this.props.passageNumber
|
|
35038
35044
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
35039
35045
|
,
|
|
35040
35046
|
onChange: this.change("passageNumber")
|
|
35041
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Reference Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
35047
|
+
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Reference Number: ", /*#__PURE__*/React__namespace.createElement(NumberInput$3, {
|
|
35042
35048
|
value: this.props.referenceNumber
|
|
35043
35049
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
35044
35050
|
,
|
|
@@ -35090,7 +35096,7 @@ class PassageRefTargetEditor extends React__namespace.Component {
|
|
|
35090
35096
|
|
|
35091
35097
|
const {
|
|
35092
35098
|
InfoTip: InfoTip$3,
|
|
35093
|
-
NumberInput: NumberInput$
|
|
35099
|
+
NumberInput: NumberInput$2,
|
|
35094
35100
|
RangeInput,
|
|
35095
35101
|
TextListEditor: TextListEditor$1
|
|
35096
35102
|
} = perseus.components;
|
|
@@ -35340,7 +35346,7 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
35340
35346
|
className: "set-from-scale-box"
|
|
35341
35347
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
35342
35348
|
className: "categories-title"
|
|
35343
|
-
}, "Set Categories From Scale"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
35349
|
+
}, "Set Categories From Scale"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$2, {
|
|
35344
35350
|
placeholder: 1,
|
|
35345
35351
|
useArrowKeys: true,
|
|
35346
35352
|
value: this.state.tickStep,
|
|
@@ -35352,7 +35358,7 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
35352
35358
|
onChange: this.handleChangeRange
|
|
35353
35359
|
}))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
|
|
35354
35360
|
onClick: this.setCategoriesFromScale
|
|
35355
|
-
}, "Set Categories", " "))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
35361
|
+
}, "Set Categories", " "))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$2, {
|
|
35356
35362
|
useArrowKeys: true,
|
|
35357
35363
|
value: this.props.labelInterval,
|
|
35358
35364
|
onChange: this.changeLabelInterval
|
|
@@ -35402,7 +35408,7 @@ class PlotterEditor extends React__namespace.Component {
|
|
|
35402
35408
|
* This editor is for embedding Khan Academy Python programs.
|
|
35403
35409
|
*/
|
|
35404
35410
|
const {
|
|
35405
|
-
NumberInput: NumberInput$
|
|
35411
|
+
NumberInput: NumberInput$1,
|
|
35406
35412
|
TextInput: TextInput$1
|
|
35407
35413
|
} = perseus.components;
|
|
35408
35414
|
function validateOptions(height, programID) {
|
|
@@ -35449,7 +35455,7 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
35449
35455
|
value: this.props.programID,
|
|
35450
35456
|
onChange: this.change("programID"),
|
|
35451
35457
|
placeholder: "123"
|
|
35452
|
-
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("label", null, "Height:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$
|
|
35458
|
+
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("label", null, "Height:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$1, {
|
|
35453
35459
|
value: this.props.height,
|
|
35454
35460
|
onChange: this.change("height"),
|
|
35455
35461
|
placeholder: "400"
|
|
@@ -35459,7 +35465,7 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
35459
35465
|
|
|
35460
35466
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/forbid-prop-types, react/sort-comp */
|
|
35461
35467
|
const {
|
|
35462
|
-
InlineIcon
|
|
35468
|
+
InlineIcon,
|
|
35463
35469
|
PropCheckBox: PropCheckBox$1
|
|
35464
35470
|
} = perseus.components;
|
|
35465
35471
|
const {
|
|
@@ -35511,7 +35517,7 @@ class ChoiceEditor extends React__namespace.Component {
|
|
|
35511
35517
|
this.props.onDelete();
|
|
35512
35518
|
},
|
|
35513
35519
|
title: "Remove this choice"
|
|
35514
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon
|
|
35520
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconTrash));
|
|
35515
35521
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
35516
35522
|
className: "choice-clue-editors"
|
|
35517
35523
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -35622,13 +35628,13 @@ class RadioEditor extends React__namespace.Component {
|
|
|
35622
35628
|
// eslint-disable-next-line react/jsx-no-bind
|
|
35623
35629
|
,
|
|
35624
35630
|
onClick: this.addChoice.bind(this, false)
|
|
35625
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon
|
|
35631
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React__namespace.createElement("a", {
|
|
35626
35632
|
className: "simple-button",
|
|
35627
35633
|
href: "#"
|
|
35628
35634
|
// eslint-disable-next-line react/jsx-no-bind
|
|
35629
35635
|
,
|
|
35630
35636
|
onClick: this.addChoice.bind(this, true)
|
|
35631
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon
|
|
35637
|
+
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconPlus), " None of the above", " ")));
|
|
35632
35638
|
}
|
|
35633
35639
|
change = (() => {
|
|
35634
35640
|
var _this = this;
|
|
@@ -35868,7 +35874,7 @@ class SorterEditor extends React__namespace.Component {
|
|
|
35868
35874
|
/* eslint-disable react/sort-comp */
|
|
35869
35875
|
const {
|
|
35870
35876
|
InfoTip: InfoTip$1,
|
|
35871
|
-
NumberInput
|
|
35877
|
+
NumberInput
|
|
35872
35878
|
} = perseus.components;
|
|
35873
35879
|
const Table = perseus.TableWidget.widget;
|
|
35874
35880
|
class TableEditor extends React__namespace.Component {
|
|
@@ -35907,7 +35913,7 @@ class TableEditor extends React__namespace.Component {
|
|
|
35907
35913
|
});
|
|
35908
35914
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
35909
35915
|
className: "perseus-widget-row"
|
|
35910
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput
|
|
35916
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput, {
|
|
35911
35917
|
ref: this.numberOfColumns,
|
|
35912
35918
|
value: this.props.columns,
|
|
35913
35919
|
onChange: val => {
|
|
@@ -35918,7 +35924,7 @@ class TableEditor extends React__namespace.Component {
|
|
|
35918
35924
|
useArrowKeys: true
|
|
35919
35925
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
35920
35926
|
className: "perseus-widget-row"
|
|
35921
|
-
}, /*#__PURE__*/React__namespace.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput
|
|
35927
|
+
}, /*#__PURE__*/React__namespace.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput
|
|
35922
35928
|
// eslint-disable-next-line react/no-string-refs
|
|
35923
35929
|
, {
|
|
35924
35930
|
ref: "numberOfRows",
|
|
@@ -35975,240 +35981,6 @@ class TableEditor extends React__namespace.Component {
|
|
|
35975
35981
|
};
|
|
35976
35982
|
}
|
|
35977
35983
|
|
|
35978
|
-
/* eslint-disable react/no-unsafe */
|
|
35979
|
-
const {
|
|
35980
|
-
InlineIcon,
|
|
35981
|
-
NumberInput
|
|
35982
|
-
} = perseus.components;
|
|
35983
|
-
const {
|
|
35984
|
-
iconOk,
|
|
35985
|
-
iconRemove
|
|
35986
|
-
} = perseus.icons;
|
|
35987
|
-
|
|
35988
|
-
// TODO(joel): teach KAS how to accept an answer only if it's expressed in
|
|
35989
|
-
// terms of a certain type.
|
|
35990
|
-
// TODO(joel): Allow sigfigs within a range rather than an exact expected
|
|
35991
|
-
// value?
|
|
35992
|
-
|
|
35993
|
-
const ALL = "all";
|
|
35994
|
-
const SOME = "some";
|
|
35995
|
-
const MAX_SIGFIGS = 10;
|
|
35996
|
-
const sigfigPrint = function (num, sigfigs) {
|
|
35997
|
-
return perseus.displaySigFigs(num, sigfigs, -MAX_SIGFIGS, false);
|
|
35998
|
-
};
|
|
35999
|
-
|
|
36000
|
-
// Extract the primitive units from a unit expression. This first simplifies
|
|
36001
|
-
// `expr` to a `Mul` like "5 kg m / s^2" then removes the first term.
|
|
36002
|
-
const primUnits = function (expr) {
|
|
36003
|
-
return expr.simplify().asMul().partition()[1].flatten().simplify();
|
|
36004
|
-
};
|
|
36005
|
-
// Show the name of a unit and whether it's recognized by KAS.
|
|
36006
|
-
//
|
|
36007
|
-
// In the future I plan for this to show an example of a thing that would be
|
|
36008
|
-
// accepted in that unit.
|
|
36009
|
-
class UnitExample extends React__namespace.Component {
|
|
36010
|
-
// TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`
|
|
36011
|
-
UNSAFE_componentWillMount() {
|
|
36012
|
-
// @ts-expect-error - TS2345 - Argument of type 'Readonly<any> & Readonly<{ children?: ReactNode; }>' is not assignable to parameter of type '{ name: any; original: any; sigfigs: any; }'.
|
|
36013
|
-
this._checkValidity(this.props);
|
|
36014
|
-
}
|
|
36015
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
36016
|
-
this._checkValidity(nextProps);
|
|
36017
|
-
}
|
|
36018
|
-
_checkValidity = _ref => {
|
|
36019
|
-
let {
|
|
36020
|
-
name,
|
|
36021
|
-
original,
|
|
36022
|
-
sigfigs
|
|
36023
|
-
} = _ref;
|
|
36024
|
-
const parseResult = KAS__namespace.unitParse(name);
|
|
36025
|
-
let solvedExample = "";
|
|
36026
|
-
|
|
36027
|
-
// A unit is valid if it parses and is equivalent to the original.
|
|
36028
|
-
let valid = true;
|
|
36029
|
-
if (parseResult.parsed && original) {
|
|
36030
|
-
const x = new KAS__namespace.Var("x");
|
|
36031
|
-
const {
|
|
36032
|
-
unit
|
|
36033
|
-
} = parseResult;
|
|
36034
|
-
const equality = new KAS__namespace.Eq(original, "=", new KAS__namespace.Mul(x, unit));
|
|
36035
|
-
try {
|
|
36036
|
-
const answer = equality.solveLinearEquationForVariable(x);
|
|
36037
|
-
|
|
36038
|
-
// The third parameter is the least significant decimal place.
|
|
36039
|
-
// I.e. the index of the last place you care about
|
|
36040
|
-
// (543210.(-1)(-2)(-3) etc). We use -10 because that should
|
|
36041
|
-
// always be safe since we only care up to maximum 10 decimal
|
|
36042
|
-
// places.
|
|
36043
|
-
solvedExample = sigfigPrint(answer.eval(), sigfigs);
|
|
36044
|
-
valid = KAS__namespace.compare(primUnits(original), primUnits(unit)).equal;
|
|
36045
|
-
} catch (e) {
|
|
36046
|
-
valid = false;
|
|
36047
|
-
}
|
|
36048
|
-
} else {
|
|
36049
|
-
valid = false;
|
|
36050
|
-
}
|
|
36051
|
-
this.setState({
|
|
36052
|
-
valid,
|
|
36053
|
-
solvedExample
|
|
36054
|
-
});
|
|
36055
|
-
};
|
|
36056
|
-
render() {
|
|
36057
|
-
let icon;
|
|
36058
|
-
if (this.state.valid) {
|
|
36059
|
-
icon = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("span", {
|
|
36060
|
-
className: "unit-example-okay"
|
|
36061
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconOk)), this.state.solvedExample);
|
|
36062
|
-
} else {
|
|
36063
|
-
icon = /*#__PURE__*/React__namespace.createElement("span", {
|
|
36064
|
-
className: "unit-example-not-okay"
|
|
36065
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconRemove));
|
|
36066
|
-
}
|
|
36067
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, icon, " ", this.props.name);
|
|
36068
|
-
}
|
|
36069
|
-
}
|
|
36070
|
-
class UnitInputEditor extends React__namespace.Component {
|
|
36071
|
-
parsed;
|
|
36072
|
-
groupId;
|
|
36073
|
-
original;
|
|
36074
|
-
static propTypes = {
|
|
36075
|
-
...perseus.Changeable.propTypes,
|
|
36076
|
-
value: PropTypes__default["default"].string,
|
|
36077
|
-
acceptingUnits: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
|
|
36078
|
-
accepting: PropTypes__default["default"].oneOf([ALL, SOME]),
|
|
36079
|
-
sigfigs: PropTypes__default["default"].number
|
|
36080
|
-
};
|
|
36081
|
-
static widgetName = "unit-input";
|
|
36082
|
-
static defaultProps = {
|
|
36083
|
-
value: "5x10^5 kg m / s^2",
|
|
36084
|
-
accepting: ALL,
|
|
36085
|
-
sigfigs: 3
|
|
36086
|
-
};
|
|
36087
|
-
constructor(props) {
|
|
36088
|
-
super(props);
|
|
36089
|
-
this.groupId = ___default["default"].uniqueId("accepting");
|
|
36090
|
-
this._doOriginal(props);
|
|
36091
|
-
}
|
|
36092
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
36093
|
-
this._doOriginal(nextProps);
|
|
36094
|
-
}
|
|
36095
|
-
change = (() => {
|
|
36096
|
-
var _this = this;
|
|
36097
|
-
return function () {
|
|
36098
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36099
|
-
args[_key] = arguments[_key];
|
|
36100
|
-
}
|
|
36101
|
-
return perseus.Changeable.change.apply(_this, args);
|
|
36102
|
-
};
|
|
36103
|
-
})();
|
|
36104
|
-
handleAcceptingUnitsChange = event => {
|
|
36105
|
-
const acceptingUnits = event.target.value.split(",").map(str => str.trim()).filter(str => str !== "");
|
|
36106
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36107
|
-
this.change({
|
|
36108
|
-
acceptingUnits
|
|
36109
|
-
});
|
|
36110
|
-
};
|
|
36111
|
-
handleSigfigChange = sigfigs => {
|
|
36112
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36113
|
-
this.change({
|
|
36114
|
-
sigfigs
|
|
36115
|
-
});
|
|
36116
|
-
};
|
|
36117
|
-
_checkSigfigValidity = sigfigs => {
|
|
36118
|
-
return sigfigs > 0 && sigfigs <= MAX_SIGFIGS;
|
|
36119
|
-
};
|
|
36120
|
-
_setAccepting = val => {
|
|
36121
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36122
|
-
this.change({
|
|
36123
|
-
accepting: val
|
|
36124
|
-
});
|
|
36125
|
-
};
|
|
36126
|
-
_doOriginal = props => {
|
|
36127
|
-
const tryParse = KAS__namespace.unitParse(props.value);
|
|
36128
|
-
this.parsed = false;
|
|
36129
|
-
|
|
36130
|
-
// Only update this state if the unit parsed *and* it has a magnitude
|
|
36131
|
-
// attached to it. KAS can also parse units without magnitudes ("1.2
|
|
36132
|
-
// g" vs "g").
|
|
36133
|
-
if (tryParse.parsed && tryParse.type === "unitMagnitude") {
|
|
36134
|
-
this.original = tryParse.expr;
|
|
36135
|
-
this.parsed = true;
|
|
36136
|
-
}
|
|
36137
|
-
};
|
|
36138
|
-
onChange = event => {
|
|
36139
|
-
this.props.onChange({
|
|
36140
|
-
value: event.target.value
|
|
36141
|
-
});
|
|
36142
|
-
};
|
|
36143
|
-
getSaveWarnings = () => {
|
|
36144
|
-
const {
|
|
36145
|
-
value,
|
|
36146
|
-
accepting,
|
|
36147
|
-
acceptingUnits
|
|
36148
|
-
} = this.props;
|
|
36149
|
-
const warnings = [];
|
|
36150
|
-
const tryParse = KAS__namespace.unitParse(value);
|
|
36151
|
-
if (!tryParse.parsed) {
|
|
36152
|
-
warnings.push("Answer did not parse");
|
|
36153
|
-
}
|
|
36154
|
-
if (accepting === SOME && acceptingUnits.length === 0) {
|
|
36155
|
-
warnings.push("There are no accepted units");
|
|
36156
|
-
}
|
|
36157
|
-
return warnings;
|
|
36158
|
-
};
|
|
36159
|
-
serialize = () => {
|
|
36160
|
-
return perseus.EditorJsonify.serialize.call(this);
|
|
36161
|
-
};
|
|
36162
|
-
render() {
|
|
36163
|
-
const {
|
|
36164
|
-
acceptingUnits = [],
|
|
36165
|
-
accepting
|
|
36166
|
-
} = this.props;
|
|
36167
|
-
let acceptingElem = null;
|
|
36168
|
-
if (accepting === SOME) {
|
|
36169
|
-
const unitsArr = acceptingUnits.map((name, i) => /*#__PURE__*/React__namespace.createElement(UnitExample, {
|
|
36170
|
-
name: name,
|
|
36171
|
-
original: this.original || null,
|
|
36172
|
-
sigfigs: this.props.sigfigs,
|
|
36173
|
-
key: i
|
|
36174
|
-
}));
|
|
36175
|
-
|
|
36176
|
-
// @ts-expect-error - TS2322 - Type 'Element' is not assignable to type 'null'.
|
|
36177
|
-
acceptingElem = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
36178
|
-
type: "text",
|
|
36179
|
-
defaultValue: acceptingUnits.join(", "),
|
|
36180
|
-
onChange: this.handleAcceptingUnitsChange
|
|
36181
|
-
}), " ", "(comma-separated)", unitsArr);
|
|
36182
|
-
}
|
|
36183
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
36184
|
-
className: "unit-editor"
|
|
36185
|
-
}, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
36186
|
-
value: this.props.value,
|
|
36187
|
-
className: "unit-editor-canonical",
|
|
36188
|
-
onChange: this.onChange
|
|
36189
|
-
}), " ", this.parsed ? /*#__PURE__*/React__namespace.createElement("span", {
|
|
36190
|
-
className: "unit-example-okay"
|
|
36191
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconOk)) : /*#__PURE__*/React__namespace.createElement("span", {
|
|
36192
|
-
className: "unit-example-not-okay"
|
|
36193
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconRemove))), /*#__PURE__*/React__namespace.createElement("div", null, "Significant Figures:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput, {
|
|
36194
|
-
value: this.props.sigfigs,
|
|
36195
|
-
onChange: this.handleSigfigChange,
|
|
36196
|
-
checkValidity: this._checkSigfigValidity,
|
|
36197
|
-
useArrowKeys: true
|
|
36198
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
36199
|
-
type: "radio",
|
|
36200
|
-
name: this.groupId,
|
|
36201
|
-
onChange: () => this._setAccepting(ALL),
|
|
36202
|
-
checked: this.props.accepting === ALL
|
|
36203
|
-
}), " Any equivalent unit "), /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
36204
|
-
type: "radio",
|
|
36205
|
-
name: this.groupId,
|
|
36206
|
-
onChange: () => this._setAccepting(SOME),
|
|
36207
|
-
checked: this.props.accepting === SOME
|
|
36208
|
-
}), " Only these units ")), acceptingElem);
|
|
36209
|
-
}
|
|
36210
|
-
}
|
|
36211
|
-
|
|
36212
35984
|
const {
|
|
36213
35985
|
InfoTip
|
|
36214
35986
|
} = perseus.components;
|
|
@@ -36266,7 +36038,7 @@ class VideoEditor extends React__namespace.Component {
|
|
|
36266
36038
|
}
|
|
36267
36039
|
}
|
|
36268
36040
|
|
|
36269
|
-
var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, SimpleMarkdownTesterEditor, SorterEditor, TableEditor,
|
|
36041
|
+
var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, SimpleMarkdownTesterEditor, SorterEditor, TableEditor, VideoEditor, RadioEditor, DeprecatedStandinEditor];
|
|
36270
36042
|
|
|
36271
36043
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
36272
36044
|
class TextInput extends React__namespace.Component {
|