@khanacademy/perseus-editor 9.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 +419 -754
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +411 -750
- package/dist/index.js.map +1 -1
- package/dist/util/object-utils.d.ts +1 -0
- package/dist/widgets/interactive-graph-editor.d.ts +82 -40
- package/package.json +3 -3
- package/dist/components/start-coord-settings.d.ts +0 -9
- package/dist/stateful-article-editor.d.ts +0 -10
- package/dist/widgets/unit-editor.d.ts +0 -33
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addLibraryVersionToPerseusDebug, PerseusError, Errors } from '@khanacademy/perseus-core';
|
|
2
|
-
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer,
|
|
2
|
+
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, getLinearSystemCoords, getSegmentCoords, getLineCoords, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useRef, useEffect } from 'react';
|
|
5
5
|
import _ from 'underscore';
|
|
@@ -37,7 +37,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
|
|
|
37
37
|
|
|
38
38
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
39
39
|
const libName = "@khanacademy/perseus-editor";
|
|
40
|
-
const libVersion = "
|
|
40
|
+
const libVersion = "11.0.0";
|
|
41
41
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
42
42
|
|
|
43
43
|
function _extends() {
|
|
@@ -209,7 +209,7 @@ const JsonEditor = createReactClass({
|
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
const {
|
|
212
|
-
InlineIcon: InlineIcon$
|
|
212
|
+
InlineIcon: InlineIcon$a
|
|
213
213
|
} = components;
|
|
214
214
|
class SectionControlButton extends React.Component {
|
|
215
215
|
render() {
|
|
@@ -227,15 +227,15 @@ class SectionControlButton extends React.Component {
|
|
|
227
227
|
role: "button",
|
|
228
228
|
hideDefaultFocusRing: true,
|
|
229
229
|
"aria-label": title,
|
|
230
|
-
style: styles$
|
|
230
|
+
style: styles$I.button
|
|
231
231
|
}, ({
|
|
232
232
|
hovered,
|
|
233
233
|
focused,
|
|
234
234
|
pressed
|
|
235
|
-
}) => /*#__PURE__*/React.createElement(InlineIcon$
|
|
235
|
+
}) => /*#__PURE__*/React.createElement(InlineIcon$a, icon));
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const styles$
|
|
238
|
+
const styles$I = StyleSheet.create({
|
|
239
239
|
button: {
|
|
240
240
|
backgroundColor: color.gold,
|
|
241
241
|
margin: 2,
|
|
@@ -20558,7 +20558,7 @@ const DragTarget = createReactClass({
|
|
|
20558
20558
|
});
|
|
20559
20559
|
|
|
20560
20560
|
const {
|
|
20561
|
-
InlineIcon: InlineIcon$
|
|
20561
|
+
InlineIcon: InlineIcon$9
|
|
20562
20562
|
} = components;
|
|
20563
20563
|
const {
|
|
20564
20564
|
iconChevronDown: iconChevronDown$1,
|
|
@@ -20665,7 +20665,7 @@ class WidgetEditor extends React.Component {
|
|
|
20665
20665
|
className: "perseus-widget-editor-title-id",
|
|
20666
20666
|
href: "#",
|
|
20667
20667
|
onClick: this._toggleWidget
|
|
20668
|
-
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$
|
|
20668
|
+
}, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$9, iconChevronDown$1) : /*#__PURE__*/React.createElement(InlineIcon$9, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement("input", {
|
|
20669
20669
|
type: "button"
|
|
20670
20670
|
// @ts-expect-error - TS2322 - Type '(e: Event) => void' is not assignable to type 'MouseEventHandler<HTMLInputElement>'.
|
|
20671
20671
|
,
|
|
@@ -20740,13 +20740,13 @@ class WidgetSelect extends React.Component {
|
|
|
20740
20740
|
* that collapse a region.
|
|
20741
20741
|
*/
|
|
20742
20742
|
function ToggleableCaret(props) {
|
|
20743
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20743
|
+
const iconStyle = props.isExpanded ? styles$H.expanded : styles$H.collapsed;
|
|
20744
20744
|
return /*#__PURE__*/React.createElement(PhosphorIcon, {
|
|
20745
20745
|
icon: caretRight,
|
|
20746
20746
|
style: iconStyle
|
|
20747
20747
|
});
|
|
20748
20748
|
}
|
|
20749
|
-
const styles$
|
|
20749
|
+
const styles$H = StyleSheet.create({
|
|
20750
20750
|
collapsed: {
|
|
20751
20751
|
transition: ".15s"
|
|
20752
20752
|
},
|
|
@@ -20779,16 +20779,16 @@ class TexErrorView extends React.Component {
|
|
|
20779
20779
|
showErrors
|
|
20780
20780
|
} = this.state;
|
|
20781
20781
|
return /*#__PURE__*/React.createElement(View, {
|
|
20782
|
-
style: styles$
|
|
20782
|
+
style: styles$G.errorContainer
|
|
20783
20783
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20784
|
-
style: styles$
|
|
20784
|
+
style: styles$G.title,
|
|
20785
20785
|
onClick: this.handleToggleTexErrors
|
|
20786
20786
|
}, /*#__PURE__*/React.createElement(ToggleableCaret, {
|
|
20787
20787
|
isExpanded: showErrors
|
|
20788
20788
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React.createElement(View, {
|
|
20789
|
-
style: styles$
|
|
20789
|
+
style: styles$G.errorExplanation
|
|
20790
20790
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React.createElement(View, {
|
|
20791
|
-
style: styles$
|
|
20791
|
+
style: styles$G.error,
|
|
20792
20792
|
key: index
|
|
20793
20793
|
}, /*#__PURE__*/React.createElement(View, {
|
|
20794
20794
|
style: {
|
|
@@ -20797,7 +20797,7 @@ class TexErrorView extends React.Component {
|
|
|
20797
20797
|
}, e.math), /*#__PURE__*/React.createElement(View, null, e.message))));
|
|
20798
20798
|
}
|
|
20799
20799
|
}
|
|
20800
|
-
const styles$
|
|
20800
|
+
const styles$G = StyleSheet.create({
|
|
20801
20801
|
title: {
|
|
20802
20802
|
backgroundColor: "#eee",
|
|
20803
20803
|
fontSize: "1.25em",
|
|
@@ -21786,7 +21786,7 @@ class IframeContentRenderer extends React.Component {
|
|
|
21786
21786
|
|
|
21787
21787
|
const {
|
|
21788
21788
|
HUD: HUD$1,
|
|
21789
|
-
InlineIcon: InlineIcon$
|
|
21789
|
+
InlineIcon: InlineIcon$8
|
|
21790
21790
|
} = components;
|
|
21791
21791
|
const {
|
|
21792
21792
|
iconCircleArrowDown: iconCircleArrowDown$1,
|
|
@@ -21945,7 +21945,7 @@ class ArticleEditor extends React.Component {
|
|
|
21945
21945
|
onClick: () => {
|
|
21946
21946
|
this._handleAddSectionAfter(this._sections().length - 1);
|
|
21947
21947
|
}
|
|
21948
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
21948
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$8, iconPlus$4), " Add a section")));
|
|
21949
21949
|
}
|
|
21950
21950
|
_renderLinterHUD() {
|
|
21951
21951
|
return /*#__PURE__*/React.createElement(HUD$1, {
|
|
@@ -22093,7 +22093,7 @@ ArticleEditor.defaultProps = {
|
|
|
22093
22093
|
*/
|
|
22094
22094
|
const {
|
|
22095
22095
|
ButtonGroup: ButtonGroup$5,
|
|
22096
|
-
InlineIcon: InlineIcon$
|
|
22096
|
+
InlineIcon: InlineIcon$7
|
|
22097
22097
|
} = components;
|
|
22098
22098
|
const {
|
|
22099
22099
|
devices
|
|
@@ -22104,9 +22104,9 @@ const {
|
|
|
22104
22104
|
iconTablet
|
|
22105
22105
|
} = icons;
|
|
22106
22106
|
const ViewportResizer = props => {
|
|
22107
|
-
const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22108
|
-
const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22109
|
-
const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$
|
|
22107
|
+
const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconMobilePhone), " Phone");
|
|
22108
|
+
const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconTablet), " Tablet");
|
|
22109
|
+
const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconDesktop), " Desktop");
|
|
22110
22110
|
|
|
22111
22111
|
// TODO(david): Allow input of custom viewport sizes.
|
|
22112
22112
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -23454,7 +23454,7 @@ class StructuredItemDiff extends React.Component {
|
|
|
23454
23454
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
23455
23455
|
const {
|
|
23456
23456
|
InfoTip: InfoTip$m,
|
|
23457
|
-
InlineIcon: InlineIcon$
|
|
23457
|
+
InlineIcon: InlineIcon$6
|
|
23458
23458
|
} = components;
|
|
23459
23459
|
const {
|
|
23460
23460
|
iconCircleArrowDown,
|
|
@@ -23521,11 +23521,11 @@ class HintEditor extends React.Component {
|
|
|
23521
23521
|
type: "button",
|
|
23522
23522
|
className: this.props.isLast ? "hidden" : "",
|
|
23523
23523
|
onClick: _.partial(this.props.onMove, 1)
|
|
23524
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23524
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconCircleArrowDown)), " ", /*#__PURE__*/React.createElement("button", {
|
|
23525
23525
|
type: "button",
|
|
23526
23526
|
className: this.props.isFirst ? "hidden" : "",
|
|
23527
23527
|
onClick: _.partial(this.props.onMove, -1)
|
|
23528
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23528
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$m, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
|
|
23529
23529
|
type: "checkbox"
|
|
23530
23530
|
// @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
|
|
23531
23531
|
,
|
|
@@ -23535,7 +23535,7 @@ class HintEditor extends React.Component {
|
|
|
23535
23535
|
type: "button",
|
|
23536
23536
|
className: "remove-hint simple-button orange",
|
|
23537
23537
|
onClick: this.props.onRemove
|
|
23538
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23538
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$5), "Remove this hint", " ")));
|
|
23539
23539
|
}
|
|
23540
23540
|
}
|
|
23541
23541
|
HintEditor.defaultProps = {
|
|
@@ -23766,7 +23766,7 @@ class CombinedHintsEditor extends React.Component {
|
|
|
23766
23766
|
type: "button",
|
|
23767
23767
|
className: "add-hint simple-button orange",
|
|
23768
23768
|
onClick: this.addHint
|
|
23769
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
23769
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$6, iconPlus$3), " Add a hint"))));
|
|
23770
23770
|
/* eslint-enable max-len */
|
|
23771
23771
|
}
|
|
23772
23772
|
}
|
|
@@ -24591,7 +24591,7 @@ class SimpleButton extends React.Component {
|
|
|
24591
24591
|
} = _this$props,
|
|
24592
24592
|
otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);
|
|
24593
24593
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24594
|
-
className: css(styles$
|
|
24594
|
+
className: css(styles$F.baseButton, color === "green" && styles$F.green, color === "orange" && styles$F.orange),
|
|
24595
24595
|
onClick: onClick
|
|
24596
24596
|
}, otherProps), children);
|
|
24597
24597
|
}
|
|
@@ -24606,7 +24606,7 @@ SimpleButton.defaultProps = {
|
|
|
24606
24606
|
color: "green",
|
|
24607
24607
|
onClick: () => {}
|
|
24608
24608
|
};
|
|
24609
|
-
const styles$
|
|
24609
|
+
const styles$F = StyleSheet.create({
|
|
24610
24610
|
baseButton: {
|
|
24611
24611
|
top: "0",
|
|
24612
24612
|
fontSize: "11px",
|
|
@@ -24656,7 +24656,7 @@ const _excluded$2 = ["depth"],
|
|
|
24656
24656
|
_excluded4 = ["shape", "data", "path", "actions"],
|
|
24657
24657
|
_excluded5 = ["shape", "data", "path"];
|
|
24658
24658
|
const {
|
|
24659
|
-
InlineIcon: InlineIcon$
|
|
24659
|
+
InlineIcon: InlineIcon$5
|
|
24660
24660
|
} = components;
|
|
24661
24661
|
const {
|
|
24662
24662
|
iconChevronDown,
|
|
@@ -24826,23 +24826,23 @@ const LeafContainer = ({
|
|
|
24826
24826
|
}) => {
|
|
24827
24827
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24828
24828
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React.createElement("div", {
|
|
24829
|
-
className: css(styles$
|
|
24829
|
+
className: css(styles$E.containerHeader)
|
|
24830
24830
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24831
24831
|
depth: path.length,
|
|
24832
|
-
className: css(styles$
|
|
24832
|
+
className: css(styles$E.containerTitle)
|
|
24833
24833
|
}, capitalize(name)));
|
|
24834
24834
|
return /*#__PURE__*/React.createElement("div", {
|
|
24835
|
-
className: css(styles$
|
|
24835
|
+
className: css(styles$E.container)
|
|
24836
24836
|
}, /*#__PURE__*/React.createElement("span", {
|
|
24837
|
-
className: css(styles$
|
|
24837
|
+
className: css(styles$E.row, styles$E.rowHeading)
|
|
24838
24838
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24839
|
-
className: css(styles$
|
|
24839
|
+
className: css(styles$E.columnLeft)
|
|
24840
24840
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24841
|
-
className: "pod-title " + css(styles$
|
|
24841
|
+
className: "pod-title " + css(styles$E.containerHeader)
|
|
24842
24842
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24843
|
-
className: css(styles$
|
|
24843
|
+
className: css(styles$E.containerTitle)
|
|
24844
24844
|
}, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
|
|
24845
|
-
className: css(styles$
|
|
24845
|
+
className: css(styles$E.columnRight)
|
|
24846
24846
|
}, previewHeading)), children);
|
|
24847
24847
|
};
|
|
24848
24848
|
const ArrayContainer = props => {
|
|
@@ -24855,11 +24855,11 @@ const ArrayContainer = props => {
|
|
|
24855
24855
|
actions
|
|
24856
24856
|
} = props;
|
|
24857
24857
|
return /*#__PURE__*/React.createElement("div", {
|
|
24858
|
-
className: css(styles$
|
|
24858
|
+
className: css(styles$E.container)
|
|
24859
24859
|
}, controls && /*#__PURE__*/React.createElement("div", {
|
|
24860
|
-
className: css(styles$
|
|
24860
|
+
className: css(styles$E.columnLeft, styles$E.containerHeader)
|
|
24861
24861
|
}, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
|
|
24862
|
-
className: css(styles$
|
|
24862
|
+
className: css(styles$E.columnLeft)
|
|
24863
24863
|
}, /*#__PURE__*/React.createElement("a", {
|
|
24864
24864
|
href: "javascript:void 0",
|
|
24865
24865
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24872,28 +24872,28 @@ const ObjectContainer = ({
|
|
|
24872
24872
|
path
|
|
24873
24873
|
}) => {
|
|
24874
24874
|
const headingEditor = /*#__PURE__*/React.createElement("div", {
|
|
24875
|
-
className: css(styles$
|
|
24875
|
+
className: css(styles$E.containerHeader)
|
|
24876
24876
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24877
24877
|
depth: path.length,
|
|
24878
|
-
className: css(styles$
|
|
24878
|
+
className: css(styles$E.containerTitle)
|
|
24879
24879
|
}, capitalize(name)), controls);
|
|
24880
24880
|
const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
|
|
24881
|
-
className: css(styles$
|
|
24881
|
+
className: css(styles$E.containerHeader, styles$E.previewCollectionHeader)
|
|
24882
24882
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
24883
24883
|
depth: path.length,
|
|
24884
|
-
className: css(styles$
|
|
24884
|
+
className: css(styles$E.containerTitle)
|
|
24885
24885
|
}, capitalize(name)));
|
|
24886
24886
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24887
24887
|
return /*#__PURE__*/React.createElement("div", {
|
|
24888
|
-
className: css(styles$
|
|
24888
|
+
className: css(styles$E.container)
|
|
24889
24889
|
}, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
|
|
24890
|
-
className: css(styles$
|
|
24890
|
+
className: css(styles$E.row)
|
|
24891
24891
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24892
|
-
className: css(styles$
|
|
24892
|
+
className: css(styles$E.columnLeft)
|
|
24893
24893
|
}, headingEditor), /*#__PURE__*/React.createElement("div", {
|
|
24894
|
-
className: css(styles$
|
|
24894
|
+
className: css(styles$E.columnRight)
|
|
24895
24895
|
}, headingPreview)), /*#__PURE__*/React.createElement("div", {
|
|
24896
|
-
className: css(path.length > 0 && styles$
|
|
24896
|
+
className: css(path.length > 0 && styles$E.contentIndent)
|
|
24897
24897
|
}, children));
|
|
24898
24898
|
};
|
|
24899
24899
|
|
|
@@ -25016,11 +25016,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25016
25016
|
className: "framework-perseus"
|
|
25017
25017
|
}, lens(renderers).get(path));
|
|
25018
25018
|
return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
|
|
25019
|
-
className: css(styles$
|
|
25019
|
+
className: css(styles$E.row)
|
|
25020
25020
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25021
|
-
className: css(styles$
|
|
25021
|
+
className: css(styles$E.columnLeft)
|
|
25022
25022
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25023
|
-
className: css(sticky && styles$
|
|
25023
|
+
className: css(sticky && styles$E.sticky)
|
|
25024
25024
|
},
|
|
25025
25025
|
/*#__PURE__*/
|
|
25026
25026
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25028,9 +25028,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25028
25028
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25029
25029
|
apiOptions: apiOptions
|
|
25030
25030
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25031
|
-
className: css(styles$
|
|
25031
|
+
className: css(styles$E.columnRight)
|
|
25032
25032
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25033
|
-
className: css(sticky && styles$
|
|
25033
|
+
className: css(sticky && styles$E.sticky)
|
|
25034
25034
|
}, preview))));
|
|
25035
25035
|
});
|
|
25036
25036
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25046,13 +25046,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25046
25046
|
className: "framework-perseus"
|
|
25047
25047
|
}, lens(renderers).get(path));
|
|
25048
25048
|
return /*#__PURE__*/React.createElement("div", {
|
|
25049
|
-
className: css(styles$
|
|
25049
|
+
className: css(styles$E.row)
|
|
25050
25050
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25051
|
-
className: css(styles$
|
|
25051
|
+
className: css(styles$E.columnLeft)
|
|
25052
25052
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25053
|
-
className: css(sticky && styles$
|
|
25053
|
+
className: css(sticky && styles$E.sticky)
|
|
25054
25054
|
}, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
|
|
25055
|
-
className: css(styles$
|
|
25055
|
+
className: css(styles$E.hintEditor),
|
|
25056
25056
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25057
25057
|
apiOptions: apiOptions,
|
|
25058
25058
|
showTitle: false,
|
|
@@ -25067,9 +25067,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25067
25067
|
isFirst: true,
|
|
25068
25068
|
isLast: true
|
|
25069
25069
|
})))), /*#__PURE__*/React.createElement("div", {
|
|
25070
|
-
className: css(styles$
|
|
25070
|
+
className: css(styles$E.columnRight)
|
|
25071
25071
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25072
|
-
className: css(sticky && styles$
|
|
25072
|
+
className: css(sticky && styles$E.sticky)
|
|
25073
25073
|
}, preview)));
|
|
25074
25074
|
});
|
|
25075
25075
|
const TagsNodeContent = props => {
|
|
@@ -25086,9 +25086,9 @@ const TagsNodeContent = props => {
|
|
|
25086
25086
|
return null;
|
|
25087
25087
|
}
|
|
25088
25088
|
return /*#__PURE__*/React.createElement("div", {
|
|
25089
|
-
className: css(styles$
|
|
25089
|
+
className: css(styles$E.columnLeft)
|
|
25090
25090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25091
|
-
className: css(styles$
|
|
25091
|
+
className: css(styles$E.tagsEditor)
|
|
25092
25092
|
}, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
|
|
25093
25093
|
value: data,
|
|
25094
25094
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25119,31 +25119,31 @@ const ArrayNodeContent = props => {
|
|
|
25119
25119
|
const subpath = path.concat(i);
|
|
25120
25120
|
const controls = [i > 0 && /*#__PURE__*/React.createElement("div", {
|
|
25121
25121
|
key: "moveArrayElementUp",
|
|
25122
|
-
className: css(styles$
|
|
25122
|
+
className: css(styles$E.control)
|
|
25123
25123
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25124
25124
|
color: "orange",
|
|
25125
25125
|
title: "Move up",
|
|
25126
25126
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25127
25127
|
}, /*#__PURE__*/React.createElement("div", {
|
|
25128
|
-
className: css(styles$
|
|
25129
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25128
|
+
className: css(styles$E.verticalFlip)
|
|
25129
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
|
|
25130
25130
|
key: "moveArrayElementDown",
|
|
25131
|
-
className: css(styles$
|
|
25131
|
+
className: css(styles$E.control)
|
|
25132
25132
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25133
25133
|
color: "orange",
|
|
25134
25134
|
title: "Move down",
|
|
25135
25135
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25136
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25136
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
|
|
25137
25137
|
key: "removeArrayElement",
|
|
25138
|
-
className: css(styles$
|
|
25138
|
+
className: css(styles$E.control)
|
|
25139
25139
|
}, /*#__PURE__*/React.createElement(SimpleButton, {
|
|
25140
25140
|
color: "orange",
|
|
25141
25141
|
title: "Delete",
|
|
25142
25142
|
onClick: () => actions.removeArrayElement(subpath)
|
|
25143
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
25143
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$4)))];
|
|
25144
25144
|
return /*#__PURE__*/React.createElement("div", {
|
|
25145
25145
|
key: i,
|
|
25146
|
-
className: css(styles$
|
|
25146
|
+
className: css(styles$E.arrayElement, !elementIsLeaf && styles$E.arrayElementAndNotLeaf)
|
|
25147
25147
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25148
25148
|
key: i,
|
|
25149
25149
|
shape: shape.elementShape,
|
|
@@ -25169,7 +25169,7 @@ const ObjectNodeContent = props => {
|
|
|
25169
25169
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25170
25170
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React.createElement("div", {
|
|
25171
25171
|
key: subkey,
|
|
25172
|
-
className: css(styles$
|
|
25172
|
+
className: css(styles$E.objectElement)
|
|
25173
25173
|
}, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25174
25174
|
shape: shape.shape[subkey],
|
|
25175
25175
|
data: data[subkey],
|
|
@@ -25336,7 +25336,7 @@ class MultiRendererEditor extends React.Component {
|
|
|
25336
25336
|
}, this._renderContent());
|
|
25337
25337
|
}
|
|
25338
25338
|
}
|
|
25339
|
-
const styles$
|
|
25339
|
+
const styles$E = StyleSheet.create({
|
|
25340
25340
|
// This is used in a number of places throughout this file.
|
|
25341
25341
|
container: {},
|
|
25342
25342
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25438,116 +25438,6 @@ const styles$D = StyleSheet.create({
|
|
|
25438
25438
|
}
|
|
25439
25439
|
});
|
|
25440
25440
|
|
|
25441
|
-
/* eslint-disable react/no-unsafe */
|
|
25442
|
-
const StatefulArticleEditor = createReactClass({
|
|
25443
|
-
displayName: "StatefulArticleEditor",
|
|
25444
|
-
getInitialState: function () {
|
|
25445
|
-
return _({}).extend(this.props, {
|
|
25446
|
-
mode: "edit",
|
|
25447
|
-
onChange: this.handleChange,
|
|
25448
|
-
ref: "editor",
|
|
25449
|
-
screen: "phone"
|
|
25450
|
-
});
|
|
25451
|
-
},
|
|
25452
|
-
componentDidMount: function () {
|
|
25453
|
-
// TODO(scottgrant): This is a hack to remove the deprecated call to
|
|
25454
|
-
// this.isMounted() but is still considered an anti-pattern.
|
|
25455
|
-
this._isMounted = true;
|
|
25456
|
-
},
|
|
25457
|
-
// getInitialState isn't called if the react component is re-rendered
|
|
25458
|
-
// in-place on the dom, in which case this is called instead, so we
|
|
25459
|
-
// need to update the state here.
|
|
25460
|
-
// (This component is currently re-rendered by the "Add image" button.)
|
|
25461
|
-
UNSAFE_componentWillReceiveProps: function (nextProps) {
|
|
25462
|
-
// be careful not to overwrite our onChange and ref
|
|
25463
|
-
this.setState(_(nextProps).omit("onChange", "ref"));
|
|
25464
|
-
},
|
|
25465
|
-
componentWillUnmount: function () {
|
|
25466
|
-
this._isMounted = false;
|
|
25467
|
-
},
|
|
25468
|
-
getSaveWarnings: function () {
|
|
25469
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25470
|
-
return this.refs.editor.getSaveWarnings();
|
|
25471
|
-
},
|
|
25472
|
-
serialize: function () {
|
|
25473
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25474
|
-
return this.refs.editor.serialize();
|
|
25475
|
-
},
|
|
25476
|
-
handleChange: function (newState, cb) {
|
|
25477
|
-
if (this._isMounted) {
|
|
25478
|
-
this.setState(newState, cb);
|
|
25479
|
-
}
|
|
25480
|
-
},
|
|
25481
|
-
scorePreview: function () {
|
|
25482
|
-
// eslint-disable-next-line react/no-string-refs
|
|
25483
|
-
return this.refs.editor.scorePreview();
|
|
25484
|
-
},
|
|
25485
|
-
render: function () {
|
|
25486
|
-
const {
|
|
25487
|
-
mode,
|
|
25488
|
-
screen
|
|
25489
|
-
} = this.state;
|
|
25490
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
25491
|
-
style: styles$C.controlBar
|
|
25492
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
25493
|
-
style: styles$C.controls
|
|
25494
|
-
}, "Mode:", " ", /*#__PURE__*/React.createElement("span", {
|
|
25495
|
-
onClick: () => this.setState({
|
|
25496
|
-
mode: "edit"
|
|
25497
|
-
}),
|
|
25498
|
-
style: mode === "edit" ? styles$C.controlSelected : styles$C.control
|
|
25499
|
-
}, "EDIT"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25500
|
-
onClick: () => this.setState({
|
|
25501
|
-
mode: "preview"
|
|
25502
|
-
}),
|
|
25503
|
-
style: mode === "preview" ? styles$C.controlSelected : styles$C.control
|
|
25504
|
-
}, "PREVIEW"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25505
|
-
onClick: () => this.setState({
|
|
25506
|
-
mode: "json"
|
|
25507
|
-
}),
|
|
25508
|
-
style: mode === "json" ? styles$C.controlSelected : styles$C.control
|
|
25509
|
-
}, "JSON")), /*#__PURE__*/React.createElement("span", {
|
|
25510
|
-
style: styles$C.controls
|
|
25511
|
-
}, "Screen:", " ", /*#__PURE__*/React.createElement("span", {
|
|
25512
|
-
onClick: () => this.setState({
|
|
25513
|
-
screen: "phone"
|
|
25514
|
-
}),
|
|
25515
|
-
style: screen === "phone" ? styles$C.controlSelected : styles$C.control
|
|
25516
|
-
}, "PHONE"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25517
|
-
onClick: () => this.setState({
|
|
25518
|
-
screen: "tablet"
|
|
25519
|
-
}),
|
|
25520
|
-
style: screen === "tablet" ? styles$C.controlSelected : styles$C.control
|
|
25521
|
-
}, "TABLET"), " | ", /*#__PURE__*/React.createElement("span", {
|
|
25522
|
-
onClick: () => this.setState({
|
|
25523
|
-
screen: "desktop"
|
|
25524
|
-
}),
|
|
25525
|
-
style: screen === "desktop" ? styles$C.controlSelected : styles$C.control
|
|
25526
|
-
}, "DESKTOP"))), /*#__PURE__*/React.createElement("div", {
|
|
25527
|
-
style: styles$C.editor
|
|
25528
|
-
}, /*#__PURE__*/React.createElement(ArticleEditor, this.state)));
|
|
25529
|
-
}
|
|
25530
|
-
});
|
|
25531
|
-
const styles$C = {
|
|
25532
|
-
controlBar: {
|
|
25533
|
-
marginBottom: 25,
|
|
25534
|
-
marginTop: 5
|
|
25535
|
-
},
|
|
25536
|
-
controls: {
|
|
25537
|
-
marginRight: 10
|
|
25538
|
-
},
|
|
25539
|
-
controlSelected: {
|
|
25540
|
-
cursor: "default",
|
|
25541
|
-
fontWeight: 700
|
|
25542
|
-
},
|
|
25543
|
-
control: {
|
|
25544
|
-
cursor: "pointer"
|
|
25545
|
-
},
|
|
25546
|
-
editor: {
|
|
25547
|
-
marginTop: -20
|
|
25548
|
-
}
|
|
25549
|
-
};
|
|
25550
|
-
|
|
25551
25441
|
/* eslint-disable react/no-unsafe, react/sort-comp */
|
|
25552
25442
|
|
|
25553
25443
|
/* Renders an EditorPage (or an ArticleEditor) as a non-controlled component.
|
|
@@ -25995,7 +25885,7 @@ DeprecatedStandinEditor.widgetName = "deprecated-standin";
|
|
|
25995
25885
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
25996
25886
|
const {
|
|
25997
25887
|
InfoTip: InfoTip$j,
|
|
25998
|
-
InlineIcon: InlineIcon$
|
|
25888
|
+
InlineIcon: InlineIcon$4
|
|
25999
25889
|
} = components;
|
|
26000
25890
|
const {
|
|
26001
25891
|
iconPlus: iconPlus$2,
|
|
@@ -26115,14 +26005,14 @@ class DropdownEditor extends React.Component {
|
|
|
26115
26005
|
this, i)
|
|
26116
26006
|
}, /*#__PURE__*/React.createElement("span", {
|
|
26117
26007
|
className: "remove-choice"
|
|
26118
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26008
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash$3)))));
|
|
26119
26009
|
}, this)), /*#__PURE__*/React.createElement("div", {
|
|
26120
26010
|
className: "add-choice-container"
|
|
26121
26011
|
}, /*#__PURE__*/React.createElement("a", {
|
|
26122
26012
|
href: "#",
|
|
26123
26013
|
className: "simple-button orange",
|
|
26124
26014
|
onClick: this.addChoice
|
|
26125
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26015
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$2), " Add a choice", " ")));
|
|
26126
26016
|
}
|
|
26127
26017
|
}
|
|
26128
26018
|
DropdownEditor.propTypes = {
|
|
@@ -26968,7 +26858,7 @@ class AnswerOption extends React.Component {
|
|
|
26968
26858
|
}
|
|
26969
26859
|
|
|
26970
26860
|
const {
|
|
26971
|
-
InlineIcon: InlineIcon$
|
|
26861
|
+
InlineIcon: InlineIcon$3,
|
|
26972
26862
|
TextInput: TextInput$6
|
|
26973
26863
|
} = components;
|
|
26974
26864
|
const {
|
|
@@ -27018,10 +26908,10 @@ class GradedGroupEditor extends React.Component {
|
|
|
27018
26908
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27019
26909
|
className: "perseus-widget-row"
|
|
27020
26910
|
}, /*#__PURE__*/React.createElement("label", {
|
|
27021
|
-
className: css(styles$
|
|
26911
|
+
className: css(styles$D.title)
|
|
27022
26912
|
}, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
|
|
27023
26913
|
value: this.props.title,
|
|
27024
|
-
className: css(styles$
|
|
26914
|
+
className: css(styles$D.input)
|
|
27025
26915
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27026
26916
|
,
|
|
27027
26917
|
onChange: this.change("title")
|
|
@@ -27043,10 +26933,10 @@ class GradedGroupEditor extends React.Component {
|
|
|
27043
26933
|
},
|
|
27044
26934
|
className: "add-hint simple-button orange",
|
|
27045
26935
|
onClick: this.handleAddHint
|
|
27046
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26936
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
|
|
27047
26937
|
className: "perseus-hint-editor"
|
|
27048
26938
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27049
|
-
className: css(styles$
|
|
26939
|
+
className: css(styles$D.hintsTitle)
|
|
27050
26940
|
}, "Hint"), /*#__PURE__*/React.createElement(Editor, {
|
|
27051
26941
|
ref: this.hintEditor,
|
|
27052
26942
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27065,7 +26955,7 @@ class GradedGroupEditor extends React.Component {
|
|
|
27065
26955
|
type: "button",
|
|
27066
26956
|
className: "remove-hint simple-button orange",
|
|
27067
26957
|
onClick: this.handleRemoveHint
|
|
27068
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
26958
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$3, iconTrash$2), " Remove this hint")));
|
|
27069
26959
|
}
|
|
27070
26960
|
}
|
|
27071
26961
|
GradedGroupEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -27083,7 +26973,7 @@ GradedGroupEditor.defaultProps = {
|
|
|
27083
26973
|
images: {},
|
|
27084
26974
|
hint: null
|
|
27085
26975
|
};
|
|
27086
|
-
const styles$
|
|
26976
|
+
const styles$D = StyleSheet.create({
|
|
27087
26977
|
title: {
|
|
27088
26978
|
fontSize: 18,
|
|
27089
26979
|
fontWeight: "bold"
|
|
@@ -27984,7 +27874,7 @@ IframeEditor.defaultProps = {
|
|
|
27984
27874
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
|
|
27985
27875
|
const {
|
|
27986
27876
|
InfoTip: InfoTip$f,
|
|
27987
|
-
InlineIcon: InlineIcon$
|
|
27877
|
+
InlineIcon: InlineIcon$2,
|
|
27988
27878
|
RangeInput: RangeInput$5
|
|
27989
27879
|
} = components;
|
|
27990
27880
|
const defaultBoxSize = 400;
|
|
@@ -28102,7 +27992,7 @@ class ImageEditor extends React.Component {
|
|
|
28102
27992
|
// eslint-disable-next-line react/jsx-no-bind
|
|
28103
27993
|
,
|
|
28104
27994
|
onClick: this.removeLabel.bind(this, i)
|
|
28105
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
27995
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconTrash))));
|
|
28106
27996
|
}
|
|
28107
27997
|
change(...args) {
|
|
28108
27998
|
return Changeable.change.apply(this, args);
|
|
@@ -28422,13 +28312,13 @@ function MathquillInput(props) {
|
|
|
28422
28312
|
}
|
|
28423
28313
|
});
|
|
28424
28314
|
return /*#__PURE__*/React.createElement(View, {
|
|
28425
|
-
style: styles$
|
|
28315
|
+
style: styles$C.outerWrapper
|
|
28426
28316
|
}, /*#__PURE__*/React.createElement("span", {
|
|
28427
28317
|
ref: mathFieldWrapperRef,
|
|
28428
28318
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28429
28319
|
}));
|
|
28430
28320
|
}
|
|
28431
|
-
const styles$
|
|
28321
|
+
const styles$C = StyleSheet.create({
|
|
28432
28322
|
outerWrapper: {
|
|
28433
28323
|
display: "inline-block",
|
|
28434
28324
|
borderStyle: "solid",
|
|
@@ -28440,7 +28330,7 @@ const styles$A = StyleSheet.create({
|
|
|
28440
28330
|
});
|
|
28441
28331
|
|
|
28442
28332
|
const {
|
|
28443
|
-
NumberInput: NumberInput$
|
|
28333
|
+
NumberInput: NumberInput$d
|
|
28444
28334
|
} = components;
|
|
28445
28335
|
const {
|
|
28446
28336
|
getDependencies: getDependencies$8
|
|
@@ -28489,7 +28379,7 @@ class FunctionEditor extends React.Component {
|
|
|
28489
28379
|
className: "perseus-widget-row"
|
|
28490
28380
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28491
28381
|
className: "perseus-widget-left-col"
|
|
28492
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28382
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$d, {
|
|
28493
28383
|
value: this.props.strokeWidth,
|
|
28494
28384
|
placeholder: 2,
|
|
28495
28385
|
onChange: this.change("strokeWidth")
|
|
@@ -28561,7 +28451,7 @@ LabelEditor.defaultProps = {
|
|
|
28561
28451
|
};
|
|
28562
28452
|
|
|
28563
28453
|
const {
|
|
28564
|
-
NumberInput: NumberInput$
|
|
28454
|
+
NumberInput: NumberInput$c
|
|
28565
28455
|
} = components;
|
|
28566
28456
|
const {
|
|
28567
28457
|
getDependencies: getDependencies$6
|
|
@@ -28616,7 +28506,7 @@ class LineEditor extends React.Component {
|
|
|
28616
28506
|
className: "perseus-widget-row"
|
|
28617
28507
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28618
28508
|
className: "perseus-widget-left-col"
|
|
28619
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28509
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$c, {
|
|
28620
28510
|
value: this.props.strokeWidth,
|
|
28621
28511
|
placeholder: 2,
|
|
28622
28512
|
onChange: this.change("strokeWidth")
|
|
@@ -28636,7 +28526,7 @@ LineEditor.defaultProps = {
|
|
|
28636
28526
|
|
|
28637
28527
|
const {
|
|
28638
28528
|
ButtonGroup: ButtonGroup$3,
|
|
28639
|
-
NumberInput: NumberInput$
|
|
28529
|
+
NumberInput: NumberInput$b
|
|
28640
28530
|
} = components;
|
|
28641
28531
|
class ConstraintEditor extends React.Component {
|
|
28642
28532
|
constructor(...args) {
|
|
@@ -28670,7 +28560,7 @@ class ConstraintEditor extends React.Component {
|
|
|
28670
28560
|
onChange: this.change("constraint")
|
|
28671
28561
|
})), this.props.constraint === "snap" && /*#__PURE__*/React.createElement("div", {
|
|
28672
28562
|
className: "perseus-widget-row"
|
|
28673
|
-
}, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28563
|
+
}, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$b, {
|
|
28674
28564
|
value: this.props.snap,
|
|
28675
28565
|
placeholder: 0,
|
|
28676
28566
|
onChange: this.change("snap")
|
|
@@ -28722,7 +28612,7 @@ ConstraintEditor.defaultProps = {
|
|
|
28722
28612
|
};
|
|
28723
28613
|
|
|
28724
28614
|
const {
|
|
28725
|
-
NumberInput: NumberInput$
|
|
28615
|
+
NumberInput: NumberInput$a
|
|
28726
28616
|
} = components;
|
|
28727
28617
|
const {
|
|
28728
28618
|
getDependencies: getDependencies$5
|
|
@@ -28763,13 +28653,13 @@ class MovableLineEditor extends React.Component {
|
|
|
28763
28653
|
onChange: this.change("endY")
|
|
28764
28654
|
}), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
|
|
28765
28655
|
className: "perseus-widget-row"
|
|
28766
|
-
}, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$
|
|
28656
|
+
}, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$a, {
|
|
28767
28657
|
value: this.props.startSubscript,
|
|
28768
28658
|
placeholder: 0,
|
|
28769
28659
|
onChange: this.change("startSubscript")
|
|
28770
28660
|
})), /*#__PURE__*/React.createElement("div", {
|
|
28771
28661
|
className: "perseus-widget-row"
|
|
28772
|
-
}, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$
|
|
28662
|
+
}, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$a, {
|
|
28773
28663
|
value: this.props.endSubscript,
|
|
28774
28664
|
placeholder: 0,
|
|
28775
28665
|
onChange: this.change("endSubscript")
|
|
@@ -28794,7 +28684,7 @@ MovableLineEditor.defaultProps = {
|
|
|
28794
28684
|
};
|
|
28795
28685
|
|
|
28796
28686
|
const {
|
|
28797
|
-
NumberInput: NumberInput$
|
|
28687
|
+
NumberInput: NumberInput$9
|
|
28798
28688
|
} = components;
|
|
28799
28689
|
const {
|
|
28800
28690
|
getDependencies: getDependencies$4
|
|
@@ -28827,7 +28717,7 @@ class MovablePointEditor extends React.Component {
|
|
|
28827
28717
|
onChange: this.change("startY")
|
|
28828
28718
|
}), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
|
|
28829
28719
|
className: "perseus-widget-row"
|
|
28830
|
-
}, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28720
|
+
}, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$9, {
|
|
28831
28721
|
value: this.props.varSubscript,
|
|
28832
28722
|
placeholder: 0,
|
|
28833
28723
|
onChange: this.change("varSubscript")
|
|
@@ -28848,7 +28738,7 @@ MovablePointEditor.defaultProps = {
|
|
|
28848
28738
|
};
|
|
28849
28739
|
|
|
28850
28740
|
const {
|
|
28851
|
-
NumberInput: NumberInput$
|
|
28741
|
+
NumberInput: NumberInput$8
|
|
28852
28742
|
} = components;
|
|
28853
28743
|
const {
|
|
28854
28744
|
getDependencies: getDependencies$3
|
|
@@ -28902,7 +28792,7 @@ class ParametricEditor extends React.Component {
|
|
|
28902
28792
|
className: "perseus-widget-row"
|
|
28903
28793
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28904
28794
|
className: "perseus-widget-left-col"
|
|
28905
|
-
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
28795
|
+
}, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
|
|
28906
28796
|
value: this.props.strokeWidth,
|
|
28907
28797
|
placeholder: 2,
|
|
28908
28798
|
onChange: this.change("strokeWidth")
|
|
@@ -29474,16 +29364,16 @@ const LabeledRow = props => {
|
|
|
29474
29364
|
style
|
|
29475
29365
|
} = props;
|
|
29476
29366
|
return /*#__PURE__*/React.createElement("label", {
|
|
29477
|
-
className: css(styles$
|
|
29367
|
+
className: css(styles$B.label)
|
|
29478
29368
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29479
|
-
style: [styles$
|
|
29369
|
+
style: [styles$B.row, style]
|
|
29480
29370
|
}, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29481
|
-
style: styles$
|
|
29371
|
+
style: styles$B.spaceEnd
|
|
29482
29372
|
}, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
|
|
29483
|
-
style: styles$
|
|
29373
|
+
style: styles$B.spaceStart
|
|
29484
29374
|
}, label)));
|
|
29485
29375
|
};
|
|
29486
|
-
const styles$
|
|
29376
|
+
const styles$B = StyleSheet.create({
|
|
29487
29377
|
label: {
|
|
29488
29378
|
width: "fit-content"
|
|
29489
29379
|
},
|
|
@@ -29560,11 +29450,11 @@ class Spring extends React.Component {
|
|
|
29560
29450
|
} = this.props;
|
|
29561
29451
|
return React.createElement(View, {
|
|
29562
29452
|
"aria-hidden": "true",
|
|
29563
|
-
style: [styles$
|
|
29453
|
+
style: [styles$A.grow, style]
|
|
29564
29454
|
});
|
|
29565
29455
|
}
|
|
29566
29456
|
}
|
|
29567
|
-
const styles$
|
|
29457
|
+
const styles$A = StyleSheet.create({
|
|
29568
29458
|
grow: {
|
|
29569
29459
|
flexGrow: 1
|
|
29570
29460
|
}
|
|
@@ -29599,22 +29489,12 @@ function Heading({
|
|
|
29599
29489
|
isCollapsible,
|
|
29600
29490
|
onToggle
|
|
29601
29491
|
}) {
|
|
29602
|
-
return /*#__PURE__*/React.createElement(
|
|
29603
|
-
style:
|
|
29604
|
-
|
|
29605
|
-
justifyContent: "space-between",
|
|
29606
|
-
backgroundColor: color.offBlack8,
|
|
29607
|
-
padding: spacing.xSmall_8,
|
|
29608
|
-
marginTop: spacing.small_12,
|
|
29609
|
-
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
29610
|
-
// variable found in perseus-editor.less. For now, it must
|
|
29611
|
-
// match otherwise there's a gap from this header to the edge
|
|
29612
|
-
// of the editor borders.
|
|
29613
|
-
marginInline: -10,
|
|
29614
|
-
cursor: isCollapsible ? "pointer" : "default",
|
|
29615
|
-
userSelect: "none"
|
|
29616
|
-
},
|
|
29492
|
+
return /*#__PURE__*/React.createElement(Clickable, {
|
|
29493
|
+
style: [styles$z.container, !isCollapsible && styles$z.notClickable],
|
|
29494
|
+
disabled: !isCollapsible,
|
|
29617
29495
|
onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
|
|
29496
|
+
}, () => /*#__PURE__*/React.createElement(View, {
|
|
29497
|
+
style: styles$z.heading
|
|
29618
29498
|
}, /*#__PURE__*/React.createElement(LabelLarge, {
|
|
29619
29499
|
style: {
|
|
29620
29500
|
fontSize: 14,
|
|
@@ -29622,8 +29502,31 @@ function Heading({
|
|
|
29622
29502
|
}
|
|
29623
29503
|
}, title), isCollapsible && /*#__PURE__*/React.createElement(ToggleableCaret, {
|
|
29624
29504
|
isExpanded: isOpen
|
|
29625
|
-
}));
|
|
29505
|
+
})));
|
|
29626
29506
|
}
|
|
29507
|
+
const styles$z = StyleSheet.create({
|
|
29508
|
+
container: {
|
|
29509
|
+
marginTop: spacing.small_12,
|
|
29510
|
+
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
29511
|
+
// variable found in perseus-editor.less. For now, it must
|
|
29512
|
+
// match otherwise there's a gap from this header to the edge
|
|
29513
|
+
// of the editor borders.
|
|
29514
|
+
marginInline: -10,
|
|
29515
|
+
backgroundColor: color.offBlack8,
|
|
29516
|
+
padding: spacing.xSmall_8
|
|
29517
|
+
},
|
|
29518
|
+
heading: {
|
|
29519
|
+
flexDirection: "row",
|
|
29520
|
+
justifyContent: "space-between",
|
|
29521
|
+
userSelect: "none"
|
|
29522
|
+
},
|
|
29523
|
+
notClickable: {
|
|
29524
|
+
// We don't need the text to be grayed out.
|
|
29525
|
+
color: "inherit",
|
|
29526
|
+
// We don't need the pointer to show the "not allowed" symbol.
|
|
29527
|
+
cursor: "default"
|
|
29528
|
+
}
|
|
29529
|
+
});
|
|
29627
29530
|
|
|
29628
29531
|
function focusWithChromeStickyFocusBugWorkaround(element) {
|
|
29629
29532
|
// NOTE(marksandstrom) Chrome sticky focus bug.
|
|
@@ -29730,6 +29633,25 @@ function degreeToRadian(degrees) {
|
|
|
29730
29633
|
function radianToDegree(radians) {
|
|
29731
29634
|
return radians / Math.PI * 180;
|
|
29732
29635
|
}
|
|
29636
|
+
function getDefaultGraphStartCoords(graph, range, step) {
|
|
29637
|
+
switch (graph.type) {
|
|
29638
|
+
case "linear":
|
|
29639
|
+
case "ray":
|
|
29640
|
+
return getLineCoords(_extends({}, graph, {
|
|
29641
|
+
startCoords: undefined
|
|
29642
|
+
}), range, step);
|
|
29643
|
+
case "segment":
|
|
29644
|
+
return getSegmentCoords(_extends({}, graph, {
|
|
29645
|
+
startCoords: undefined
|
|
29646
|
+
}), range, step);
|
|
29647
|
+
case "linear-system":
|
|
29648
|
+
return getLinearSystemCoords(_extends({}, graph, {
|
|
29649
|
+
startCoords: undefined
|
|
29650
|
+
}), range, step);
|
|
29651
|
+
default:
|
|
29652
|
+
return undefined;
|
|
29653
|
+
}
|
|
29654
|
+
}
|
|
29733
29655
|
|
|
29734
29656
|
/**
|
|
29735
29657
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29745,17 +29667,17 @@ const LockedFigureSelect = props => {
|
|
|
29745
29667
|
} = props;
|
|
29746
29668
|
const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
|
|
29747
29669
|
return /*#__PURE__*/React.createElement(View, {
|
|
29748
|
-
style: styles$
|
|
29670
|
+
style: styles$y.container
|
|
29749
29671
|
}, /*#__PURE__*/React.createElement(ActionMenu, {
|
|
29750
29672
|
menuText: "Add locked figure",
|
|
29751
|
-
style: styles$
|
|
29673
|
+
style: styles$y.addElementSelect
|
|
29752
29674
|
}, figureTypes.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
|
|
29753
29675
|
key: `${id}-${figureType}`,
|
|
29754
29676
|
label: figureType,
|
|
29755
29677
|
onClick: () => onChange(figureType)
|
|
29756
29678
|
}))));
|
|
29757
29679
|
};
|
|
29758
|
-
const styles$
|
|
29680
|
+
const styles$y = StyleSheet.create({
|
|
29759
29681
|
container: {
|
|
29760
29682
|
marginTop: spacing.xSmall_8
|
|
29761
29683
|
},
|
|
@@ -29786,19 +29708,19 @@ const AngleInput = props => {
|
|
|
29786
29708
|
}
|
|
29787
29709
|
return /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29788
29710
|
tag: "label",
|
|
29789
|
-
style: styles$
|
|
29711
|
+
style: styles$x.row
|
|
29790
29712
|
}, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
|
|
29791
29713
|
size: spacing.xxSmall_6
|
|
29792
29714
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29793
29715
|
type: "number",
|
|
29794
29716
|
value: angleInput,
|
|
29795
29717
|
onChange: handleAngleChange,
|
|
29796
|
-
style: styles$
|
|
29718
|
+
style: styles$x.textField
|
|
29797
29719
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
29798
29720
|
size: spacing.xxSmall_6
|
|
29799
29721
|
}));
|
|
29800
29722
|
};
|
|
29801
|
-
const styles$
|
|
29723
|
+
const styles$x = StyleSheet.create({
|
|
29802
29724
|
row: {
|
|
29803
29725
|
display: "flex",
|
|
29804
29726
|
flexDirection: "row",
|
|
@@ -29847,32 +29769,32 @@ const CoordinatePairInput = props => {
|
|
|
29847
29769
|
onChange(newCoords);
|
|
29848
29770
|
}
|
|
29849
29771
|
return /*#__PURE__*/React.createElement(View, {
|
|
29850
|
-
style: [styles$
|
|
29772
|
+
style: [styles$w.row, style]
|
|
29851
29773
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29852
29774
|
tag: "label",
|
|
29853
|
-
style: styles$
|
|
29775
|
+
style: styles$w.row
|
|
29854
29776
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29855
29777
|
size: spacing.xxSmall_6
|
|
29856
29778
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29857
29779
|
type: "number",
|
|
29858
29780
|
value: coordState[0],
|
|
29859
29781
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29860
|
-
style: [styles$
|
|
29782
|
+
style: [styles$w.textField, error ? styles$w.errorField : undefined]
|
|
29861
29783
|
})), /*#__PURE__*/React.createElement(Strut, {
|
|
29862
29784
|
size: spacing.medium_16
|
|
29863
29785
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29864
29786
|
tag: "label",
|
|
29865
|
-
style: styles$
|
|
29787
|
+
style: styles$w.row
|
|
29866
29788
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
|
|
29867
29789
|
size: spacing.xxSmall_6
|
|
29868
29790
|
}), /*#__PURE__*/React.createElement(TextField, {
|
|
29869
29791
|
type: "number",
|
|
29870
29792
|
value: coordState[1],
|
|
29871
29793
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29872
|
-
style: [styles$
|
|
29794
|
+
style: [styles$w.textField, error ? styles$w.errorField : undefined]
|
|
29873
29795
|
})));
|
|
29874
29796
|
};
|
|
29875
|
-
const styles$
|
|
29797
|
+
const styles$w = StyleSheet.create({
|
|
29876
29798
|
row: {
|
|
29877
29799
|
display: "flex",
|
|
29878
29800
|
flexDirection: "row",
|
|
@@ -29905,14 +29827,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29905
29827
|
}, /*#__PURE__*/React.createElement(AccordionSection, {
|
|
29906
29828
|
expanded: expanded,
|
|
29907
29829
|
onToggle: onToggle,
|
|
29908
|
-
style: [styles$
|
|
29909
|
-
headerStyle: styles$
|
|
29830
|
+
style: [styles$v.container, containerStyle],
|
|
29831
|
+
headerStyle: styles$v.accordionHeader,
|
|
29910
29832
|
header: header
|
|
29911
29833
|
}, /*#__PURE__*/React.createElement(View, {
|
|
29912
|
-
style: [styles$
|
|
29834
|
+
style: [styles$v.accordionPanel, panelStyle]
|
|
29913
29835
|
}, children)));
|
|
29914
29836
|
};
|
|
29915
|
-
const styles$
|
|
29837
|
+
const styles$v = StyleSheet.create({
|
|
29916
29838
|
container: {
|
|
29917
29839
|
backgroundColor: color.fadedBlue8,
|
|
29918
29840
|
marginTop: spacing.xSmall_8
|
|
@@ -29943,13 +29865,13 @@ const ColorSwatch = props => {
|
|
|
29943
29865
|
"aria-label":
|
|
29944
29866
|
// Don't include an aria label for decorative circles.
|
|
29945
29867
|
!decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
|
|
29946
|
-
style: [styles$
|
|
29868
|
+
style: [styles$u.colorSwatch, {
|
|
29947
29869
|
border: `4px solid ${lockedFigureColors[color$1]}`,
|
|
29948
29870
|
backgroundColor: filled ? lockedFigureColors[color$1] : color.white
|
|
29949
29871
|
}]
|
|
29950
29872
|
});
|
|
29951
29873
|
};
|
|
29952
|
-
const styles$
|
|
29874
|
+
const styles$u = StyleSheet.create({
|
|
29953
29875
|
colorSwatch: {
|
|
29954
29876
|
// Add a white outline so that the color swatch is visible when
|
|
29955
29877
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -29968,10 +29890,10 @@ const ColorSelect = props => {
|
|
|
29968
29890
|
onChange
|
|
29969
29891
|
} = props;
|
|
29970
29892
|
return /*#__PURE__*/React.createElement(View, {
|
|
29971
|
-
style: [styles$
|
|
29893
|
+
style: [styles$t.row, style]
|
|
29972
29894
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
29973
29895
|
tag: "label",
|
|
29974
|
-
style: styles$
|
|
29896
|
+
style: styles$t.row
|
|
29975
29897
|
}, "color", /*#__PURE__*/React.createElement(Strut, {
|
|
29976
29898
|
size: spacing.xxSmall_6
|
|
29977
29899
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -29990,7 +29912,7 @@ const ColorSelect = props => {
|
|
|
29990
29912
|
})
|
|
29991
29913
|
})))));
|
|
29992
29914
|
};
|
|
29993
|
-
const styles$
|
|
29915
|
+
const styles$t = StyleSheet.create({
|
|
29994
29916
|
row: {
|
|
29995
29917
|
display: "flex",
|
|
29996
29918
|
flexDirection: "row",
|
|
@@ -30006,17 +29928,17 @@ const EllipseSwatch = props => {
|
|
|
30006
29928
|
} = props;
|
|
30007
29929
|
return /*#__PURE__*/React.createElement(View, {
|
|
30008
29930
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30009
|
-
style: [styles$
|
|
29931
|
+
style: [styles$s.container, {
|
|
30010
29932
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30011
29933
|
}]
|
|
30012
29934
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30013
|
-
style: [styles$
|
|
29935
|
+
style: [styles$s.innerCircle, {
|
|
30014
29936
|
backgroundColor: lockedFigureColors[color],
|
|
30015
29937
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
30016
29938
|
}]
|
|
30017
29939
|
}));
|
|
30018
29940
|
};
|
|
30019
|
-
const styles$
|
|
29941
|
+
const styles$s = StyleSheet.create({
|
|
30020
29942
|
container: {
|
|
30021
29943
|
// Add a white outline so that the color swatch is visible when
|
|
30022
29944
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30047,40 +29969,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30047
29969
|
onRemove
|
|
30048
29970
|
} = props;
|
|
30049
29971
|
return /*#__PURE__*/React.createElement(View, {
|
|
30050
|
-
style: styles$
|
|
29972
|
+
style: styles$r.container
|
|
30051
29973
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
30052
29974
|
startIcon: trashIcon,
|
|
30053
29975
|
"aria-label": `Delete locked ${figureType}`,
|
|
30054
29976
|
onClick: onRemove,
|
|
30055
29977
|
kind: "tertiary",
|
|
30056
|
-
style: styles$
|
|
29978
|
+
style: styles$r.deleteButton
|
|
30057
29979
|
}, "Delete"), /*#__PURE__*/React.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
30058
29980
|
icon: caretDoubleUpIcon,
|
|
30059
29981
|
size: "small",
|
|
30060
29982
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30061
29983
|
onClick: () => onMove("back"),
|
|
30062
|
-
style: styles$
|
|
29984
|
+
style: styles$r.iconButton
|
|
30063
29985
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30064
29986
|
icon: caretUpIcon,
|
|
30065
29987
|
size: "small",
|
|
30066
29988
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30067
29989
|
onClick: () => onMove("backward"),
|
|
30068
|
-
style: styles$
|
|
29990
|
+
style: styles$r.iconButton
|
|
30069
29991
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30070
29992
|
icon: caretDownIcon,
|
|
30071
29993
|
size: "small",
|
|
30072
29994
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30073
29995
|
onClick: () => onMove("forward"),
|
|
30074
|
-
style: styles$
|
|
29996
|
+
style: styles$r.iconButton
|
|
30075
29997
|
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
30076
29998
|
icon: caretDoubleDownIcon,
|
|
30077
29999
|
size: "small",
|
|
30078
30000
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30079
30001
|
onClick: () => onMove("front"),
|
|
30080
|
-
style: styles$
|
|
30002
|
+
style: styles$r.iconButton
|
|
30081
30003
|
})));
|
|
30082
30004
|
};
|
|
30083
|
-
const styles$
|
|
30005
|
+
const styles$r = StyleSheet.create({
|
|
30084
30006
|
container: {
|
|
30085
30007
|
width: "100%",
|
|
30086
30008
|
flexDirection: "row",
|
|
@@ -30127,7 +30049,7 @@ const LockedEllipseSettings = props => {
|
|
|
30127
30049
|
/*#__PURE__*/
|
|
30128
30050
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30129
30051
|
React.createElement(View, {
|
|
30130
|
-
style: styles$
|
|
30052
|
+
style: styles$q.row
|
|
30131
30053
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
|
|
30132
30054
|
size: spacing.xSmall_8
|
|
30133
30055
|
}), /*#__PURE__*/React.createElement(EllipseSwatch, {
|
|
@@ -30136,19 +30058,19 @@ const LockedEllipseSettings = props => {
|
|
|
30136
30058
|
strokeStyle: strokeStyle
|
|
30137
30059
|
}))
|
|
30138
30060
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30139
|
-
style: styles$
|
|
30061
|
+
style: styles$q.row
|
|
30140
30062
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30141
30063
|
coord: center,
|
|
30142
|
-
style: styles$
|
|
30064
|
+
style: styles$q.spaceUnder,
|
|
30143
30065
|
onChange: newCoords => onChangeProps({
|
|
30144
30066
|
center: newCoords
|
|
30145
30067
|
})
|
|
30146
30068
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30147
|
-
style: styles$
|
|
30069
|
+
style: styles$q.spaceUnder
|
|
30148
30070
|
}, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30149
30071
|
coord: radius,
|
|
30150
30072
|
labels: ["x radius", "y radius"],
|
|
30151
|
-
style: styles$
|
|
30073
|
+
style: styles$q.spaceUnder,
|
|
30152
30074
|
onChange: newCoords => onChangeProps({
|
|
30153
30075
|
radius: newCoords
|
|
30154
30076
|
})
|
|
@@ -30160,7 +30082,7 @@ const LockedEllipseSettings = props => {
|
|
|
30160
30082
|
}), /*#__PURE__*/React.createElement(Strut, {
|
|
30161
30083
|
size: spacing.xSmall_8
|
|
30162
30084
|
}), /*#__PURE__*/React.createElement(View, {
|
|
30163
|
-
style: [styles$
|
|
30085
|
+
style: [styles$q.row, styles$q.spaceUnder]
|
|
30164
30086
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30165
30087
|
selectedValue: color,
|
|
30166
30088
|
onChange: handleColorChange
|
|
@@ -30168,7 +30090,7 @@ const LockedEllipseSettings = props => {
|
|
|
30168
30090
|
size: spacing.medium_16
|
|
30169
30091
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30170
30092
|
tag: "label",
|
|
30171
|
-
style: styles$
|
|
30093
|
+
style: styles$q.row
|
|
30172
30094
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30173
30095
|
size: spacing.xxSmall_6
|
|
30174
30096
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30185,7 +30107,7 @@ const LockedEllipseSettings = props => {
|
|
|
30185
30107
|
label: option
|
|
30186
30108
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30187
30109
|
tag: "label",
|
|
30188
|
-
style: styles$
|
|
30110
|
+
style: styles$q.row
|
|
30189
30111
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30190
30112
|
size: spacing.xxSmall_6
|
|
30191
30113
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30209,7 +30131,7 @@ const LockedEllipseSettings = props => {
|
|
|
30209
30131
|
onRemove: onRemove
|
|
30210
30132
|
}));
|
|
30211
30133
|
};
|
|
30212
|
-
const styles$
|
|
30134
|
+
const styles$q = StyleSheet.create({
|
|
30213
30135
|
row: {
|
|
30214
30136
|
display: "flex",
|
|
30215
30137
|
flexDirection: "row",
|
|
@@ -30230,7 +30152,7 @@ const LabeledSwitch = props => {
|
|
|
30230
30152
|
const ids = useUniqueIdWithMock();
|
|
30231
30153
|
const switchId = ids.get("switch");
|
|
30232
30154
|
return /*#__PURE__*/React.createElement(View, {
|
|
30233
|
-
style: [styles$
|
|
30155
|
+
style: [styles$p.row, style]
|
|
30234
30156
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
30235
30157
|
id: switchId,
|
|
30236
30158
|
checked: checked,
|
|
@@ -30242,7 +30164,7 @@ const LabeledSwitch = props => {
|
|
|
30242
30164
|
htmlFor: switchId
|
|
30243
30165
|
}, label));
|
|
30244
30166
|
};
|
|
30245
|
-
const styles$
|
|
30167
|
+
const styles$p = StyleSheet.create({
|
|
30246
30168
|
row: {
|
|
30247
30169
|
flexDirection: "row",
|
|
30248
30170
|
alignItems: "center"
|
|
@@ -30276,13 +30198,13 @@ const DefiningPointSettings = props => {
|
|
|
30276
30198
|
return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30277
30199
|
expanded: expanded,
|
|
30278
30200
|
onToggle: onToggle,
|
|
30279
|
-
containerStyle: styles$
|
|
30280
|
-
panelStyle: styles$
|
|
30201
|
+
containerStyle: styles$o.container,
|
|
30202
|
+
panelStyle: styles$o.accordionPanel,
|
|
30281
30203
|
header:
|
|
30282
30204
|
/*#__PURE__*/
|
|
30283
30205
|
// Summary: Point, coords, color (filled/open)
|
|
30284
30206
|
React.createElement(View, {
|
|
30285
|
-
style: styles$
|
|
30207
|
+
style: styles$o.row
|
|
30286
30208
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30287
30209
|
size: spacing.xSmall_8
|
|
30288
30210
|
}), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30292,7 +30214,7 @@ const DefiningPointSettings = props => {
|
|
|
30292
30214
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30293
30215
|
coord: coord,
|
|
30294
30216
|
error: !!error,
|
|
30295
|
-
style: styles$
|
|
30217
|
+
style: styles$o.spaceUnder,
|
|
30296
30218
|
onChange: newCoords => {
|
|
30297
30219
|
onChangeProps({
|
|
30298
30220
|
coord: newCoords
|
|
@@ -30301,12 +30223,12 @@ const DefiningPointSettings = props => {
|
|
|
30301
30223
|
}), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30302
30224
|
label: "show point on graph",
|
|
30303
30225
|
checked: !!showPoint,
|
|
30304
|
-
style: showPoint && styles$
|
|
30226
|
+
style: showPoint && styles$o.spaceUnder,
|
|
30305
30227
|
onChange: onTogglePoint
|
|
30306
30228
|
}), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30307
30229
|
selectedValue: pointColor,
|
|
30308
30230
|
onChange: handleColorChange,
|
|
30309
|
-
style: styles$
|
|
30231
|
+
style: styles$o.spaceUnder
|
|
30310
30232
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30311
30233
|
label: "open point",
|
|
30312
30234
|
checked: !filled,
|
|
@@ -30317,7 +30239,7 @@ const DefiningPointSettings = props => {
|
|
|
30317
30239
|
}
|
|
30318
30240
|
})));
|
|
30319
30241
|
};
|
|
30320
|
-
const styles$
|
|
30242
|
+
const styles$o = StyleSheet.create({
|
|
30321
30243
|
container: {
|
|
30322
30244
|
marginTop: spacing.xSmall_8,
|
|
30323
30245
|
marginBottom: 0,
|
|
@@ -30344,15 +30266,15 @@ const LineSwatch = props => {
|
|
|
30344
30266
|
lineStyle
|
|
30345
30267
|
} = props;
|
|
30346
30268
|
return /*#__PURE__*/React.createElement(View, {
|
|
30347
|
-
style: styles$
|
|
30269
|
+
style: styles$n.container
|
|
30348
30270
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30349
30271
|
"aria-label": `${color}, ${lineStyle}`,
|
|
30350
|
-
style: [styles$
|
|
30272
|
+
style: [styles$n.lineSwatch, {
|
|
30351
30273
|
border: `5px ${lineStyle} ${lockedFigureColors[color]}`
|
|
30352
30274
|
}]
|
|
30353
30275
|
}));
|
|
30354
30276
|
};
|
|
30355
|
-
const styles$
|
|
30277
|
+
const styles$n = StyleSheet.create({
|
|
30356
30278
|
container: {
|
|
30357
30279
|
backgroundColor: color.white,
|
|
30358
30280
|
justifyContent: "center",
|
|
@@ -30406,7 +30328,7 @@ const LockedLineSettings = props => {
|
|
|
30406
30328
|
expanded: props.expanded,
|
|
30407
30329
|
onToggle: props.onToggle,
|
|
30408
30330
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30409
|
-
style: styles$
|
|
30331
|
+
style: styles$m.row
|
|
30410
30332
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30411
30333
|
size: spacing.xSmall_8
|
|
30412
30334
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30415,7 +30337,7 @@ const LockedLineSettings = props => {
|
|
|
30415
30337
|
}))
|
|
30416
30338
|
}, /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30417
30339
|
tag: "label",
|
|
30418
|
-
style: [styles$
|
|
30340
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30419
30341
|
}, "kind", /*#__PURE__*/React.createElement(Strut, {
|
|
30420
30342
|
size: spacing.xxxSmall_4
|
|
30421
30343
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30436,7 +30358,7 @@ const LockedLineSettings = props => {
|
|
|
30436
30358
|
value: "segment",
|
|
30437
30359
|
label: "segment"
|
|
30438
30360
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
30439
|
-
style: styles$
|
|
30361
|
+
style: styles$m.row
|
|
30440
30362
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30441
30363
|
selectedValue: lineColor,
|
|
30442
30364
|
onChange: handleColorChange
|
|
@@ -30444,7 +30366,7 @@ const LockedLineSettings = props => {
|
|
|
30444
30366
|
size: spacing.small_12
|
|
30445
30367
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30446
30368
|
tag: "label",
|
|
30447
|
-
style: styles$
|
|
30369
|
+
style: styles$m.row
|
|
30448
30370
|
}, "style", /*#__PURE__*/React.createElement(Strut, {
|
|
30449
30371
|
size: spacing.xxxSmall_4
|
|
30450
30372
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30455,7 +30377,7 @@ const LockedLineSettings = props => {
|
|
|
30455
30377
|
// Placeholder is required, but never gets used.
|
|
30456
30378
|
,
|
|
30457
30379
|
placeholder: "",
|
|
30458
|
-
style: styles$
|
|
30380
|
+
style: styles$m.selectMarginOffset
|
|
30459
30381
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
30460
30382
|
value: "solid",
|
|
30461
30383
|
label: "solid"
|
|
@@ -30463,7 +30385,7 @@ const LockedLineSettings = props => {
|
|
|
30463
30385
|
value: "dashed",
|
|
30464
30386
|
label: "dashed"
|
|
30465
30387
|
})))), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30466
|
-
style: styles$
|
|
30388
|
+
style: styles$m.errorText
|
|
30467
30389
|
}, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
|
|
30468
30390
|
label: "Point 1",
|
|
30469
30391
|
showPoint: showPoint1,
|
|
@@ -30489,7 +30411,7 @@ const LockedLineSettings = props => {
|
|
|
30489
30411
|
onRemove: onRemove
|
|
30490
30412
|
}));
|
|
30491
30413
|
};
|
|
30492
|
-
const styles$
|
|
30414
|
+
const styles$m = StyleSheet.create({
|
|
30493
30415
|
row: {
|
|
30494
30416
|
display: "flex",
|
|
30495
30417
|
flexDirection: "row",
|
|
@@ -30534,7 +30456,7 @@ const LockedPointSettings = props => {
|
|
|
30534
30456
|
/*#__PURE__*/
|
|
30535
30457
|
// Summary: Point, coords, color (filled/open)
|
|
30536
30458
|
React.createElement(View, {
|
|
30537
|
-
style: styles$
|
|
30459
|
+
style: styles$l.row
|
|
30538
30460
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
|
|
30539
30461
|
size: spacing.xSmall_8
|
|
30540
30462
|
}), /*#__PURE__*/React.createElement(ColorSwatch, {
|
|
@@ -30543,7 +30465,7 @@ const LockedPointSettings = props => {
|
|
|
30543
30465
|
}))
|
|
30544
30466
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30545
30467
|
coord: coord,
|
|
30546
|
-
style: styles$
|
|
30468
|
+
style: styles$l.spaceUnder,
|
|
30547
30469
|
onChange: newCoord => {
|
|
30548
30470
|
onChangeProps({
|
|
30549
30471
|
coord: newCoord
|
|
@@ -30552,7 +30474,7 @@ const LockedPointSettings = props => {
|
|
|
30552
30474
|
}), /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30553
30475
|
selectedValue: pointColor,
|
|
30554
30476
|
onChange: handleColorChange,
|
|
30555
|
-
style: styles$
|
|
30477
|
+
style: styles$l.spaceUnder
|
|
30556
30478
|
}), /*#__PURE__*/React.createElement(LabeledSwitch, {
|
|
30557
30479
|
label: "open point",
|
|
30558
30480
|
checked: !filled,
|
|
@@ -30568,7 +30490,7 @@ const LockedPointSettings = props => {
|
|
|
30568
30490
|
onRemove: onRemove
|
|
30569
30491
|
}));
|
|
30570
30492
|
};
|
|
30571
|
-
const styles$
|
|
30493
|
+
const styles$l = StyleSheet.create({
|
|
30572
30494
|
row: {
|
|
30573
30495
|
flexDirection: "row",
|
|
30574
30496
|
alignItems: "center"
|
|
@@ -30586,17 +30508,17 @@ const PolygonSwatch = props => {
|
|
|
30586
30508
|
} = props;
|
|
30587
30509
|
return /*#__PURE__*/React.createElement(View, {
|
|
30588
30510
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30589
|
-
style: [styles$
|
|
30511
|
+
style: [styles$k.container, {
|
|
30590
30512
|
border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
|
|
30591
30513
|
}]
|
|
30592
30514
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30593
|
-
style: [styles$
|
|
30515
|
+
style: [styles$k.innerSquare, {
|
|
30594
30516
|
backgroundColor: lockedFigureColors[color],
|
|
30595
30517
|
opacity: lockedFigureFillStyles[fillStyle]
|
|
30596
30518
|
}]
|
|
30597
30519
|
}));
|
|
30598
30520
|
};
|
|
30599
|
-
const styles$
|
|
30521
|
+
const styles$k = StyleSheet.create({
|
|
30600
30522
|
container: {
|
|
30601
30523
|
// Add a white outline so that the color swatch is visible when
|
|
30602
30524
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30638,7 +30560,7 @@ const LockedPolygonSettings = props => {
|
|
|
30638
30560
|
/*#__PURE__*/
|
|
30639
30561
|
// Summary: Polygon, number of sides, style swatch
|
|
30640
30562
|
React.createElement(View, {
|
|
30641
|
-
style: styles$
|
|
30563
|
+
style: styles$j.row
|
|
30642
30564
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
|
|
30643
30565
|
size: spacing.xSmall_8
|
|
30644
30566
|
}), /*#__PURE__*/React.createElement(PolygonSwatch, {
|
|
@@ -30647,7 +30569,7 @@ const LockedPolygonSettings = props => {
|
|
|
30647
30569
|
strokeStyle: strokeStyle
|
|
30648
30570
|
}))
|
|
30649
30571
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30650
|
-
style: [styles$
|
|
30572
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30651
30573
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30652
30574
|
selectedValue: color,
|
|
30653
30575
|
onChange: handleColorChange
|
|
@@ -30655,7 +30577,7 @@ const LockedPolygonSettings = props => {
|
|
|
30655
30577
|
size: spacing.medium_16
|
|
30656
30578
|
}), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30657
30579
|
tag: "label",
|
|
30658
|
-
style: styles$
|
|
30580
|
+
style: styles$j.row
|
|
30659
30581
|
}, "fill", /*#__PURE__*/React.createElement(Strut, {
|
|
30660
30582
|
size: spacing.xxSmall_6
|
|
30661
30583
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30672,7 +30594,7 @@ const LockedPolygonSettings = props => {
|
|
|
30672
30594
|
label: option
|
|
30673
30595
|
}))))), /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30674
30596
|
tag: "label",
|
|
30675
|
-
style: [styles$
|
|
30597
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30676
30598
|
}, "stroke", /*#__PURE__*/React.createElement(Strut, {
|
|
30677
30599
|
size: spacing.xxSmall_6
|
|
30678
30600
|
}), /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -30695,17 +30617,17 @@ const LockedPolygonSettings = props => {
|
|
|
30695
30617
|
onChange: newValue => onChangeProps({
|
|
30696
30618
|
showVertices: newValue
|
|
30697
30619
|
}),
|
|
30698
|
-
style: styles$
|
|
30620
|
+
style: styles$j.spaceUnder
|
|
30699
30621
|
}), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30700
30622
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
|
|
30701
30623
|
expanded: true,
|
|
30702
|
-
containerStyle: styles$
|
|
30703
|
-
panelStyle: styles$
|
|
30624
|
+
containerStyle: styles$j.pointAccordionContainer,
|
|
30625
|
+
panelStyle: styles$j.pointAccordionPanel
|
|
30704
30626
|
}, points.map((point, index) => {
|
|
30705
30627
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30706
30628
|
return /*#__PURE__*/React.createElement(View, {
|
|
30707
30629
|
key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
|
|
30708
|
-
style: [styles$
|
|
30630
|
+
style: [styles$j.row, styles$j.spaceUnder]
|
|
30709
30631
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
|
|
30710
30632
|
size: spacing.medium_16
|
|
30711
30633
|
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
@@ -30733,7 +30655,7 @@ const LockedPolygonSettings = props => {
|
|
|
30733
30655
|
points: newPoints
|
|
30734
30656
|
});
|
|
30735
30657
|
},
|
|
30736
|
-
style: styles$
|
|
30658
|
+
style: styles$j.icon
|
|
30737
30659
|
}));
|
|
30738
30660
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
30739
30661
|
kind: "tertiary",
|
|
@@ -30750,7 +30672,7 @@ const LockedPolygonSettings = props => {
|
|
|
30750
30672
|
onRemove: onRemove
|
|
30751
30673
|
}));
|
|
30752
30674
|
};
|
|
30753
|
-
const styles$
|
|
30675
|
+
const styles$j = StyleSheet.create({
|
|
30754
30676
|
row: {
|
|
30755
30677
|
display: "flex",
|
|
30756
30678
|
flexDirection: "row",
|
|
@@ -30808,7 +30730,7 @@ const LockedVectorSettings = props => {
|
|
|
30808
30730
|
expanded: props.expanded,
|
|
30809
30731
|
onToggle: props.onToggle,
|
|
30810
30732
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30811
|
-
style: styles$
|
|
30733
|
+
style: styles$i.row
|
|
30812
30734
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
|
|
30813
30735
|
size: spacing.xSmall_8
|
|
30814
30736
|
}), /*#__PURE__*/React.createElement(LineSwatch, {
|
|
@@ -30816,19 +30738,19 @@ const LockedVectorSettings = props => {
|
|
|
30816
30738
|
lineStyle: "solid"
|
|
30817
30739
|
}))
|
|
30818
30740
|
}, /*#__PURE__*/React.createElement(View, {
|
|
30819
|
-
style: [styles$
|
|
30741
|
+
style: [styles$i.row, styles$i.spaceUnder]
|
|
30820
30742
|
}, /*#__PURE__*/React.createElement(ColorSelect, {
|
|
30821
30743
|
selectedValue: lineColor,
|
|
30822
30744
|
onChange: handleColorChange
|
|
30823
30745
|
})), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
|
|
30824
|
-
style: styles$
|
|
30746
|
+
style: styles$i.errorText
|
|
30825
30747
|
}, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30826
30748
|
expanded: true // Initial state is expanded
|
|
30827
30749
|
,
|
|
30828
|
-
containerStyle: styles$
|
|
30829
|
-
panelStyle: styles$
|
|
30750
|
+
containerStyle: styles$i.container,
|
|
30751
|
+
panelStyle: styles$i.accordionPanel,
|
|
30830
30752
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30831
|
-
style: styles$
|
|
30753
|
+
style: styles$i.row
|
|
30832
30754
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30833
30755
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30834
30756
|
coord: tail,
|
|
@@ -30839,10 +30761,10 @@ const LockedVectorSettings = props => {
|
|
|
30839
30761
|
})), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
30840
30762
|
expanded: true // Initial state is expanded
|
|
30841
30763
|
,
|
|
30842
|
-
containerStyle: styles$
|
|
30843
|
-
panelStyle: styles$
|
|
30764
|
+
containerStyle: styles$i.container,
|
|
30765
|
+
panelStyle: styles$i.accordionPanel,
|
|
30844
30766
|
header: /*#__PURE__*/React.createElement(View, {
|
|
30845
|
-
style: styles$
|
|
30767
|
+
style: styles$i.row
|
|
30846
30768
|
}, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30847
30769
|
}, /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
30848
30770
|
coord: tip,
|
|
@@ -30857,7 +30779,7 @@ const LockedVectorSettings = props => {
|
|
|
30857
30779
|
onRemove: onRemove
|
|
30858
30780
|
}));
|
|
30859
30781
|
};
|
|
30860
|
-
const styles$
|
|
30782
|
+
const styles$i = StyleSheet.create({
|
|
30861
30783
|
accordionPanel: {
|
|
30862
30784
|
paddingBottom: spacing.medium_16
|
|
30863
30785
|
},
|
|
@@ -31032,7 +30954,7 @@ const LockedFiguresSection = props => {
|
|
|
31032
30954
|
onRemove: () => removeLockedFigure(index)
|
|
31033
30955
|
}));
|
|
31034
30956
|
}), /*#__PURE__*/React.createElement(View, {
|
|
31035
|
-
style: styles$
|
|
30957
|
+
style: styles$h.buttonContainer
|
|
31036
30958
|
}, /*#__PURE__*/React.createElement(LockedFigureSelect, {
|
|
31037
30959
|
showM2Features: props.showM2Features,
|
|
31038
30960
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -31043,10 +30965,10 @@ const LockedFiguresSection = props => {
|
|
|
31043
30965
|
}), showExpandButton && /*#__PURE__*/React.createElement(Button, {
|
|
31044
30966
|
kind: "secondary",
|
|
31045
30967
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31046
|
-
style: styles$
|
|
30968
|
+
style: styles$h.button
|
|
31047
30969
|
}, buttonLabel))));
|
|
31048
30970
|
};
|
|
31049
|
-
const styles$
|
|
30971
|
+
const styles$h = StyleSheet.create({
|
|
31050
30972
|
buttonContainer: {
|
|
31051
30973
|
flexDirection: "row",
|
|
31052
30974
|
alignItems: "center"
|
|
@@ -31081,7 +31003,7 @@ const GraphPointsCountSelector = ({
|
|
|
31081
31003
|
// Never uses placeholder, always has value
|
|
31082
31004
|
,
|
|
31083
31005
|
placeholder: "",
|
|
31084
|
-
style: styles$
|
|
31006
|
+
style: styles$g.singleSelectShort
|
|
31085
31007
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31086
31008
|
key: n,
|
|
31087
31009
|
value: `${n}`,
|
|
@@ -31092,7 +31014,7 @@ const GraphPointsCountSelector = ({
|
|
|
31092
31014
|
label: "unlimited"
|
|
31093
31015
|
})]);
|
|
31094
31016
|
};
|
|
31095
|
-
const styles$
|
|
31017
|
+
const styles$g = StyleSheet.create({
|
|
31096
31018
|
singleSelectShort: {
|
|
31097
31019
|
// Non-standard spacing, but it's the smallest we can go
|
|
31098
31020
|
// without running into styling issues with the dropdown.
|
|
@@ -31105,7 +31027,7 @@ const GraphTypeSelector = props => {
|
|
|
31105
31027
|
selectedValue: props.graphType,
|
|
31106
31028
|
onChange: props.onChange,
|
|
31107
31029
|
placeholder: "Select a graph type",
|
|
31108
|
-
style: styles$
|
|
31030
|
+
style: styles$f.singleSelectShort
|
|
31109
31031
|
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
31110
31032
|
value: "linear",
|
|
31111
31033
|
label: "Linear function"
|
|
@@ -31138,7 +31060,7 @@ const GraphTypeSelector = props => {
|
|
|
31138
31060
|
label: "Angle"
|
|
31139
31061
|
}));
|
|
31140
31062
|
};
|
|
31141
|
-
const styles$
|
|
31063
|
+
const styles$f = StyleSheet.create({
|
|
31142
31064
|
singleSelectShort: {
|
|
31143
31065
|
// Non-standard spacing, but it's the smallest we can go
|
|
31144
31066
|
// without running into styling issues with the dropdown.
|
|
@@ -31204,18 +31126,6 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31204
31126
|
this.change = (...args) => {
|
|
31205
31127
|
return Changeable.change.apply(this, args);
|
|
31206
31128
|
};
|
|
31207
|
-
// TODO(aria): Make either a wrapper for standard events to work
|
|
31208
|
-
// with this.change, or make these use some TextInput/NumberInput box
|
|
31209
|
-
this.changeRulerLabel = e => {
|
|
31210
|
-
this.change({
|
|
31211
|
-
rulerLabel: e.target.value
|
|
31212
|
-
});
|
|
31213
|
-
};
|
|
31214
|
-
this.changeRulerTicks = e => {
|
|
31215
|
-
this.change({
|
|
31216
|
-
rulerTicks: +e.target.value
|
|
31217
|
-
});
|
|
31218
|
-
};
|
|
31219
31129
|
this.changeBackgroundUrl = e => {
|
|
31220
31130
|
var _this$bgUrlRef$curren;
|
|
31221
31131
|
// Only continue on blur or "enter"
|
|
@@ -31554,10 +31464,10 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31554
31464
|
onChange: this.change
|
|
31555
31465
|
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31556
31466
|
label: "Background image URL:",
|
|
31557
|
-
style: styles$
|
|
31467
|
+
style: styles$e.resetSpaceTop
|
|
31558
31468
|
}, /*#__PURE__*/React.createElement("input", {
|
|
31559
31469
|
type: "text",
|
|
31560
|
-
className: css(styles$
|
|
31470
|
+
className: css(styles$e.backgroundUrlInput),
|
|
31561
31471
|
ref: this.bgUrlRef,
|
|
31562
31472
|
value: this.state.backgroundImage.url || "",
|
|
31563
31473
|
onChange: e => {
|
|
@@ -31571,84 +31481,19 @@ class InteractiveGraphSettings extends React.Component {
|
|
|
31571
31481
|
onKeyPress: this.changeBackgroundUrl,
|
|
31572
31482
|
onBlur: this.changeBackgroundUrl
|
|
31573
31483
|
}), /*#__PURE__*/React.createElement(InfoTip$c, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
|
|
31574
|
-
style: styles$
|
|
31484
|
+
style: styles$e.protractorSection
|
|
31575
31485
|
}, /*#__PURE__*/React.createElement(View, {
|
|
31576
|
-
style: styles$
|
|
31486
|
+
style: styles$e.checkboxRow
|
|
31577
31487
|
}, /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
31578
|
-
label: "Show ruler",
|
|
31579
|
-
showRuler: this.props.showRuler,
|
|
31580
|
-
onChange: this.change,
|
|
31581
|
-
style: styles$d.resetSpaceTop
|
|
31582
|
-
}), /*#__PURE__*/React.createElement(PropCheckBox$7, {
|
|
31583
31488
|
label: "Show protractor",
|
|
31584
31489
|
showProtractor: this.props.showProtractor,
|
|
31585
31490
|
onChange: this.change,
|
|
31586
|
-
style: styles$
|
|
31587
|
-
})),
|
|
31491
|
+
style: styles$e.resetSpaceTop
|
|
31492
|
+
})), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
|
|
31588
31493
|
layout: "floating",
|
|
31589
|
-
text: "The
|
|
31494
|
+
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
31590
31495
|
kind: "warning"
|
|
31591
|
-
})
|
|
31592
|
-
style: styles$d.spaceTop
|
|
31593
|
-
}, /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31594
|
-
label: "Ruler label:",
|
|
31595
|
-
style: styles$d.resetSpaceTop
|
|
31596
|
-
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
31597
|
-
id: "ruler-label-select",
|
|
31598
|
-
selectedValue: this.props.rulerLabel,
|
|
31599
|
-
onChange: newValue => {
|
|
31600
|
-
this.change({
|
|
31601
|
-
rulerLabel: newValue
|
|
31602
|
-
});
|
|
31603
|
-
},
|
|
31604
|
-
placeholder: "None",
|
|
31605
|
-
style: styles$d.singleSelectShort
|
|
31606
|
-
}, /*#__PURE__*/React.createElement(OptionItem, {
|
|
31607
|
-
value: "",
|
|
31608
|
-
label: "None",
|
|
31609
|
-
horizontalRule: "full-width"
|
|
31610
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31611
|
-
value: "mm",
|
|
31612
|
-
label: "Milimeters"
|
|
31613
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31614
|
-
value: "cm",
|
|
31615
|
-
label: "Centimeters"
|
|
31616
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31617
|
-
value: "m",
|
|
31618
|
-
label: "Meters"
|
|
31619
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31620
|
-
value: "km",
|
|
31621
|
-
label: "Kilometers",
|
|
31622
|
-
horizontalRule: "full-width"
|
|
31623
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31624
|
-
value: "in",
|
|
31625
|
-
label: "Inches"
|
|
31626
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31627
|
-
value: "ft",
|
|
31628
|
-
label: "Feet"
|
|
31629
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31630
|
-
value: "yd",
|
|
31631
|
-
label: "Yards"
|
|
31632
|
-
}), /*#__PURE__*/React.createElement(OptionItem, {
|
|
31633
|
-
value: "mi",
|
|
31634
|
-
label: "Miles"
|
|
31635
|
-
}))), /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31636
|
-
label: "Ruler ticks:"
|
|
31637
|
-
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
31638
|
-
id: "ruler-ticks-select",
|
|
31639
|
-
selectedValue: `${this.props.rulerTicks}`,
|
|
31640
|
-
onChange: newValue => {
|
|
31641
|
-
this.change({
|
|
31642
|
-
rulerTicks: newValue
|
|
31643
|
-
});
|
|
31644
|
-
},
|
|
31645
|
-
placeholder: "10",
|
|
31646
|
-
style: styles$d.singleSelectShort
|
|
31647
|
-
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31648
|
-
key: value,
|
|
31649
|
-
value: `${value}`,
|
|
31650
|
-
label: `${value}`
|
|
31651
|
-
}))))))));
|
|
31496
|
+
}))));
|
|
31652
31497
|
}
|
|
31653
31498
|
}
|
|
31654
31499
|
InteractiveGraphSettings.defaultProps = {
|
|
@@ -31662,23 +31507,12 @@ InteractiveGraphSettings.defaultProps = {
|
|
|
31662
31507
|
backgroundImage: defaultBackgroundImage$1,
|
|
31663
31508
|
markings: "graph",
|
|
31664
31509
|
showProtractor: false,
|
|
31665
|
-
|
|
31666
|
-
showTooltips: false,
|
|
31667
|
-
rulerLabel: "",
|
|
31668
|
-
rulerTicks: 10
|
|
31510
|
+
showTooltips: false
|
|
31669
31511
|
};
|
|
31670
|
-
const styles$
|
|
31512
|
+
const styles$e = StyleSheet.create({
|
|
31671
31513
|
resetSpaceTop: {
|
|
31672
31514
|
marginTop: 0
|
|
31673
31515
|
},
|
|
31674
|
-
spaceTop: {
|
|
31675
|
-
marginTop: spacing.xSmall_8
|
|
31676
|
-
},
|
|
31677
|
-
singleSelectShort: {
|
|
31678
|
-
// Non-standard spacing, but it's the smallest we can go
|
|
31679
|
-
// without running into styling issues with the dropdown.
|
|
31680
|
-
height: 26
|
|
31681
|
-
},
|
|
31682
31516
|
backgroundUrlInput: {
|
|
31683
31517
|
border: `1px solid ${color.offBlack32}`,
|
|
31684
31518
|
borderRadius: spacing.xxxSmall_4,
|
|
@@ -31690,7 +31524,7 @@ const styles$d = StyleSheet.create({
|
|
|
31690
31524
|
justifyContent: "space-between",
|
|
31691
31525
|
marginBottom: spacing.xSmall_8
|
|
31692
31526
|
},
|
|
31693
|
-
|
|
31527
|
+
protractorSection: {
|
|
31694
31528
|
marginTop: spacing.xSmall_8,
|
|
31695
31529
|
borderTop: `1px solid ${color.offBlack16}`,
|
|
31696
31530
|
paddingTop: spacing.xSmall_8,
|
|
@@ -31712,13 +31546,13 @@ const SegmentCountSelector = ({
|
|
|
31712
31546
|
const num = +newValue;
|
|
31713
31547
|
onChange(num);
|
|
31714
31548
|
},
|
|
31715
|
-
style: styles$
|
|
31549
|
+
style: styles$d.singleSelectShort
|
|
31716
31550
|
}, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
|
|
31717
31551
|
key: n,
|
|
31718
31552
|
value: `${n}`,
|
|
31719
31553
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31720
31554
|
})));
|
|
31721
|
-
const styles$
|
|
31555
|
+
const styles$d = StyleSheet.create({
|
|
31722
31556
|
singleSelectShort: {
|
|
31723
31557
|
// Non-standard spacing, but it's the smallest we can go
|
|
31724
31558
|
// without running into styling issues with the dropdown.
|
|
@@ -31726,77 +31560,142 @@ const styles$c = StyleSheet.create({
|
|
|
31726
31560
|
}
|
|
31727
31561
|
});
|
|
31728
31562
|
|
|
31729
|
-
const
|
|
31563
|
+
const StartCoordsLine = props => {
|
|
31564
|
+
const {
|
|
31565
|
+
startCoords,
|
|
31566
|
+
onChange
|
|
31567
|
+
} = props;
|
|
31568
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
31569
|
+
style: styles$c.tile
|
|
31570
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31571
|
+
size: spacing.small_12
|
|
31572
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31573
|
+
coord: startCoords[0],
|
|
31574
|
+
labels: ["x", "y"],
|
|
31575
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
31576
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
31577
|
+
style: styles$c.tile
|
|
31578
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31579
|
+
size: spacing.small_12
|
|
31580
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31581
|
+
coord: startCoords[1],
|
|
31582
|
+
labels: ["x", "y"],
|
|
31583
|
+
onChange: value => onChange([startCoords[0], value])
|
|
31584
|
+
})));
|
|
31585
|
+
};
|
|
31586
|
+
const styles$c = StyleSheet.create({
|
|
31587
|
+
tile: {
|
|
31588
|
+
backgroundColor: color.fadedBlue8,
|
|
31589
|
+
marginTop: spacing.xSmall_8,
|
|
31590
|
+
padding: spacing.small_12,
|
|
31591
|
+
borderRadius: spacing.xSmall_8,
|
|
31592
|
+
flexDirection: "row",
|
|
31593
|
+
alignItems: "center"
|
|
31594
|
+
}
|
|
31595
|
+
});
|
|
31596
|
+
|
|
31597
|
+
const StartCoordsMultiline = props => {
|
|
31730
31598
|
const {
|
|
31731
|
-
type,
|
|
31732
31599
|
startCoords,
|
|
31600
|
+
type,
|
|
31733
31601
|
onChange
|
|
31734
31602
|
} = props;
|
|
31603
|
+
const graphName = type === "segment" ? "Segment" : "Line";
|
|
31604
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, startCoords.map((coordPair, i) => /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
|
|
31605
|
+
key: `segment-${i}-start-coords`,
|
|
31606
|
+
header: /*#__PURE__*/React.createElement(LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31607
|
+
expanded: true
|
|
31608
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
31609
|
+
style: styles$b.nestedTile
|
|
31610
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31611
|
+
size: spacing.small_12
|
|
31612
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31613
|
+
coord: coordPair[0],
|
|
31614
|
+
labels: ["x", "y"],
|
|
31615
|
+
onChange: value => {
|
|
31616
|
+
const newCoords = [...startCoords];
|
|
31617
|
+
newCoords[i] = [value, coordPair[1]];
|
|
31618
|
+
onChange(newCoords);
|
|
31619
|
+
}
|
|
31620
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
31621
|
+
style: styles$b.nestedTile
|
|
31622
|
+
}, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
|
|
31623
|
+
size: spacing.small_12
|
|
31624
|
+
}), /*#__PURE__*/React.createElement(CoordinatePairInput, {
|
|
31625
|
+
coord: coordPair[1],
|
|
31626
|
+
labels: ["x", "y"],
|
|
31627
|
+
onChange: value => {
|
|
31628
|
+
const newCoords = [...startCoords];
|
|
31629
|
+
newCoords[i] = [coordPair[0], value];
|
|
31630
|
+
onChange(newCoords);
|
|
31631
|
+
}
|
|
31632
|
+
})))));
|
|
31633
|
+
};
|
|
31634
|
+
const styles$b = StyleSheet.create({
|
|
31635
|
+
nestedTile: {
|
|
31636
|
+
paddingBottom: spacing.small_12,
|
|
31637
|
+
flexDirection: "row",
|
|
31638
|
+
alignItems: "center"
|
|
31639
|
+
}
|
|
31640
|
+
});
|
|
31735
31641
|
|
|
31736
|
-
|
|
31642
|
+
const StartCoordsSettingsInner = props => {
|
|
31643
|
+
const {
|
|
31644
|
+
type,
|
|
31645
|
+
range,
|
|
31646
|
+
step,
|
|
31647
|
+
onChange
|
|
31648
|
+
} = props;
|
|
31737
31649
|
switch (type) {
|
|
31650
|
+
// Graphs with startCoords of type CollinearTuple
|
|
31738
31651
|
case "linear":
|
|
31739
31652
|
case "ray":
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31653
|
+
// Gets the startCoords from props if they're passed in,
|
|
31654
|
+
// otherwise calculates the default startCoords.
|
|
31655
|
+
const linearCoords = getLineCoords(props, range, step);
|
|
31656
|
+
return /*#__PURE__*/React.createElement(StartCoordsLine, {
|
|
31657
|
+
startCoords: linearCoords,
|
|
31658
|
+
onChange: onChange
|
|
31659
|
+
});
|
|
31660
|
+
// Graphs with startCoords of type CollinearTuple[]
|
|
31661
|
+
case "linear-system":
|
|
31662
|
+
case "segment":
|
|
31663
|
+
const multiLineCoords =
|
|
31664
|
+
// Gets the startCoords from props if they're passed in,
|
|
31665
|
+
// otherwise calculates the default startCoords.
|
|
31666
|
+
type === "segment" ? getSegmentCoords(props, range, step) : getLinearSystemCoords(props, range, step);
|
|
31667
|
+
return /*#__PURE__*/React.createElement(StartCoordsMultiline, {
|
|
31668
|
+
type: type,
|
|
31669
|
+
startCoords: multiLineCoords,
|
|
31670
|
+
onChange: onChange
|
|
31671
|
+
});
|
|
31751
31672
|
default:
|
|
31752
31673
|
return null;
|
|
31753
31674
|
}
|
|
31754
31675
|
};
|
|
31755
|
-
const
|
|
31756
|
-
var _props$startCoords;
|
|
31676
|
+
const StartCoordsSettings = props => {
|
|
31757
31677
|
const {
|
|
31758
|
-
type,
|
|
31759
31678
|
range,
|
|
31760
31679
|
step,
|
|
31761
31680
|
onChange
|
|
31762
31681
|
} = props;
|
|
31763
31682
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
31764
|
-
|
|
31765
|
-
return null;
|
|
31766
|
-
}
|
|
31767
|
-
const defaultStartCoords = getLineCoords({
|
|
31768
|
-
type: type
|
|
31769
|
-
}, range, step);
|
|
31770
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
31771
|
-
style: styles$b.container
|
|
31772
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
31683
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Heading, {
|
|
31773
31684
|
isCollapsible: true,
|
|
31774
31685
|
title: "Start coordinates",
|
|
31775
31686
|
isOpen: isOpen,
|
|
31776
31687
|
onToggle: () => setIsOpen(!isOpen)
|
|
31777
|
-
}), isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
31778
|
-
type: type,
|
|
31779
|
-
startCoords: (_props$startCoords = props.startCoords) != null ? _props$startCoords : defaultStartCoords,
|
|
31780
|
-
onChange: onChange
|
|
31781
|
-
}), /*#__PURE__*/React.createElement(Strut, {
|
|
31688
|
+
}), isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StartCoordsSettingsInner, props), /*#__PURE__*/React.createElement(Strut, {
|
|
31782
31689
|
size: spacing.small_12
|
|
31783
31690
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
31784
31691
|
startIcon: arrowCounterClockwise,
|
|
31785
31692
|
kind: "tertiary",
|
|
31786
31693
|
size: "small",
|
|
31787
31694
|
onClick: () => {
|
|
31788
|
-
onChange(
|
|
31695
|
+
onChange(getDefaultGraphStartCoords(props, range, step));
|
|
31789
31696
|
}
|
|
31790
|
-
}, "Use default start
|
|
31697
|
+
}, "Use default start coordinates")));
|
|
31791
31698
|
};
|
|
31792
|
-
const styles$b = StyleSheet.create({
|
|
31793
|
-
tile: {
|
|
31794
|
-
backgroundColor: color.fadedBlue8,
|
|
31795
|
-
marginTop: spacing.xSmall_8,
|
|
31796
|
-
padding: spacing.small_12,
|
|
31797
|
-
borderRadius: spacing.xSmall_8
|
|
31798
|
-
}
|
|
31799
|
-
});
|
|
31800
31699
|
|
|
31801
31700
|
const {
|
|
31802
31701
|
InfoTip: InfoTip$b
|
|
@@ -31846,8 +31745,8 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31846
31745
|
});
|
|
31847
31746
|
};
|
|
31848
31747
|
this.changeStartCoords = coords => {
|
|
31849
|
-
var _this$props$graph
|
|
31850
|
-
if (((_this$props$graph = this.props.graph)
|
|
31748
|
+
var _this$props$graph;
|
|
31749
|
+
if (!((_this$props$graph = this.props.graph) != null && _this$props$graph.type)) {
|
|
31851
31750
|
return;
|
|
31852
31751
|
}
|
|
31853
31752
|
const graph = _extends({}, this.props.graph, {
|
|
@@ -31875,7 +31774,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31875
31774
|
DeprecationMixin.UNSAFE_componentWillMount.call(this);
|
|
31876
31775
|
}
|
|
31877
31776
|
render() {
|
|
31878
|
-
var _this$props$graph$typ, _this$props$
|
|
31777
|
+
var _this$props$graph$typ, _this$props$graph2, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$graph5, _this$props$apiOption, _this$props$apiOption2, _this$props$apiOption3, _this$props$apiOption4;
|
|
31879
31778
|
let graph;
|
|
31880
31779
|
let equationString;
|
|
31881
31780
|
const gridStep = this.props.gridStep || Util.getGridStep(this.props.range, this.props.step, interactiveSizes.defaultBoxSize);
|
|
@@ -31897,10 +31796,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31897
31796
|
backgroundImage: this.props.backgroundImage,
|
|
31898
31797
|
markings: this.props.markings,
|
|
31899
31798
|
showProtractor: this.props.showProtractor,
|
|
31900
|
-
showRuler: this.props.showRuler,
|
|
31901
31799
|
showTooltips: this.props.showTooltips,
|
|
31902
|
-
rulerLabel: this.props.rulerLabel,
|
|
31903
|
-
rulerTicks: this.props.rulerTicks,
|
|
31904
31800
|
lockedFigures: this.props.lockedFigures,
|
|
31905
31801
|
trackInteraction: function () {},
|
|
31906
31802
|
onChange: newProps => {
|
|
@@ -31942,7 +31838,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
31942
31838
|
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(LabeledRow, {
|
|
31943
31839
|
label: "Type of Graph:"
|
|
31944
31840
|
}, /*#__PURE__*/React.createElement(GraphTypeSelector, {
|
|
31945
|
-
graphType: (_this$props$graph$typ = (_this$props$
|
|
31841
|
+
graphType: (_this$props$graph$typ = (_this$props$graph2 = this.props.graph) == null ? void 0 : _this$props$graph2.type) != null ? _this$props$graph$typ : InteractiveGraph.defaultProps.graph.type,
|
|
31946
31842
|
onChange: type => {
|
|
31947
31843
|
this.props.onChange({
|
|
31948
31844
|
graph: {
|
|
@@ -32030,8 +31926,8 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32030
31926
|
// Don't show indeterminate checkbox state
|
|
32031
31927
|
!!((_this$props$correct8 = this.props.correct) != null && _this$props$correct8.showAngles),
|
|
32032
31928
|
onChange: () => {
|
|
32033
|
-
var _this$props$
|
|
32034
|
-
if (((_this$props$
|
|
31929
|
+
var _this$props$graph3;
|
|
31930
|
+
if (((_this$props$graph3 = this.props.graph) == null ? void 0 : _this$props$graph3.type) === "polygon") {
|
|
32035
31931
|
this.props.onChange({
|
|
32036
31932
|
correct: _extends({}, this.props.correct, {
|
|
32037
31933
|
showAngles: !this.props.correct.showAngles
|
|
@@ -32050,8 +31946,8 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32050
31946
|
// Don't show indeterminate checkbox state
|
|
32051
31947
|
!!((_this$props$correct9 = this.props.correct) != null && _this$props$correct9.showSides),
|
|
32052
31948
|
onChange: () => {
|
|
32053
|
-
var _this$props$
|
|
32054
|
-
if (((_this$props$
|
|
31949
|
+
var _this$props$graph4;
|
|
31950
|
+
if (((_this$props$graph4 = this.props.graph) == null ? void 0 : _this$props$graph4.type) === "polygon") {
|
|
32055
31951
|
this.props.onChange({
|
|
32056
31952
|
correct: _extends({}, this.props.correct, {
|
|
32057
31953
|
showSides: !this.props.correct.showSides
|
|
@@ -32079,7 +31975,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32079
31975
|
}
|
|
32080
31976
|
});
|
|
32081
31977
|
}
|
|
32082
|
-
})), ((
|
|
31978
|
+
})), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) && ((_this$props$apiOption = this.props.apiOptions.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui"]) && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32083
31979
|
range: this.props.range,
|
|
32084
31980
|
step: this.props.step,
|
|
32085
31981
|
onChange: this.changeStartCoords
|
|
@@ -32094,10 +31990,7 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32094
31990
|
backgroundImage: this.props.backgroundImage,
|
|
32095
31991
|
markings: this.props.markings,
|
|
32096
31992
|
showProtractor: this.props.showProtractor,
|
|
32097
|
-
showRuler: this.props.showRuler,
|
|
32098
31993
|
showTooltips: this.props.showTooltips,
|
|
32099
|
-
rulerLabel: this.props.rulerLabel,
|
|
32100
|
-
rulerTicks: this.props.rulerTicks,
|
|
32101
31994
|
onChange: this.props.onChange
|
|
32102
31995
|
}), this.props.correct.type === "polygon" && /*#__PURE__*/React.createElement(LabeledRow, {
|
|
32103
31996
|
label: "Student answer must"
|
|
@@ -32150,24 +32043,24 @@ class InteractiveGraphEditor extends React.Component {
|
|
|
32150
32043
|
// is copied from the question editor and pasted into the hint editor
|
|
32151
32044
|
// (double brackets in the markdown).
|
|
32152
32045
|
serialize() {
|
|
32153
|
-
const json = _.pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "
|
|
32046
|
+
const json = _.pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures");
|
|
32154
32047
|
|
|
32155
32048
|
// eslint-disable-next-line react/no-string-refs
|
|
32156
32049
|
const graph = this.refs.graph;
|
|
32157
32050
|
if (graph) {
|
|
32158
|
-
var _this$props$
|
|
32051
|
+
var _this$props$graph6;
|
|
32159
32052
|
// @ts-expect-error TS2339 Property 'getUserInput' does not exist on type 'ReactInstance'. Property 'getUserInput' does not exist on type 'Component<any, {}, any>'.
|
|
32160
32053
|
const correct = graph && graph.getUserInput();
|
|
32161
32054
|
_.extend(json, {
|
|
32162
32055
|
graph: {
|
|
32163
32056
|
type: correct.type,
|
|
32164
|
-
startCoords: (_this$props$
|
|
32057
|
+
startCoords: (_this$props$graph6 = this.props.graph) == null ? void 0 : _this$props$graph6.startCoords
|
|
32165
32058
|
},
|
|
32166
32059
|
correct: correct
|
|
32167
32060
|
});
|
|
32168
32061
|
_.each(["allowReflexAngles", "angleOffsetDeg", "numPoints", "numSides", "numSegments", "showAngles", "showSides", "snapTo", "snapDegrees"], function (key) {
|
|
32169
32062
|
if (_.has(correct, key)) {
|
|
32170
|
-
// @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor"
|
|
32063
|
+
// @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor">'.
|
|
32171
32064
|
json.graph[key] = correct[key];
|
|
32172
32065
|
}
|
|
32173
32066
|
});
|
|
@@ -33867,7 +33760,7 @@ MatrixEditor.defaultProps = {
|
|
|
33867
33760
|
|
|
33868
33761
|
const {
|
|
33869
33762
|
InfoTip: InfoTip$9,
|
|
33870
|
-
NumberInput: NumberInput$
|
|
33763
|
+
NumberInput: NumberInput$7,
|
|
33871
33764
|
PropCheckBox: PropCheckBox$5,
|
|
33872
33765
|
RangeInput: RangeInput$2
|
|
33873
33766
|
} = components;
|
|
@@ -33927,14 +33820,14 @@ class MeasurerEditor extends React.Component {
|
|
|
33927
33820
|
className: "perseus-widget-row"
|
|
33928
33821
|
}, /*#__PURE__*/React.createElement("label", {
|
|
33929
33822
|
className: "perseus-widget-left-col"
|
|
33930
|
-
}, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33823
|
+
}, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
|
|
33931
33824
|
placeholder: 0,
|
|
33932
33825
|
onChange: this._changeTop,
|
|
33933
33826
|
value: image.top,
|
|
33934
33827
|
useArrowKeys: true
|
|
33935
33828
|
})), /*#__PURE__*/React.createElement("label", {
|
|
33936
33829
|
className: "perseus-widget-right-col"
|
|
33937
|
-
}, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33830
|
+
}, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
|
|
33938
33831
|
placeholder: 0,
|
|
33939
33832
|
onChange: this._changeLeft,
|
|
33940
33833
|
value: image.left,
|
|
@@ -33980,14 +33873,14 @@ class MeasurerEditor extends React.Component {
|
|
|
33980
33873
|
key: n,
|
|
33981
33874
|
value: n
|
|
33982
33875
|
}, n);
|
|
33983
|
-
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33876
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
|
|
33984
33877
|
placeholder: 40
|
|
33985
33878
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33986
33879
|
,
|
|
33987
33880
|
onChange: this.change("rulerPixels"),
|
|
33988
33881
|
value: this.props.rulerPixels,
|
|
33989
33882
|
useArrowKeys: true
|
|
33990
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
33883
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
|
|
33991
33884
|
placeholder: 10
|
|
33992
33885
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
33993
33886
|
,
|
|
@@ -34024,7 +33917,7 @@ MeasurerEditor.defaultProps = {
|
|
|
34024
33917
|
};
|
|
34025
33918
|
|
|
34026
33919
|
const {
|
|
34027
|
-
NumberInput: NumberInput$
|
|
33920
|
+
NumberInput: NumberInput$6,
|
|
34028
33921
|
TextInput: TextInput$4
|
|
34029
33922
|
} = components;
|
|
34030
33923
|
class MoleculeWidgetEditor extends React.Component {
|
|
@@ -34053,7 +33946,7 @@ class MoleculeWidgetEditor extends React.Component {
|
|
|
34053
33946
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$4, {
|
|
34054
33947
|
onChange: this.updateMolecule,
|
|
34055
33948
|
value: this.props.smiles
|
|
34056
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$
|
|
33949
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$6, {
|
|
34057
33950
|
onChange: this.updateRotation,
|
|
34058
33951
|
value: this.props.rotationAngle
|
|
34059
33952
|
}))));
|
|
@@ -34069,7 +33962,7 @@ MoleculeWidgetEditor.widgetName = "molecule-renderer";
|
|
|
34069
33962
|
const {
|
|
34070
33963
|
ButtonGroup: ButtonGroup$1,
|
|
34071
33964
|
InfoTip: InfoTip$8,
|
|
34072
|
-
NumberInput: NumberInput$
|
|
33965
|
+
NumberInput: NumberInput$5,
|
|
34073
33966
|
PropCheckBox: PropCheckBox$4,
|
|
34074
33967
|
RangeInput: RangeInput$1
|
|
34075
33968
|
} = components;
|
|
@@ -34220,7 +34113,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34220
34113
|
}, "\u2264"), /*#__PURE__*/React.createElement("option", {
|
|
34221
34114
|
value: "ge",
|
|
34222
34115
|
"aria-label": "Greater than or equal"
|
|
34223
|
-
}, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34116
|
+
}, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34224
34117
|
value: this.props.correctX,
|
|
34225
34118
|
format: this.props.labelStyle
|
|
34226
34119
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -34232,7 +34125,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34232
34125
|
useArrowKeys: true
|
|
34233
34126
|
}), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("div", {
|
|
34234
34127
|
className: "perseus-widget-row"
|
|
34235
|
-
}, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34128
|
+
}, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34236
34129
|
value: this.props.initialX,
|
|
34237
34130
|
format: this.props.labelStyle
|
|
34238
34131
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -34252,7 +34145,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34252
34145
|
className: "perseus-widget-row"
|
|
34253
34146
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34254
34147
|
className: "perseus-widget-left-col"
|
|
34255
|
-
}, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34148
|
+
}, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34256
34149
|
value: labelRange[0],
|
|
34257
34150
|
placeholder: range[0],
|
|
34258
34151
|
format: this.props.labelStyle,
|
|
@@ -34261,7 +34154,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34261
34154
|
,
|
|
34262
34155
|
onChange: this.onLabelRangeChange.bind(this, 0),
|
|
34263
34156
|
useArrowKeys: true
|
|
34264
|
-
}), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$
|
|
34157
|
+
}), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34265
34158
|
value: labelRange[1],
|
|
34266
34159
|
placeholder: range[1],
|
|
34267
34160
|
format: this.props.labelStyle,
|
|
@@ -34299,7 +34192,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34299
34192
|
onChange: this.props.onChange
|
|
34300
34193
|
})), /*#__PURE__*/React.createElement("div", {
|
|
34301
34194
|
className: "perseus-widget-row"
|
|
34302
|
-
}, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34195
|
+
}, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34303
34196
|
value: this.props.numDivisions || null,
|
|
34304
34197
|
format: "decimal",
|
|
34305
34198
|
onChange: this.onNumDivisionsChange,
|
|
@@ -34308,7 +34201,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34308
34201
|
},
|
|
34309
34202
|
placeholder: width / this.props.tickStep,
|
|
34310
34203
|
useArrowKeys: true
|
|
34311
|
-
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34204
|
+
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34312
34205
|
value: this.props.numDivisions || null,
|
|
34313
34206
|
format: "decimal",
|
|
34314
34207
|
onChange: this.onNumDivisionsChange,
|
|
@@ -34317,7 +34210,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34317
34210
|
},
|
|
34318
34211
|
placeholder: width / this.props.tickStep,
|
|
34319
34212
|
useArrowKeys: true
|
|
34320
|
-
})), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34213
|
+
})), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34321
34214
|
value: this.props.tickStep || null,
|
|
34322
34215
|
format: this.props.labelStyle,
|
|
34323
34216
|
onChange: this.onTickStepChange,
|
|
@@ -34328,7 +34221,7 @@ class NumberLineEditor extends React.Component {
|
|
|
34328
34221
|
useArrowKeys: true
|
|
34329
34222
|
})), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.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.createElement("br", null), /*#__PURE__*/React.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.createElement("div", {
|
|
34330
34223
|
className: "perseus-widget-row"
|
|
34331
|
-
}, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34224
|
+
}, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
|
|
34332
34225
|
value: snapDivisions,
|
|
34333
34226
|
checkValidity: val => val > 0,
|
|
34334
34227
|
format: this.props.labelStyle
|
|
@@ -34376,9 +34269,9 @@ NumberLineEditor.defaultProps = {
|
|
|
34376
34269
|
const {
|
|
34377
34270
|
ButtonGroup,
|
|
34378
34271
|
InfoTip: InfoTip$7,
|
|
34379
|
-
InlineIcon: InlineIcon$
|
|
34272
|
+
InlineIcon: InlineIcon$1,
|
|
34380
34273
|
MultiButtonGroup,
|
|
34381
|
-
NumberInput: NumberInput$
|
|
34274
|
+
NumberInput: NumberInput$4,
|
|
34382
34275
|
PropCheckBox: PropCheckBox$3,
|
|
34383
34276
|
TextInput: TextInput$3
|
|
34384
34277
|
} = components;
|
|
@@ -34560,7 +34453,7 @@ class NumericInputEditor extends React.Component {
|
|
|
34560
34453
|
})));
|
|
34561
34454
|
const maxError = i => /*#__PURE__*/React.createElement("div", {
|
|
34562
34455
|
className: "perseus-widget-row"
|
|
34563
|
-
}, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34456
|
+
}, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
34564
34457
|
className: "max-error",
|
|
34565
34458
|
value: answers[i]["maxError"],
|
|
34566
34459
|
onChange: this.updateAnswer(i, "maxError"),
|
|
@@ -34635,7 +34528,7 @@ class NumericInputEditor extends React.Component {
|
|
|
34635
34528
|
key: i
|
|
34636
34529
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34637
34530
|
className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
|
|
34638
|
-
}, /*#__PURE__*/React.createElement(NumberInput$
|
|
34531
|
+
}, /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
34639
34532
|
value: answer.value,
|
|
34640
34533
|
className: "numeric-input-value",
|
|
34641
34534
|
placeholder: "answer",
|
|
@@ -34682,7 +34575,7 @@ class NumericInputEditor extends React.Component {
|
|
|
34682
34575
|
className: "max-error-container"
|
|
34683
34576
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34684
34577
|
className: "max-error-plusmn"
|
|
34685
|
-
}, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$
|
|
34578
|
+
}, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
34686
34579
|
placeholder: 0,
|
|
34687
34580
|
value: answers[i]["maxError"],
|
|
34688
34581
|
format: _.last(answer.answerForms || []),
|
|
@@ -34710,7 +34603,7 @@ class NumericInputEditor extends React.Component {
|
|
|
34710
34603
|
this.onTrashAnswer(i);
|
|
34711
34604
|
},
|
|
34712
34605
|
onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
|
|
34713
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
34606
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
|
|
34714
34607
|
href: "#",
|
|
34715
34608
|
className: "options-toggle",
|
|
34716
34609
|
"aria-label": "Toggle options",
|
|
@@ -34721,7 +34614,7 @@ class NumericInputEditor extends React.Component {
|
|
|
34721
34614
|
this.onToggleOptions(i);
|
|
34722
34615
|
},
|
|
34723
34616
|
onKeyDown: e => this.onSpace(e, this.onToggleOptions)
|
|
34724
|
-
}, /*#__PURE__*/React.createElement(InlineIcon$
|
|
34617
|
+
}, /*#__PURE__*/React.createElement(InlineIcon$1, iconGear))), /*#__PURE__*/React.createElement("div", {
|
|
34725
34618
|
className: "input-answer-editor-message"
|
|
34726
34619
|
}, editor), this.state.showOptions[i] && /*#__PURE__*/React.createElement("div", {
|
|
34727
34620
|
className: "options-container"
|
|
@@ -34944,7 +34837,7 @@ PassageEditor.defaultProps = {
|
|
|
34944
34837
|
|
|
34945
34838
|
const {
|
|
34946
34839
|
InfoTip: InfoTip$4,
|
|
34947
|
-
NumberInput: NumberInput$
|
|
34840
|
+
NumberInput: NumberInput$3,
|
|
34948
34841
|
TextInput: TextInput$2
|
|
34949
34842
|
} = components;
|
|
34950
34843
|
class PassageRefEditor extends React.Component {
|
|
@@ -34958,12 +34851,12 @@ class PassageRefEditor extends React.Component {
|
|
|
34958
34851
|
};
|
|
34959
34852
|
}
|
|
34960
34853
|
render() {
|
|
34961
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34854
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
34962
34855
|
value: this.props.passageNumber
|
|
34963
34856
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34964
34857
|
,
|
|
34965
34858
|
onChange: this.change("passageNumber")
|
|
34966
|
-
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$
|
|
34859
|
+
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$3, {
|
|
34967
34860
|
value: this.props.referenceNumber
|
|
34968
34861
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
34969
34862
|
,
|
|
@@ -35022,7 +34915,7 @@ PassageRefTargetEditor.defaultProps = {
|
|
|
35022
34915
|
|
|
35023
34916
|
const {
|
|
35024
34917
|
InfoTip: InfoTip$3,
|
|
35025
|
-
NumberInput: NumberInput$
|
|
34918
|
+
NumberInput: NumberInput$2,
|
|
35026
34919
|
RangeInput,
|
|
35027
34920
|
TextListEditor: TextListEditor$1
|
|
35028
34921
|
} = components;
|
|
@@ -35251,7 +35144,7 @@ class PlotterEditor extends React.Component {
|
|
|
35251
35144
|
className: "set-from-scale-box"
|
|
35252
35145
|
}, /*#__PURE__*/React.createElement("span", {
|
|
35253
35146
|
className: "categories-title"
|
|
35254
|
-
}, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
35147
|
+
}, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
|
|
35255
35148
|
placeholder: 1,
|
|
35256
35149
|
useArrowKeys: true,
|
|
35257
35150
|
value: this.state.tickStep,
|
|
@@ -35263,7 +35156,7 @@ class PlotterEditor extends React.Component {
|
|
|
35263
35156
|
onChange: this.handleChangeRange
|
|
35264
35157
|
}))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
35265
35158
|
onClick: this.setCategoriesFromScale
|
|
35266
|
-
}, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
35159
|
+
}, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
|
|
35267
35160
|
useArrowKeys: true,
|
|
35268
35161
|
value: this.props.labelInterval,
|
|
35269
35162
|
onChange: this.changeLabelInterval
|
|
@@ -35333,7 +35226,7 @@ PlotterEditor.defaultProps = _extends({}, editorDefaults, {
|
|
|
35333
35226
|
* This editor is for embedding Khan Academy Python programs.
|
|
35334
35227
|
*/
|
|
35335
35228
|
const {
|
|
35336
|
-
NumberInput: NumberInput$
|
|
35229
|
+
NumberInput: NumberInput$1,
|
|
35337
35230
|
TextInput: TextInput$1
|
|
35338
35231
|
} = components;
|
|
35339
35232
|
function validateOptions(height, programID) {
|
|
@@ -35372,7 +35265,7 @@ class PythonProgramEditor extends React.Component {
|
|
|
35372
35265
|
value: this.props.programID,
|
|
35373
35266
|
onChange: this.change("programID"),
|
|
35374
35267
|
placeholder: "123"
|
|
35375
|
-
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$
|
|
35268
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$1, {
|
|
35376
35269
|
value: this.props.height,
|
|
35377
35270
|
onChange: this.change("height"),
|
|
35378
35271
|
placeholder: "400"
|
|
@@ -35386,7 +35279,7 @@ PythonProgramEditor.defaultProps = {
|
|
|
35386
35279
|
};
|
|
35387
35280
|
|
|
35388
35281
|
const {
|
|
35389
|
-
InlineIcon
|
|
35282
|
+
InlineIcon,
|
|
35390
35283
|
PropCheckBox: PropCheckBox$1
|
|
35391
35284
|
} = components;
|
|
35392
35285
|
const {
|
|
@@ -35430,7 +35323,7 @@ class ChoiceEditor extends React.Component {
|
|
|
35430
35323
|
this.props.onDelete();
|
|
35431
35324
|
},
|
|
35432
35325
|
title: "Remove this choice"
|
|
35433
|
-
}, /*#__PURE__*/React.createElement(InlineIcon
|
|
35326
|
+
}, /*#__PURE__*/React.createElement(InlineIcon, iconTrash));
|
|
35434
35327
|
return /*#__PURE__*/React.createElement("div", {
|
|
35435
35328
|
className: "choice-clue-editors"
|
|
35436
35329
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -35634,13 +35527,13 @@ class RadioEditor extends React.Component {
|
|
|
35634
35527
|
// eslint-disable-next-line react/jsx-no-bind
|
|
35635
35528
|
,
|
|
35636
35529
|
onClick: this.addChoice.bind(this, false)
|
|
35637
|
-
}, /*#__PURE__*/React.createElement(InlineIcon
|
|
35530
|
+
}, /*#__PURE__*/React.createElement(InlineIcon, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React.createElement("a", {
|
|
35638
35531
|
className: "simple-button",
|
|
35639
35532
|
href: "#"
|
|
35640
35533
|
// eslint-disable-next-line react/jsx-no-bind
|
|
35641
35534
|
,
|
|
35642
35535
|
onClick: this.addChoice.bind(this, true)
|
|
35643
|
-
}, /*#__PURE__*/React.createElement(InlineIcon
|
|
35536
|
+
}, /*#__PURE__*/React.createElement(InlineIcon, iconPlus), " None of the above", " ")));
|
|
35644
35537
|
}
|
|
35645
35538
|
}
|
|
35646
35539
|
RadioEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
@@ -35791,7 +35684,7 @@ SorterEditor.defaultProps = {
|
|
|
35791
35684
|
/* eslint-disable react/sort-comp */
|
|
35792
35685
|
const {
|
|
35793
35686
|
InfoTip: InfoTip$1,
|
|
35794
|
-
NumberInput
|
|
35687
|
+
NumberInput
|
|
35795
35688
|
} = components;
|
|
35796
35689
|
const Table = TableWidget.widget;
|
|
35797
35690
|
class TableEditor extends React.Component {
|
|
@@ -35856,7 +35749,7 @@ class TableEditor extends React.Component {
|
|
|
35856
35749
|
});
|
|
35857
35750
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
35858
35751
|
className: "perseus-widget-row"
|
|
35859
|
-
}, /*#__PURE__*/React.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React.createElement(NumberInput
|
|
35752
|
+
}, /*#__PURE__*/React.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React.createElement(NumberInput, {
|
|
35860
35753
|
ref: this.numberOfColumns,
|
|
35861
35754
|
value: this.props.columns,
|
|
35862
35755
|
onChange: val => {
|
|
@@ -35867,7 +35760,7 @@ class TableEditor extends React.Component {
|
|
|
35867
35760
|
useArrowKeys: true
|
|
35868
35761
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
35869
35762
|
className: "perseus-widget-row"
|
|
35870
|
-
}, /*#__PURE__*/React.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React.createElement(NumberInput
|
|
35763
|
+
}, /*#__PURE__*/React.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React.createElement(NumberInput
|
|
35871
35764
|
// eslint-disable-next-line react/no-string-refs
|
|
35872
35765
|
, {
|
|
35873
35766
|
ref: "numberOfRows",
|
|
@@ -35902,234 +35795,6 @@ TableEditor.defaultProps = function () {
|
|
|
35902
35795
|
};
|
|
35903
35796
|
}();
|
|
35904
35797
|
|
|
35905
|
-
const {
|
|
35906
|
-
InlineIcon,
|
|
35907
|
-
NumberInput
|
|
35908
|
-
} = components;
|
|
35909
|
-
const {
|
|
35910
|
-
iconOk,
|
|
35911
|
-
iconRemove
|
|
35912
|
-
} = icons;
|
|
35913
|
-
|
|
35914
|
-
// TODO(joel): teach KAS how to accept an answer only if it's expressed in
|
|
35915
|
-
// terms of a certain type.
|
|
35916
|
-
// TODO(joel): Allow sigfigs within a range rather than an exact expected
|
|
35917
|
-
// value?
|
|
35918
|
-
|
|
35919
|
-
const ALL = "all";
|
|
35920
|
-
const SOME = "some";
|
|
35921
|
-
const MAX_SIGFIGS = 10;
|
|
35922
|
-
const sigfigPrint = function sigfigPrint(num, sigfigs) {
|
|
35923
|
-
return displaySigFigs(num, sigfigs, -MAX_SIGFIGS, false);
|
|
35924
|
-
};
|
|
35925
|
-
|
|
35926
|
-
// Extract the primitive units from a unit expression. This first simplifies
|
|
35927
|
-
// `expr` to a `Mul` like "5 kg m / s^2" then removes the first term.
|
|
35928
|
-
const primUnits = function primUnits(expr) {
|
|
35929
|
-
return expr.simplify().asMul().partition()[1].flatten().simplify();
|
|
35930
|
-
};
|
|
35931
|
-
// Show the name of a unit and whether it's recognized by KAS.
|
|
35932
|
-
//
|
|
35933
|
-
// In the future I plan for this to show an example of a thing that would be
|
|
35934
|
-
// accepted in that unit.
|
|
35935
|
-
class UnitExample extends React.Component {
|
|
35936
|
-
constructor(...args) {
|
|
35937
|
-
super(...args);
|
|
35938
|
-
this._checkValidity = ({
|
|
35939
|
-
name,
|
|
35940
|
-
original,
|
|
35941
|
-
sigfigs
|
|
35942
|
-
}) => {
|
|
35943
|
-
const parseResult = KAS.unitParse(name);
|
|
35944
|
-
let solvedExample = "";
|
|
35945
|
-
|
|
35946
|
-
// A unit is valid if it parses and is equivalent to the original.
|
|
35947
|
-
let valid = true;
|
|
35948
|
-
if (parseResult.parsed && original) {
|
|
35949
|
-
const x = new KAS.Var("x");
|
|
35950
|
-
const {
|
|
35951
|
-
unit
|
|
35952
|
-
} = parseResult;
|
|
35953
|
-
const equality = new KAS.Eq(original, "=", new KAS.Mul(x, unit));
|
|
35954
|
-
try {
|
|
35955
|
-
const answer = equality.solveLinearEquationForVariable(x);
|
|
35956
|
-
|
|
35957
|
-
// The third parameter is the least significant decimal place.
|
|
35958
|
-
// I.e. the index of the last place you care about
|
|
35959
|
-
// (543210.(-1)(-2)(-3) etc). We use -10 because that should
|
|
35960
|
-
// always be safe since we only care up to maximum 10 decimal
|
|
35961
|
-
// places.
|
|
35962
|
-
solvedExample = sigfigPrint(answer.eval(), sigfigs);
|
|
35963
|
-
valid = KAS.compare(primUnits(original), primUnits(unit)).equal;
|
|
35964
|
-
} catch (e) {
|
|
35965
|
-
valid = false;
|
|
35966
|
-
}
|
|
35967
|
-
} else {
|
|
35968
|
-
valid = false;
|
|
35969
|
-
}
|
|
35970
|
-
this.setState({
|
|
35971
|
-
valid,
|
|
35972
|
-
solvedExample
|
|
35973
|
-
});
|
|
35974
|
-
};
|
|
35975
|
-
}
|
|
35976
|
-
// TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`
|
|
35977
|
-
UNSAFE_componentWillMount() {
|
|
35978
|
-
// @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; }'.
|
|
35979
|
-
this._checkValidity(this.props);
|
|
35980
|
-
}
|
|
35981
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
35982
|
-
this._checkValidity(nextProps);
|
|
35983
|
-
}
|
|
35984
|
-
render() {
|
|
35985
|
-
let icon;
|
|
35986
|
-
if (this.state.valid) {
|
|
35987
|
-
icon = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
|
|
35988
|
-
className: "unit-example-okay"
|
|
35989
|
-
}, /*#__PURE__*/React.createElement(InlineIcon, iconOk)), this.state.solvedExample);
|
|
35990
|
-
} else {
|
|
35991
|
-
icon = /*#__PURE__*/React.createElement("span", {
|
|
35992
|
-
className: "unit-example-not-okay"
|
|
35993
|
-
}, /*#__PURE__*/React.createElement(InlineIcon, iconRemove));
|
|
35994
|
-
}
|
|
35995
|
-
return /*#__PURE__*/React.createElement("div", null, icon, " ", this.props.name);
|
|
35996
|
-
}
|
|
35997
|
-
}
|
|
35998
|
-
class UnitInputEditor extends React.Component {
|
|
35999
|
-
constructor(_props) {
|
|
36000
|
-
super(_props);
|
|
36001
|
-
this.parsed = void 0;
|
|
36002
|
-
this.groupId = void 0;
|
|
36003
|
-
this.original = void 0;
|
|
36004
|
-
this.change = (...args) => {
|
|
36005
|
-
return Changeable.change.apply(this, args);
|
|
36006
|
-
};
|
|
36007
|
-
this.handleAcceptingUnitsChange = event => {
|
|
36008
|
-
const acceptingUnits = event.target.value.split(",").map(str => str.trim()).filter(str => str !== "");
|
|
36009
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36010
|
-
this.change({
|
|
36011
|
-
acceptingUnits
|
|
36012
|
-
});
|
|
36013
|
-
};
|
|
36014
|
-
this.handleSigfigChange = sigfigs => {
|
|
36015
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36016
|
-
this.change({
|
|
36017
|
-
sigfigs
|
|
36018
|
-
});
|
|
36019
|
-
};
|
|
36020
|
-
this._checkSigfigValidity = sigfigs => {
|
|
36021
|
-
return sigfigs > 0 && sigfigs <= MAX_SIGFIGS;
|
|
36022
|
-
};
|
|
36023
|
-
this._setAccepting = val => {
|
|
36024
|
-
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
36025
|
-
this.change({
|
|
36026
|
-
accepting: val
|
|
36027
|
-
});
|
|
36028
|
-
};
|
|
36029
|
-
this._doOriginal = props => {
|
|
36030
|
-
const tryParse = KAS.unitParse(props.value);
|
|
36031
|
-
this.parsed = false;
|
|
36032
|
-
|
|
36033
|
-
// Only update this state if the unit parsed *and* it has a magnitude
|
|
36034
|
-
// attached to it. KAS can also parse units without magnitudes ("1.2
|
|
36035
|
-
// g" vs "g").
|
|
36036
|
-
if (tryParse.parsed && tryParse.type === "unitMagnitude") {
|
|
36037
|
-
this.original = tryParse.expr;
|
|
36038
|
-
this.parsed = true;
|
|
36039
|
-
}
|
|
36040
|
-
};
|
|
36041
|
-
this.onChange = event => {
|
|
36042
|
-
this.props.onChange({
|
|
36043
|
-
value: event.target.value
|
|
36044
|
-
});
|
|
36045
|
-
};
|
|
36046
|
-
this.getSaveWarnings = () => {
|
|
36047
|
-
const {
|
|
36048
|
-
value,
|
|
36049
|
-
accepting,
|
|
36050
|
-
acceptingUnits
|
|
36051
|
-
} = this.props;
|
|
36052
|
-
const warnings = [];
|
|
36053
|
-
const tryParse = KAS.unitParse(value);
|
|
36054
|
-
if (!tryParse.parsed) {
|
|
36055
|
-
warnings.push("Answer did not parse");
|
|
36056
|
-
}
|
|
36057
|
-
if (accepting === SOME && acceptingUnits.length === 0) {
|
|
36058
|
-
warnings.push("There are no accepted units");
|
|
36059
|
-
}
|
|
36060
|
-
return warnings;
|
|
36061
|
-
};
|
|
36062
|
-
this.serialize = () => {
|
|
36063
|
-
return EditorJsonify.serialize.call(this);
|
|
36064
|
-
};
|
|
36065
|
-
this.groupId = _.uniqueId("accepting");
|
|
36066
|
-
this._doOriginal(_props);
|
|
36067
|
-
}
|
|
36068
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
36069
|
-
this._doOriginal(nextProps);
|
|
36070
|
-
}
|
|
36071
|
-
render() {
|
|
36072
|
-
const {
|
|
36073
|
-
acceptingUnits = [],
|
|
36074
|
-
accepting
|
|
36075
|
-
} = this.props;
|
|
36076
|
-
let acceptingElem = null;
|
|
36077
|
-
if (accepting === SOME) {
|
|
36078
|
-
const unitsArr = acceptingUnits.map((name, i) => /*#__PURE__*/React.createElement(UnitExample, {
|
|
36079
|
-
name: name,
|
|
36080
|
-
original: this.original || null,
|
|
36081
|
-
sigfigs: this.props.sigfigs,
|
|
36082
|
-
key: i
|
|
36083
|
-
}));
|
|
36084
|
-
|
|
36085
|
-
// @ts-expect-error - TS2322 - Type 'Element' is not assignable to type 'null'.
|
|
36086
|
-
acceptingElem = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
36087
|
-
type: "text",
|
|
36088
|
-
defaultValue: acceptingUnits.join(", "),
|
|
36089
|
-
onChange: this.handleAcceptingUnitsChange
|
|
36090
|
-
}), " ", "(comma-separated)", unitsArr);
|
|
36091
|
-
}
|
|
36092
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
36093
|
-
className: "unit-editor"
|
|
36094
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
36095
|
-
value: this.props.value,
|
|
36096
|
-
className: "unit-editor-canonical",
|
|
36097
|
-
onChange: this.onChange
|
|
36098
|
-
}), " ", this.parsed ? /*#__PURE__*/React.createElement("span", {
|
|
36099
|
-
className: "unit-example-okay"
|
|
36100
|
-
}, /*#__PURE__*/React.createElement(InlineIcon, iconOk)) : /*#__PURE__*/React.createElement("span", {
|
|
36101
|
-
className: "unit-example-not-okay"
|
|
36102
|
-
}, /*#__PURE__*/React.createElement(InlineIcon, iconRemove))), /*#__PURE__*/React.createElement("div", null, "Significant Figures:", " ", /*#__PURE__*/React.createElement(NumberInput, {
|
|
36103
|
-
value: this.props.sigfigs,
|
|
36104
|
-
onChange: this.handleSigfigChange,
|
|
36105
|
-
checkValidity: this._checkSigfigValidity,
|
|
36106
|
-
useArrowKeys: true
|
|
36107
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
|
|
36108
|
-
type: "radio",
|
|
36109
|
-
name: this.groupId,
|
|
36110
|
-
onChange: () => this._setAccepting(ALL),
|
|
36111
|
-
checked: this.props.accepting === ALL
|
|
36112
|
-
}), " Any equivalent unit "), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
|
|
36113
|
-
type: "radio",
|
|
36114
|
-
name: this.groupId,
|
|
36115
|
-
onChange: () => this._setAccepting(SOME),
|
|
36116
|
-
checked: this.props.accepting === SOME
|
|
36117
|
-
}), " Only these units ")), acceptingElem);
|
|
36118
|
-
}
|
|
36119
|
-
}
|
|
36120
|
-
UnitInputEditor.propTypes = _extends({}, Changeable.propTypes, {
|
|
36121
|
-
value: PropTypes.string,
|
|
36122
|
-
acceptingUnits: PropTypes.arrayOf(PropTypes.string),
|
|
36123
|
-
accepting: PropTypes.oneOf([ALL, SOME]),
|
|
36124
|
-
sigfigs: PropTypes.number
|
|
36125
|
-
});
|
|
36126
|
-
UnitInputEditor.widgetName = "unit-input";
|
|
36127
|
-
UnitInputEditor.defaultProps = {
|
|
36128
|
-
value: "5x10^5 kg m / s^2",
|
|
36129
|
-
accepting: ALL,
|
|
36130
|
-
sigfigs: 3
|
|
36131
|
-
};
|
|
36132
|
-
|
|
36133
35798
|
const {
|
|
36134
35799
|
InfoTip
|
|
36135
35800
|
} = components;
|
|
@@ -36183,7 +35848,7 @@ VideoEditor.defaultProps = {
|
|
|
36183
35848
|
location: ""
|
|
36184
35849
|
};
|
|
36185
35850
|
|
|
36186
|
-
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,
|
|
35851
|
+
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];
|
|
36187
35852
|
|
|
36188
35853
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
36189
35854
|
class TextInput extends React.Component {
|
|
@@ -36397,5 +36062,5 @@ Widgets.registerWidgets(AllWidgets);
|
|
|
36397
36062
|
Widgets.replaceDeprecatedWidgets();
|
|
36398
36063
|
Widgets.replaceDeprecatedEditors();
|
|
36399
36064
|
|
|
36400
|
-
export { AllEditors, AllWidgets, ArticleDiff, ArticleEditor, DeviceFramer, Editor, EditorPage, IframeContentRenderer, ItemDiff, MultiRendererEditor,
|
|
36065
|
+
export { AllEditors, AllWidgets, ArticleDiff, ArticleEditor, DeviceFramer, Editor, EditorPage, IframeContentRenderer, ItemDiff, MultiRendererEditor, StatefulEditorPage, StructuredItemDiff, ViewportResizer, i18n, libVersion };
|
|
36401
36066
|
//# sourceMappingURL=index.js.map
|