@khanacademy/perseus-editor 11.1.0 → 11.3.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/article-editor.d.ts +2 -2
- package/dist/components/graph-locked-figures/line-stroke-select.d.ts +8 -0
- package/dist/components/graph-locked-figures/locked-figure-select.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings-actions.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-figure-settings.d.ts +2 -2
- package/dist/components/graph-locked-figures/locked-figures-section.d.ts +0 -1
- package/dist/components/graph-locked-figures/locked-function-settings.d.ts +11 -0
- package/dist/components/scrollless-number-text-field.d.ts +21 -0
- package/dist/components/start-coords-angle.d.ts +8 -0
- package/dist/components/start-coords-point.d.ts +8 -0
- package/dist/components/start-coords-quadratic.d.ts +8 -0
- package/dist/components/start-coords-sinusoid.d.ts +8 -0
- package/dist/components/util.d.ts +4 -1
- package/dist/components/widget-editor.d.ts +1 -1
- package/dist/editor.d.ts +2 -2
- package/dist/es/index.css +3 -0
- package/dist/es/index.js +1037 -466
- package/dist/es/index.js.map +1 -1
- package/dist/hint-editor.d.ts +1 -2
- package/dist/index.css +3 -0
- package/dist/index.js +1035 -460
- package/dist/index.js.map +1 -1
- package/dist/item-editor.d.ts +2 -2
- package/dist/widgets/interactive-graph-editor.d.ts +645 -269
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -16,13 +16,13 @@ var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
|
16
16
|
var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
|
|
17
17
|
var caretRight = require('@phosphor-icons/core/bold/caret-right-bold.svg');
|
|
18
18
|
var classNames = require('classnames');
|
|
19
|
+
var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
|
|
19
20
|
var ReactDOM = require('react-dom');
|
|
20
21
|
var kmath = require('@khanacademy/kmath');
|
|
21
22
|
var KAS = require('@khanacademy/kas');
|
|
22
23
|
var wonderStuffCore = require('@khanacademy/wonder-stuff-core');
|
|
23
24
|
var mathInput = require('@khanacademy/math-input');
|
|
24
25
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
25
|
-
var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
|
|
26
26
|
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
27
27
|
var Button = require('@khanacademy/wonder-blocks-button');
|
|
28
28
|
var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
|
|
@@ -83,7 +83,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
|
|
|
83
83
|
|
|
84
84
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
85
85
|
const libName = "@khanacademy/perseus-editor";
|
|
86
|
-
const libVersion = "11.
|
|
86
|
+
const libVersion = "11.3.0";
|
|
87
87
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
88
88
|
|
|
89
89
|
function _extends() {
|
|
@@ -278,13 +278,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
278
278
|
role: "button",
|
|
279
279
|
hideDefaultFocusRing: true,
|
|
280
280
|
"aria-label": title,
|
|
281
|
-
style: styles$
|
|
281
|
+
style: styles$P.button
|
|
282
282
|
}, _ref => {
|
|
283
283
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$a, icon);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const styles$
|
|
287
|
+
const styles$P = aphrodite.StyleSheet.create({
|
|
288
288
|
button: {
|
|
289
289
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
290
290
|
margin: 2,
|
|
@@ -20789,13 +20789,13 @@ class WidgetSelect extends React__namespace.Component {
|
|
|
20789
20789
|
* that collapse a region.
|
|
20790
20790
|
*/
|
|
20791
20791
|
function ToggleableCaret(props) {
|
|
20792
|
-
const iconStyle = props.isExpanded ? styles$
|
|
20792
|
+
const iconStyle = props.isExpanded ? styles$O.expanded : styles$O.collapsed;
|
|
20793
20793
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20794
20794
|
icon: caretRight__default["default"],
|
|
20795
20795
|
style: iconStyle
|
|
20796
20796
|
});
|
|
20797
20797
|
}
|
|
20798
|
-
const styles$
|
|
20798
|
+
const styles$O = aphrodite.StyleSheet.create({
|
|
20799
20799
|
collapsed: {
|
|
20800
20800
|
transition: ".15s"
|
|
20801
20801
|
},
|
|
@@ -20825,16 +20825,16 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20825
20825
|
showErrors
|
|
20826
20826
|
} = this.state;
|
|
20827
20827
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20828
|
-
style: styles$
|
|
20828
|
+
style: styles$N.errorContainer
|
|
20829
20829
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20830
|
-
style: styles$
|
|
20830
|
+
style: styles$N.title,
|
|
20831
20831
|
onClick: this.handleToggleTexErrors
|
|
20832
20832
|
}, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
|
|
20833
20833
|
isExpanded: showErrors
|
|
20834
20834
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20835
|
-
style: styles$
|
|
20835
|
+
style: styles$N.errorExplanation
|
|
20836
20836
|
}, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20837
|
-
style: styles$
|
|
20837
|
+
style: styles$N.error,
|
|
20838
20838
|
key: index
|
|
20839
20839
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20840
20840
|
style: {
|
|
@@ -20843,7 +20843,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20843
20843
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20844
20844
|
}
|
|
20845
20845
|
}
|
|
20846
|
-
const styles$
|
|
20846
|
+
const styles$N = aphrodite.StyleSheet.create({
|
|
20847
20847
|
title: {
|
|
20848
20848
|
backgroundColor: "#eee",
|
|
20849
20849
|
fontSize: "1.25em",
|
|
@@ -23656,12 +23656,10 @@ class CombinedHintsEditor extends React__namespace.Component {
|
|
|
23656
23656
|
};
|
|
23657
23657
|
handleHintChange = (i, newProps, cb, silent) => {
|
|
23658
23658
|
// TODO(joel) - lens
|
|
23659
|
-
const hints =
|
|
23659
|
+
const hints = [...this.props.hints];
|
|
23660
23660
|
hints[i] = ___default["default"].extend({}, this.serializeHint(i, {
|
|
23661
23661
|
keepDeletedWidgets: true
|
|
23662
23662
|
}), newProps);
|
|
23663
|
-
|
|
23664
|
-
// @ts-expect-error - TS2740 - Type 'Hint' is missing the following properties from type 'readonly Hint[]': length, concat, join, slice, and 18 more.
|
|
23665
23663
|
this.props.onChange({
|
|
23666
23664
|
hints: hints
|
|
23667
23665
|
}, cb, silent);
|
|
@@ -23671,21 +23669,16 @@ class CombinedHintsEditor extends React__namespace.Component {
|
|
|
23671
23669
|
if (!confirm("Are you sure you want to delete this hint?")) {
|
|
23672
23670
|
return;
|
|
23673
23671
|
}
|
|
23674
|
-
const hints =
|
|
23675
|
-
// @ts-expect-error - TS2339 - Property 'splice' does not exist on type 'Hint'.
|
|
23672
|
+
const hints = [...this.props.hints];
|
|
23676
23673
|
hints.splice(i, 1);
|
|
23677
|
-
// @ts-expect-error - TS2322 - Type 'Hint' is not assignable to type 'readonly Hint[]'.
|
|
23678
23674
|
this.props.onChange({
|
|
23679
23675
|
hints: hints
|
|
23680
23676
|
});
|
|
23681
23677
|
};
|
|
23682
23678
|
handleHintMove = (i, dir) => {
|
|
23683
|
-
const hints =
|
|
23684
|
-
// @ts-expect-error - TS2339 - Property 'splice' does not exist on type 'Hint'.
|
|
23679
|
+
const hints = [...this.props.hints];
|
|
23685
23680
|
const hint = hints.splice(i, 1)[0];
|
|
23686
|
-
// @ts-expect-error - TS2339 - Property 'splice' does not exist on type 'Hint'.
|
|
23687
23681
|
hints.splice(i + dir, 0, hint);
|
|
23688
|
-
// @ts-expect-error - TS2322 - Type 'Hint' is not assignable to type 'readonly Hint[]'.
|
|
23689
23682
|
this.props.onChange({
|
|
23690
23683
|
hints: hints
|
|
23691
23684
|
}, () => {
|
|
@@ -23695,10 +23688,10 @@ class CombinedHintsEditor extends React__namespace.Component {
|
|
|
23695
23688
|
});
|
|
23696
23689
|
};
|
|
23697
23690
|
addHint = () => {
|
|
23698
|
-
const hints =
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23691
|
+
const hints = this.props.hints.concat([{
|
|
23692
|
+
content: "",
|
|
23693
|
+
images: {},
|
|
23694
|
+
widgets: {}
|
|
23702
23695
|
}]);
|
|
23703
23696
|
this.props.onChange({
|
|
23704
23697
|
hints: hints
|
|
@@ -23821,65 +23814,65 @@ class ItemExtrasEditor extends React__namespace.Component {
|
|
|
23821
23814
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
23822
23815
|
className: "perseus-answer-options"
|
|
23823
23816
|
}, /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23824
|
-
label: "Show calculator
|
|
23817
|
+
label: "Show calculator",
|
|
23825
23818
|
infoTip: "Use the calculator when completing difficult calculations is NOT the intent of the question. DON\u2019T use the calculator when testing the student\u2019s ability to complete different types of computations.",
|
|
23826
23819
|
checked: this.props.calculator,
|
|
23827
|
-
onChange:
|
|
23820
|
+
onChange: newCheckedState => {
|
|
23828
23821
|
this.props.onChange({
|
|
23829
|
-
calculator:
|
|
23822
|
+
calculator: newCheckedState
|
|
23830
23823
|
});
|
|
23831
23824
|
}
|
|
23832
23825
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23833
|
-
label: "Show financial calculator
|
|
23826
|
+
label: "Show financial calculator",
|
|
23834
23827
|
infoTip: "This provides the student with the ability to view a financial calculator, e.g., for answering financial questions. Once checked, requires at least one of the three options below to be checked.",
|
|
23835
23828
|
checked: this.shouldShowFinancialCalculatorOptions(),
|
|
23836
|
-
onChange:
|
|
23829
|
+
onChange: newCheckedState => {
|
|
23837
23830
|
// If the financial calculator is unchecked,
|
|
23838
23831
|
// these need to be reset. All checked by
|
|
23839
23832
|
// default.
|
|
23840
23833
|
this.props.onChange({
|
|
23841
|
-
financialCalculatorMonthlyPayment:
|
|
23842
|
-
financialCalculatorTotalAmount:
|
|
23843
|
-
financialCalculatorTimeToPayOff:
|
|
23834
|
+
financialCalculatorMonthlyPayment: newCheckedState,
|
|
23835
|
+
financialCalculatorTotalAmount: newCheckedState,
|
|
23836
|
+
financialCalculatorTimeToPayOff: newCheckedState
|
|
23844
23837
|
});
|
|
23845
23838
|
}
|
|
23846
23839
|
}), this.shouldShowFinancialCalculatorOptions() && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23847
|
-
label: "Include monthly payment
|
|
23840
|
+
label: "Include monthly payment",
|
|
23848
23841
|
infoTip: "This provides the student with the ability to view a monthly payment calculator; e.g., given a loan amount, interest rate, and term, what is the monthly payment?",
|
|
23849
23842
|
checked: this.props.financialCalculatorMonthlyPayment,
|
|
23850
|
-
onChange:
|
|
23843
|
+
onChange: newCheckedState => {
|
|
23851
23844
|
this.props.onChange({
|
|
23852
|
-
financialCalculatorMonthlyPayment:
|
|
23845
|
+
financialCalculatorMonthlyPayment: newCheckedState
|
|
23853
23846
|
});
|
|
23854
23847
|
},
|
|
23855
23848
|
indent: true
|
|
23856
23849
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23857
|
-
label: "Include total amount
|
|
23850
|
+
label: "Include total amount",
|
|
23858
23851
|
infoTip: "This provides the student with the ability to view a total amount calculator; e.g., given a monthly payment, interest rate, and term, what is the total amount to be paid?",
|
|
23859
23852
|
checked: this.props.financialCalculatorTotalAmount,
|
|
23860
|
-
onChange:
|
|
23853
|
+
onChange: newCheckedState => {
|
|
23861
23854
|
this.props.onChange({
|
|
23862
|
-
financialCalculatorTotalAmount:
|
|
23855
|
+
financialCalculatorTotalAmount: newCheckedState
|
|
23863
23856
|
});
|
|
23864
23857
|
},
|
|
23865
23858
|
indent: true
|
|
23866
23859
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23867
|
-
label: "Include time-to-pay-off
|
|
23860
|
+
label: "Include time-to-pay-off",
|
|
23868
23861
|
infoTip: "This provides the student with the ability to view a time to pay off calculator; e.g., given a loan amount, interest rate, and monthly payment, how long will it take to pay off the loan?",
|
|
23869
23862
|
checked: this.props.financialCalculatorTimeToPayOff,
|
|
23870
|
-
onChange:
|
|
23863
|
+
onChange: newCheckedState => {
|
|
23871
23864
|
this.props.onChange({
|
|
23872
|
-
financialCalculatorTimeToPayOff:
|
|
23865
|
+
financialCalculatorTimeToPayOff: newCheckedState
|
|
23873
23866
|
});
|
|
23874
23867
|
},
|
|
23875
23868
|
indent: true
|
|
23876
23869
|
})), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23877
|
-
label: "Show periodic table
|
|
23870
|
+
label: "Show periodic table",
|
|
23878
23871
|
infoTip: "This provides the student with the ability to view a periodic table of the elements, e.g., for answering chemistry questions.",
|
|
23879
23872
|
checked: this.props.periodicTable,
|
|
23880
|
-
onChange:
|
|
23873
|
+
onChange: newCheckedState => {
|
|
23881
23874
|
this.props.onChange({
|
|
23882
|
-
periodicTable:
|
|
23875
|
+
periodicTable: newCheckedState,
|
|
23883
23876
|
// If the periodic table is unchecked,
|
|
23884
23877
|
// this needs to be reset. If table is
|
|
23885
23878
|
// checked, it should already be false.
|
|
@@ -23887,54 +23880,61 @@ class ItemExtrasEditor extends React__namespace.Component {
|
|
|
23887
23880
|
});
|
|
23888
23881
|
}
|
|
23889
23882
|
}), this.props.periodicTable && /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23890
|
-
label: "Include key/legend with periodic table
|
|
23883
|
+
label: "Include key/legend with periodic table",
|
|
23891
23884
|
infoTip: "Include a key for HS courses; omit for AP chemistry.",
|
|
23892
23885
|
checked: this.props.periodicTableWithKey,
|
|
23893
|
-
onChange:
|
|
23886
|
+
onChange: newCheckedState => {
|
|
23894
23887
|
this.props.onChange({
|
|
23895
|
-
periodicTableWithKey:
|
|
23888
|
+
periodicTableWithKey: newCheckedState
|
|
23896
23889
|
});
|
|
23897
23890
|
},
|
|
23898
23891
|
indent: true
|
|
23899
23892
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23900
|
-
label: "Show z table (statistics)
|
|
23893
|
+
label: "Show z table (statistics)",
|
|
23901
23894
|
infoTip: "This provides the student with the ability to view a table of critical values for the z distribution, e.g. for answering statistics questions.",
|
|
23902
23895
|
checked: this.props.zTable,
|
|
23903
|
-
onChange:
|
|
23896
|
+
onChange: newCheckedState => {
|
|
23904
23897
|
this.props.onChange({
|
|
23905
|
-
zTable:
|
|
23898
|
+
zTable: newCheckedState
|
|
23906
23899
|
});
|
|
23907
23900
|
}
|
|
23908
23901
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23909
|
-
label: "Show t table (statistics)
|
|
23902
|
+
label: "Show t table (statistics)",
|
|
23910
23903
|
infoTip: "This provides the student with the ability to view a table of critical values for the Student's t distribution, e.g. for answering statistics questions.",
|
|
23911
23904
|
checked: this.props.tTable,
|
|
23912
|
-
onChange:
|
|
23905
|
+
onChange: newCheckedState => {
|
|
23913
23906
|
this.props.onChange({
|
|
23914
|
-
tTable:
|
|
23907
|
+
tTable: newCheckedState
|
|
23915
23908
|
});
|
|
23916
23909
|
}
|
|
23917
23910
|
}), /*#__PURE__*/React__namespace.createElement(ItemExtraCheckbox, {
|
|
23918
|
-
label: "Show chi-squared table (statistics)
|
|
23911
|
+
label: "Show chi-squared table (statistics)",
|
|
23919
23912
|
infoTip: "This provides the student with the ability to view a table of critical values for the chi-squared distribution, e.g. for answering statistics questions.",
|
|
23920
23913
|
checked: this.props.chi2Table,
|
|
23921
|
-
onChange:
|
|
23914
|
+
onChange: newCheckedState => {
|
|
23922
23915
|
this.props.onChange({
|
|
23923
|
-
chi2Table:
|
|
23916
|
+
chi2Table: newCheckedState
|
|
23924
23917
|
});
|
|
23925
23918
|
}
|
|
23926
23919
|
})));
|
|
23927
23920
|
}
|
|
23928
23921
|
}
|
|
23929
|
-
const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(
|
|
23930
|
-
style:
|
|
23931
|
-
|
|
23932
|
-
|
|
23933
|
-
|
|
23934
|
-
|
|
23922
|
+
const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
23923
|
+
style: [styles$M.checkbox, props.indent ? styles$M.indented : undefined]
|
|
23924
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
23925
|
+
label: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
23926
|
+
style: {
|
|
23927
|
+
flexDirection: "row"
|
|
23928
|
+
}
|
|
23929
|
+
}, props.label, " ", /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, props.infoTip)),
|
|
23935
23930
|
checked: props.checked,
|
|
23936
|
-
onChange: props.onChange
|
|
23937
|
-
}))
|
|
23931
|
+
onChange: newCheckedState => props.onChange(newCheckedState)
|
|
23932
|
+
}));
|
|
23933
|
+
const styles$M = aphrodite.StyleSheet.create({
|
|
23934
|
+
indented: {
|
|
23935
|
+
marginInlineStart: wonderBlocksTokens.spacing.large_24
|
|
23936
|
+
}
|
|
23937
|
+
});
|
|
23938
23938
|
|
|
23939
23939
|
const ITEM_DATA_VERSION = perseus.itemDataVersion;
|
|
23940
23940
|
class ItemEditor extends React__namespace.Component {
|
|
@@ -24593,12 +24593,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24593
24593
|
...otherProps
|
|
24594
24594
|
} = this.props;
|
|
24595
24595
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24596
|
-
className: aphrodite.css(styles$
|
|
24596
|
+
className: aphrodite.css(styles$L.baseButton, color === "green" && styles$L.green, color === "orange" && styles$L.orange),
|
|
24597
24597
|
onClick: onClick
|
|
24598
24598
|
}, otherProps), children);
|
|
24599
24599
|
}
|
|
24600
24600
|
}
|
|
24601
|
-
const styles$
|
|
24601
|
+
const styles$L = aphrodite.StyleSheet.create({
|
|
24602
24602
|
baseButton: {
|
|
24603
24603
|
top: "0",
|
|
24604
24604
|
fontSize: "11px",
|
|
@@ -24811,23 +24811,23 @@ const LeafContainer = _ref2 => {
|
|
|
24811
24811
|
} = _ref2;
|
|
24812
24812
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24813
24813
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24814
|
-
className: aphrodite.css(styles$
|
|
24814
|
+
className: aphrodite.css(styles$K.containerHeader)
|
|
24815
24815
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24816
24816
|
depth: path.length,
|
|
24817
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$K.containerTitle)
|
|
24818
24818
|
}, capitalize(name)));
|
|
24819
24819
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24820
|
-
className: aphrodite.css(styles$
|
|
24820
|
+
className: aphrodite.css(styles$K.container)
|
|
24821
24821
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24822
|
-
className: aphrodite.css(styles$
|
|
24822
|
+
className: aphrodite.css(styles$K.row, styles$K.rowHeading)
|
|
24823
24823
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24824
|
-
className: aphrodite.css(styles$
|
|
24824
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
24825
24825
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24826
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24826
|
+
className: "pod-title " + aphrodite.css(styles$K.containerHeader)
|
|
24827
24827
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24828
|
-
className: aphrodite.css(styles$
|
|
24828
|
+
className: aphrodite.css(styles$K.containerTitle)
|
|
24829
24829
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24830
|
-
className: aphrodite.css(styles$
|
|
24830
|
+
className: aphrodite.css(styles$K.columnRight)
|
|
24831
24831
|
}, previewHeading)), children);
|
|
24832
24832
|
};
|
|
24833
24833
|
const ArrayContainer = props => {
|
|
@@ -24840,11 +24840,11 @@ const ArrayContainer = props => {
|
|
|
24840
24840
|
actions
|
|
24841
24841
|
} = props;
|
|
24842
24842
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24843
|
-
className: aphrodite.css(styles$
|
|
24843
|
+
className: aphrodite.css(styles$K.container)
|
|
24844
24844
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24845
|
-
className: aphrodite.css(styles$
|
|
24845
|
+
className: aphrodite.css(styles$K.columnLeft, styles$K.containerHeader)
|
|
24846
24846
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24847
|
-
className: aphrodite.css(styles$
|
|
24847
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
24848
24848
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24849
24849
|
href: "javascript:void 0",
|
|
24850
24850
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24858,28 +24858,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24858
24858
|
path
|
|
24859
24859
|
} = _ref3;
|
|
24860
24860
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24861
|
-
className: aphrodite.css(styles$
|
|
24861
|
+
className: aphrodite.css(styles$K.containerHeader)
|
|
24862
24862
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24863
24863
|
depth: path.length,
|
|
24864
|
-
className: aphrodite.css(styles$
|
|
24864
|
+
className: aphrodite.css(styles$K.containerTitle)
|
|
24865
24865
|
}, capitalize(name)), controls);
|
|
24866
24866
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24867
|
-
className: aphrodite.css(styles$
|
|
24867
|
+
className: aphrodite.css(styles$K.containerHeader, styles$K.previewCollectionHeader)
|
|
24868
24868
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24869
24869
|
depth: path.length,
|
|
24870
|
-
className: aphrodite.css(styles$
|
|
24870
|
+
className: aphrodite.css(styles$K.containerTitle)
|
|
24871
24871
|
}, capitalize(name)));
|
|
24872
24872
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24873
24873
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24874
|
-
className: aphrodite.css(styles$
|
|
24874
|
+
className: aphrodite.css(styles$K.container)
|
|
24875
24875
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24876
|
-
className: aphrodite.css(styles$
|
|
24876
|
+
className: aphrodite.css(styles$K.row)
|
|
24877
24877
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24878
|
-
className: aphrodite.css(styles$
|
|
24878
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
24879
24879
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24880
|
-
className: aphrodite.css(styles$
|
|
24880
|
+
className: aphrodite.css(styles$K.columnRight)
|
|
24881
24881
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24882
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24882
|
+
className: aphrodite.css(path.length > 0 && styles$K.contentIndent)
|
|
24883
24883
|
}, children));
|
|
24884
24884
|
};
|
|
24885
24885
|
|
|
@@ -24999,11 +24999,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24999
24999
|
className: "framework-perseus"
|
|
25000
25000
|
}, lens(renderers).get(path));
|
|
25001
25001
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$K.row)
|
|
25003
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
25005
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25006
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$K.sticky)
|
|
25007
25007
|
},
|
|
25008
25008
|
/*#__PURE__*/
|
|
25009
25009
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -25011,9 +25011,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
25011
25011
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25012
25012
|
apiOptions: apiOptions
|
|
25013
25013
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25014
|
-
className: aphrodite.css(styles$
|
|
25014
|
+
className: aphrodite.css(styles$K.columnRight)
|
|
25015
25015
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25016
|
-
className: aphrodite.css(sticky && styles$
|
|
25016
|
+
className: aphrodite.css(sticky && styles$K.sticky)
|
|
25017
25017
|
}, preview))));
|
|
25018
25018
|
});
|
|
25019
25019
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -25029,13 +25029,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25029
25029
|
className: "framework-perseus"
|
|
25030
25030
|
}, lens(renderers).get(path));
|
|
25031
25031
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25032
|
-
className: aphrodite.css(styles$
|
|
25032
|
+
className: aphrodite.css(styles$K.row)
|
|
25033
25033
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25034
|
-
className: aphrodite.css(styles$
|
|
25034
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
25035
25035
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25036
|
-
className: aphrodite.css(sticky && styles$
|
|
25036
|
+
className: aphrodite.css(sticky && styles$K.sticky)
|
|
25037
25037
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25038
|
-
className: aphrodite.css(styles$
|
|
25038
|
+
className: aphrodite.css(styles$K.hintEditor),
|
|
25039
25039
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25040
25040
|
apiOptions: apiOptions,
|
|
25041
25041
|
showTitle: false,
|
|
@@ -25050,9 +25050,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25050
25050
|
isFirst: true,
|
|
25051
25051
|
isLast: true
|
|
25052
25052
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25053
|
-
className: aphrodite.css(styles$
|
|
25053
|
+
className: aphrodite.css(styles$K.columnRight)
|
|
25054
25054
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25055
|
-
className: aphrodite.css(sticky && styles$
|
|
25055
|
+
className: aphrodite.css(sticky && styles$K.sticky)
|
|
25056
25056
|
}, preview)));
|
|
25057
25057
|
});
|
|
25058
25058
|
const TagsNodeContent = props => {
|
|
@@ -25069,9 +25069,9 @@ const TagsNodeContent = props => {
|
|
|
25069
25069
|
return null;
|
|
25070
25070
|
}
|
|
25071
25071
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25072
|
-
className: aphrodite.css(styles$
|
|
25072
|
+
className: aphrodite.css(styles$K.columnLeft)
|
|
25073
25073
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
|
-
className: aphrodite.css(styles$
|
|
25074
|
+
className: aphrodite.css(styles$K.tagsEditor)
|
|
25075
25075
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25076
25076
|
value: data,
|
|
25077
25077
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25102,23 +25102,23 @@ const ArrayNodeContent = props => {
|
|
|
25102
25102
|
const subpath = path.concat(i);
|
|
25103
25103
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25104
25104
|
key: "moveArrayElementUp",
|
|
25105
|
-
className: aphrodite.css(styles$
|
|
25105
|
+
className: aphrodite.css(styles$K.control)
|
|
25106
25106
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25107
25107
|
color: "orange",
|
|
25108
25108
|
title: "Move up",
|
|
25109
25109
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25110
25110
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25111
|
-
className: aphrodite.css(styles$
|
|
25111
|
+
className: aphrodite.css(styles$K.verticalFlip)
|
|
25112
25112
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25113
25113
|
key: "moveArrayElementDown",
|
|
25114
|
-
className: aphrodite.css(styles$
|
|
25114
|
+
className: aphrodite.css(styles$K.control)
|
|
25115
25115
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25116
25116
|
color: "orange",
|
|
25117
25117
|
title: "Move down",
|
|
25118
25118
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25119
25119
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25120
25120
|
key: "removeArrayElement",
|
|
25121
|
-
className: aphrodite.css(styles$
|
|
25121
|
+
className: aphrodite.css(styles$K.control)
|
|
25122
25122
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25123
25123
|
color: "orange",
|
|
25124
25124
|
title: "Delete",
|
|
@@ -25126,7 +25126,7 @@ const ArrayNodeContent = props => {
|
|
|
25126
25126
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$4)))];
|
|
25127
25127
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25128
25128
|
key: i,
|
|
25129
|
-
className: aphrodite.css(styles$
|
|
25129
|
+
className: aphrodite.css(styles$K.arrayElement, !elementIsLeaf && styles$K.arrayElementAndNotLeaf)
|
|
25130
25130
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25131
25131
|
key: i,
|
|
25132
25132
|
shape: shape.elementShape,
|
|
@@ -25152,7 +25152,7 @@ const ObjectNodeContent = props => {
|
|
|
25152
25152
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25153
25153
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25154
25154
|
key: subkey,
|
|
25155
|
-
className: aphrodite.css(styles$
|
|
25155
|
+
className: aphrodite.css(styles$K.objectElement)
|
|
25156
25156
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25157
25157
|
shape: shape.shape[subkey],
|
|
25158
25158
|
data: data[subkey],
|
|
@@ -25322,7 +25322,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25322
25322
|
}, this._renderContent());
|
|
25323
25323
|
}
|
|
25324
25324
|
}
|
|
25325
|
-
const styles$
|
|
25325
|
+
const styles$K = aphrodite.StyleSheet.create({
|
|
25326
25326
|
// This is used in a number of places throughout this file.
|
|
25327
25327
|
container: {},
|
|
25328
25328
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25486,7 +25486,6 @@ const StatefulEditorPage = createReactClass__default["default"]({
|
|
|
25486
25486
|
});
|
|
25487
25487
|
|
|
25488
25488
|
const {
|
|
25489
|
-
PropCheckBox: PropCheckBox$c,
|
|
25490
25489
|
TextListEditor: TextListEditor$4
|
|
25491
25490
|
} = perseus.components;
|
|
25492
25491
|
const Categorizer = perseus.Categorizer.widget;
|
|
@@ -25521,11 +25520,14 @@ class CategorizerEditor extends React__namespace.Component {
|
|
|
25521
25520
|
render() {
|
|
25522
25521
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25523
25522
|
className: "perseus-widget-row"
|
|
25524
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
25523
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
25525
25524
|
label: "Randomize item order",
|
|
25526
|
-
|
|
25527
|
-
|
|
25528
|
-
|
|
25525
|
+
checked: this.props.randomizeItems,
|
|
25526
|
+
onChange: value => {
|
|
25527
|
+
this.props.onChange({
|
|
25528
|
+
randomizeItems: value
|
|
25529
|
+
});
|
|
25530
|
+
}
|
|
25529
25531
|
})), "Categories:", /*#__PURE__*/React__namespace.createElement(TextListEditor$4, {
|
|
25530
25532
|
options: this.props.categories,
|
|
25531
25533
|
onChange: cat => {
|
|
@@ -25619,8 +25621,7 @@ class BlurInput extends React__namespace.Component {
|
|
|
25619
25621
|
|
|
25620
25622
|
/* eslint-disable no-useless-escape */
|
|
25621
25623
|
const {
|
|
25622
|
-
InfoTip: InfoTip$k
|
|
25623
|
-
PropCheckBox: PropCheckBox$b
|
|
25624
|
+
InfoTip: InfoTip$k
|
|
25624
25625
|
} = perseus.components;
|
|
25625
25626
|
const DEFAULT_WIDTH = 400;
|
|
25626
25627
|
const DEFAULT_HEIGHT = 400;
|
|
@@ -25803,14 +25804,22 @@ class CSProgramEditor extends React__namespace.Component {
|
|
|
25803
25804
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Url or Program ID:", " ", /*#__PURE__*/React__namespace.createElement(BlurInput, {
|
|
25804
25805
|
value: this.props.programID,
|
|
25805
25806
|
onChange: this._handleProgramIDChange
|
|
25806
|
-
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(
|
|
25807
|
+
})), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
25807
25808
|
label: "Show Editor",
|
|
25808
|
-
|
|
25809
|
-
onChange:
|
|
25810
|
-
|
|
25809
|
+
checked: this.props.showEditor,
|
|
25810
|
+
onChange: value => {
|
|
25811
|
+
this.props.onChange({
|
|
25812
|
+
showEditor: value
|
|
25813
|
+
});
|
|
25814
|
+
}
|
|
25815
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
25811
25816
|
label: "Show Buttons",
|
|
25812
|
-
|
|
25813
|
-
onChange:
|
|
25817
|
+
checked: this.props.showButtons,
|
|
25818
|
+
onChange: value => {
|
|
25819
|
+
this.props.onChange({
|
|
25820
|
+
showButtons: value
|
|
25821
|
+
});
|
|
25822
|
+
}
|
|
25814
25823
|
}), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("label", null, "Settings:", /*#__PURE__*/React__namespace.createElement(PairsEditor$1, {
|
|
25815
25824
|
name: "settings",
|
|
25816
25825
|
pairs: this.props.settings,
|
|
@@ -26515,7 +26524,6 @@ const SortableItem = createReactClass__default["default"]({
|
|
|
26515
26524
|
|
|
26516
26525
|
const {
|
|
26517
26526
|
InfoTip: InfoTip$i,
|
|
26518
|
-
PropCheckBox: PropCheckBox$a,
|
|
26519
26527
|
TextInput: TextInput$7
|
|
26520
26528
|
} = perseus.components;
|
|
26521
26529
|
|
|
@@ -26649,11 +26657,14 @@ class ExpressionEditor extends React__namespace.Component {
|
|
|
26649
26657
|
})), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React__namespace.createElement("a", {
|
|
26650
26658
|
href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
|
|
26651
26659
|
target: "_blank"
|
|
26652
|
-
}, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(
|
|
26653
|
-
|
|
26654
|
-
|
|
26655
|
-
|
|
26656
|
-
|
|
26660
|
+
}, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
26661
|
+
label: "Use \xD7 for rendering multiplication instead of a center dot.",
|
|
26662
|
+
checked: this.props.times,
|
|
26663
|
+
onChange: value => {
|
|
26664
|
+
this.props.onChange({
|
|
26665
|
+
times: value
|
|
26666
|
+
});
|
|
26667
|
+
}
|
|
26657
26668
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Function variables: ", /*#__PURE__*/React__namespace.createElement("input", {
|
|
26658
26669
|
type: "text",
|
|
26659
26670
|
defaultValue: this.props.functions.join(" "),
|
|
@@ -26867,18 +26878,24 @@ class AnswerOption extends React__namespace.Component {
|
|
|
26867
26878
|
className: "answer-expression"
|
|
26868
26879
|
}, /*#__PURE__*/React__namespace.createElement(perseus.Expression, this.props.expressionProps))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26869
26880
|
className: "answer-option"
|
|
26870
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
26871
|
-
|
|
26872
|
-
|
|
26873
|
-
|
|
26874
|
-
|
|
26881
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
26882
|
+
label: "Answer expression must have the same form.",
|
|
26883
|
+
checked: this.props.form,
|
|
26884
|
+
onChange: value => {
|
|
26885
|
+
this.props.onChange({
|
|
26886
|
+
form: value
|
|
26887
|
+
});
|
|
26888
|
+
}
|
|
26875
26889
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26876
26890
|
className: "answer-option"
|
|
26877
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
26878
|
-
|
|
26879
|
-
|
|
26880
|
-
|
|
26881
|
-
|
|
26891
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
26892
|
+
label: "Answer expression must be fully expanded and simplified.",
|
|
26893
|
+
checked: this.props.simplify,
|
|
26894
|
+
onChange: value => {
|
|
26895
|
+
this.props.onChange({
|
|
26896
|
+
simplify: value
|
|
26897
|
+
});
|
|
26898
|
+
}
|
|
26882
26899
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
26883
26900
|
className: "remove-container"
|
|
26884
26901
|
}, removeButton)));
|
|
@@ -26957,10 +26974,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26957
26974
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26958
26975
|
className: "perseus-widget-row"
|
|
26959
26976
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
26960
|
-
className: aphrodite.css(styles$
|
|
26977
|
+
className: aphrodite.css(styles$J.title)
|
|
26961
26978
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
26962
26979
|
value: this.props.title,
|
|
26963
|
-
className: aphrodite.css(styles$
|
|
26980
|
+
className: aphrodite.css(styles$J.input)
|
|
26964
26981
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
26965
26982
|
,
|
|
26966
26983
|
onChange: this.change("title")
|
|
@@ -26985,7 +27002,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
26985
27002
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
26986
27003
|
className: "perseus-hint-editor"
|
|
26987
27004
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26988
|
-
className: aphrodite.css(styles$
|
|
27005
|
+
className: aphrodite.css(styles$J.hintsTitle)
|
|
26989
27006
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
26990
27007
|
ref: this.hintEditor,
|
|
26991
27008
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27017,7 +27034,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27017
27034
|
};
|
|
27018
27035
|
};
|
|
27019
27036
|
}
|
|
27020
|
-
const styles$
|
|
27037
|
+
const styles$J = aphrodite.StyleSheet.create({
|
|
27021
27038
|
title: {
|
|
27022
27039
|
fontSize: 18,
|
|
27023
27040
|
fontWeight: "bold"
|
|
@@ -27105,7 +27122,6 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
|
|
|
27105
27122
|
const {
|
|
27106
27123
|
ButtonGroup: ButtonGroup$4,
|
|
27107
27124
|
InfoTip: InfoTip$h,
|
|
27108
|
-
PropCheckBox: PropCheckBox$9,
|
|
27109
27125
|
RangeInput: RangeInput$6
|
|
27110
27126
|
} = perseus.components;
|
|
27111
27127
|
const defaultBackgroundImage$3 = {
|
|
@@ -27540,10 +27556,14 @@ const GraphSettings = createReactClass__default["default"]({
|
|
|
27540
27556
|
onChange: this.change("markings")
|
|
27541
27557
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
27542
27558
|
className: "perseus-widget-left-col"
|
|
27543
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
27559
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
27544
27560
|
label: "Show tooltips",
|
|
27545
|
-
|
|
27546
|
-
onChange:
|
|
27561
|
+
checked: this.props.showTooltips,
|
|
27562
|
+
onChange: value => {
|
|
27563
|
+
this.change({
|
|
27564
|
+
showTooltips: value
|
|
27565
|
+
});
|
|
27566
|
+
}
|
|
27547
27567
|
}))), ___default["default"].contains(this.props.editableSettings, "image") && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27548
27568
|
className: "image-settings"
|
|
27549
27569
|
}, /*#__PURE__*/React__namespace.createElement("div", null, "Background image:"), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", {
|
|
@@ -27571,16 +27591,24 @@ const GraphSettings = createReactClass__default["default"]({
|
|
|
27571
27591
|
className: "perseus-widget-row"
|
|
27572
27592
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27573
27593
|
className: "perseus-widget-left-col"
|
|
27574
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
27594
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
27575
27595
|
label: "Show ruler",
|
|
27576
|
-
|
|
27577
|
-
onChange:
|
|
27596
|
+
checked: this.props.showRuler,
|
|
27597
|
+
onChange: value => {
|
|
27598
|
+
this.change({
|
|
27599
|
+
showRuler: value
|
|
27600
|
+
});
|
|
27601
|
+
}
|
|
27578
27602
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
27579
27603
|
className: "perseus-widget-right-col"
|
|
27580
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
27604
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
27581
27605
|
label: "Show protractor",
|
|
27582
|
-
|
|
27583
|
-
onChange:
|
|
27606
|
+
checked: this.props.showProtractor,
|
|
27607
|
+
onChange: value => {
|
|
27608
|
+
this.change({
|
|
27609
|
+
showProtractor: value
|
|
27610
|
+
});
|
|
27611
|
+
}
|
|
27584
27612
|
}))), this.props.showRuler && /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, " ", "Ruler label:", " ", /*#__PURE__*/React__namespace.createElement("select", {
|
|
27585
27613
|
onChange: this.changeRulerLabel,
|
|
27586
27614
|
value: this.props.rulerLabel
|
|
@@ -27788,9 +27816,6 @@ class GroupEditor extends React__namespace.Component {
|
|
|
27788
27816
|
}
|
|
27789
27817
|
|
|
27790
27818
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
27791
|
-
const {
|
|
27792
|
-
PropCheckBox: PropCheckBox$8
|
|
27793
|
-
} = perseus.components;
|
|
27794
27819
|
/**
|
|
27795
27820
|
* This is used for editing a name/value pair.
|
|
27796
27821
|
*/
|
|
@@ -27929,14 +27954,22 @@ class IframeEditor extends React__namespace.Component {
|
|
|
27929
27954
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27930
27955
|
,
|
|
27931
27956
|
onChange: this.change("height")
|
|
27932
|
-
})), /*#__PURE__*/React__namespace.createElement(
|
|
27957
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
27933
27958
|
label: "Allow full screen",
|
|
27934
|
-
|
|
27935
|
-
onChange:
|
|
27936
|
-
|
|
27959
|
+
checked: this.props.allowFullScreen,
|
|
27960
|
+
onChange: value => {
|
|
27961
|
+
this.props.onChange({
|
|
27962
|
+
allowFullScreen: value
|
|
27963
|
+
});
|
|
27964
|
+
}
|
|
27965
|
+
}), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
27937
27966
|
label: "Allow iframe content to redirect the page",
|
|
27938
|
-
|
|
27939
|
-
onChange:
|
|
27967
|
+
checked: this.props.allowTopNavigation,
|
|
27968
|
+
onChange: value => {
|
|
27969
|
+
this.props.onChange({
|
|
27970
|
+
allowTopNavigation: value
|
|
27971
|
+
});
|
|
27972
|
+
}
|
|
27940
27973
|
}));
|
|
27941
27974
|
}
|
|
27942
27975
|
handleSettingsChange = settings => {
|
|
@@ -28388,13 +28421,13 @@ function MathquillInput(props) {
|
|
|
28388
28421
|
}
|
|
28389
28422
|
});
|
|
28390
28423
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28391
|
-
style: styles$
|
|
28424
|
+
style: styles$I.outerWrapper
|
|
28392
28425
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28393
28426
|
ref: mathFieldWrapperRef,
|
|
28394
28427
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28395
28428
|
}));
|
|
28396
28429
|
}
|
|
28397
|
-
const styles$
|
|
28430
|
+
const styles$I = aphrodite.StyleSheet.create({
|
|
28398
28431
|
outerWrapper: {
|
|
28399
28432
|
display: "inline-block",
|
|
28400
28433
|
borderStyle: "solid",
|
|
@@ -29464,16 +29497,16 @@ const LabeledRow = props => {
|
|
|
29464
29497
|
style
|
|
29465
29498
|
} = props;
|
|
29466
29499
|
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29467
|
-
className: aphrodite.css(styles$
|
|
29500
|
+
className: aphrodite.css(styles$H.label)
|
|
29468
29501
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29469
|
-
style: [styles$
|
|
29502
|
+
style: [styles$H.row, style]
|
|
29470
29503
|
}, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29471
|
-
style: styles$
|
|
29504
|
+
style: styles$H.spaceEnd
|
|
29472
29505
|
}, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29473
|
-
style: styles$
|
|
29506
|
+
style: styles$H.spaceStart
|
|
29474
29507
|
}, label)));
|
|
29475
29508
|
};
|
|
29476
|
-
const styles$
|
|
29509
|
+
const styles$H = aphrodite.StyleSheet.create({
|
|
29477
29510
|
label: {
|
|
29478
29511
|
width: "fit-content"
|
|
29479
29512
|
},
|
|
@@ -29550,11 +29583,11 @@ class Spring extends React__namespace.Component {
|
|
|
29550
29583
|
} = this.props;
|
|
29551
29584
|
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
29552
29585
|
"aria-hidden": "true",
|
|
29553
|
-
style: [styles$
|
|
29586
|
+
style: [styles$G.grow, style]
|
|
29554
29587
|
});
|
|
29555
29588
|
}
|
|
29556
29589
|
}
|
|
29557
|
-
const styles$
|
|
29590
|
+
const styles$G = aphrodite.StyleSheet.create({
|
|
29558
29591
|
grow: {
|
|
29559
29592
|
flexGrow: 1
|
|
29560
29593
|
}
|
|
@@ -29591,11 +29624,11 @@ function Heading(_ref) {
|
|
|
29591
29624
|
onToggle
|
|
29592
29625
|
} = _ref;
|
|
29593
29626
|
return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
29594
|
-
style: [styles$
|
|
29627
|
+
style: [styles$F.container, !isCollapsible && styles$F.notClickable],
|
|
29595
29628
|
disabled: !isCollapsible,
|
|
29596
29629
|
onClick: () => isCollapsible && onToggle?.(!isOpen)
|
|
29597
29630
|
}, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29598
|
-
style: styles$
|
|
29631
|
+
style: styles$F.heading
|
|
29599
29632
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
|
|
29600
29633
|
style: {
|
|
29601
29634
|
fontSize: 14,
|
|
@@ -29605,7 +29638,7 @@ function Heading(_ref) {
|
|
|
29605
29638
|
isExpanded: isOpen
|
|
29606
29639
|
})));
|
|
29607
29640
|
}
|
|
29608
|
-
const styles$
|
|
29641
|
+
const styles$F = aphrodite.StyleSheet.create({
|
|
29609
29642
|
container: {
|
|
29610
29643
|
marginTop: wonderBlocksTokens.spacing.small_12,
|
|
29611
29644
|
// NOTE(jeremy): This is the inverse of the @editorPadding CSS
|
|
@@ -29763,10 +29796,95 @@ function getDefaultGraphStartCoords(graph, range, step) {
|
|
|
29763
29796
|
center: startCoords.center,
|
|
29764
29797
|
radius
|
|
29765
29798
|
};
|
|
29799
|
+
case "sinusoid":
|
|
29800
|
+
return perseus.getSinusoidCoords({
|
|
29801
|
+
...graph,
|
|
29802
|
+
startCoords: undefined
|
|
29803
|
+
}, range, step);
|
|
29804
|
+
case "quadratic":
|
|
29805
|
+
return perseus.getQuadraticCoords({
|
|
29806
|
+
...graph,
|
|
29807
|
+
startCoords: undefined
|
|
29808
|
+
}, range, step);
|
|
29809
|
+
case "point":
|
|
29810
|
+
return perseus.getPointCoords({
|
|
29811
|
+
...graph,
|
|
29812
|
+
startCoords: undefined
|
|
29813
|
+
}, range, step);
|
|
29814
|
+
case "polygon":
|
|
29815
|
+
return perseus.getPolygonCoords({
|
|
29816
|
+
...graph,
|
|
29817
|
+
startCoords: undefined
|
|
29818
|
+
}, range, step);
|
|
29819
|
+
case "angle":
|
|
29820
|
+
return perseus.getAngleCoords({
|
|
29821
|
+
graph: {
|
|
29822
|
+
...graph,
|
|
29823
|
+
startCoords: undefined
|
|
29824
|
+
},
|
|
29825
|
+
range,
|
|
29826
|
+
step
|
|
29827
|
+
});
|
|
29766
29828
|
default:
|
|
29767
29829
|
return undefined;
|
|
29768
29830
|
}
|
|
29769
29831
|
}
|
|
29832
|
+
const getSinusoidEquation = startCoords => {
|
|
29833
|
+
// Get coefficients
|
|
29834
|
+
// It's assumed that p1 is the root and p2 is the first peak
|
|
29835
|
+
const p1 = startCoords[0];
|
|
29836
|
+
const p2 = startCoords[1];
|
|
29837
|
+
|
|
29838
|
+
// Resulting coefficients are canonical for this sine curve
|
|
29839
|
+
const amplitude = p2[1] - p1[1];
|
|
29840
|
+
const angularFrequency = Math.PI / (2 * (p2[0] - p1[0]));
|
|
29841
|
+
const phase = p1[0] * angularFrequency;
|
|
29842
|
+
const verticalOffset = p1[1];
|
|
29843
|
+
return "y = " + amplitude.toFixed(3) + "sin(" + angularFrequency.toFixed(3) + "x - " + phase.toFixed(3) + ") + " + verticalOffset.toFixed(3);
|
|
29844
|
+
};
|
|
29845
|
+
const getQuadraticEquation = startCoords => {
|
|
29846
|
+
const p1 = startCoords[0];
|
|
29847
|
+
const p2 = startCoords[1];
|
|
29848
|
+
const p3 = startCoords[2];
|
|
29849
|
+
const denom = (p1[0] - p2[0]) * (p1[0] - p3[0]) * (p2[0] - p3[0]);
|
|
29850
|
+
if (denom === 0) {
|
|
29851
|
+
// Many of the callers assume that the return value is always defined.
|
|
29852
|
+
return "Division by zero error";
|
|
29853
|
+
}
|
|
29854
|
+
const a = (p3[0] * (p2[1] - p1[1]) + p2[0] * (p1[1] - p3[1]) + p1[0] * (p3[1] - p2[1])) / denom;
|
|
29855
|
+
const b = (p3[0] * p3[0] * (p1[1] - p2[1]) + p2[0] * p2[0] * (p3[1] - p1[1]) + p1[0] * p1[0] * (p2[1] - p3[1])) / denom;
|
|
29856
|
+
const c = (p2[0] * p3[0] * (p2[0] - p3[0]) * p1[1] + p3[0] * p1[0] * (p3[0] - p1[0]) * p2[1] + p1[0] * p2[0] * (p1[0] - p2[0]) * p3[1]) / denom;
|
|
29857
|
+
return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
|
|
29858
|
+
};
|
|
29859
|
+
const shouldShowStartCoordsUI = (flags, graph) => {
|
|
29860
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
29861
|
+
const startCoordsUiPhase1Types = ["linear", "linear-system", "ray", "segment", "circle"];
|
|
29862
|
+
const startCoordsUiPhase2Types = ["sinusoid", "quadratic"];
|
|
29863
|
+
const startCoordsPhase1 = flags?.mafs?.["start-coords-ui-phase-1"];
|
|
29864
|
+
const startCoordsPhase2 = flags?.mafs?.["start-coords-ui-phase-2"];
|
|
29865
|
+
const startCoordsPoint = flags?.mafs?.["start-coords-ui-point"];
|
|
29866
|
+
const startCoordsPolygon = flags?.mafs?.["start-coords-ui-polygon"];
|
|
29867
|
+
const startCoordsAngle = flags?.mafs?.["start-coords-ui-angle"];
|
|
29868
|
+
if (startCoordsPhase1 && startCoordsUiPhase1Types.includes(graph.type)) {
|
|
29869
|
+
return true;
|
|
29870
|
+
}
|
|
29871
|
+
if (startCoordsPhase2 && startCoordsUiPhase2Types.includes(graph.type)) {
|
|
29872
|
+
return true;
|
|
29873
|
+
}
|
|
29874
|
+
if (startCoordsAngle && graph.type === "angle") {
|
|
29875
|
+
return true;
|
|
29876
|
+
}
|
|
29877
|
+
if (startCoordsPoint && graph.type === "point" && graph.numPoints !== "unlimited") {
|
|
29878
|
+
return true;
|
|
29879
|
+
}
|
|
29880
|
+
if (startCoordsPolygon && graph.type === "polygon" && graph.numSides !== "unlimited" && (
|
|
29881
|
+
// Pre-initialized graph with undefined snapTo value
|
|
29882
|
+
// initializes to snapTo="grid"
|
|
29883
|
+
graph.snapTo === "grid" || graph.snapTo === undefined)) {
|
|
29884
|
+
return true;
|
|
29885
|
+
}
|
|
29886
|
+
return false;
|
|
29887
|
+
};
|
|
29770
29888
|
|
|
29771
29889
|
/**
|
|
29772
29890
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29780,19 +29898,20 @@ const LockedFigureSelect = props => {
|
|
|
29780
29898
|
id,
|
|
29781
29899
|
onChange
|
|
29782
29900
|
} = props;
|
|
29783
|
-
const figureTypes =
|
|
29901
|
+
const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
|
|
29902
|
+
const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
|
|
29784
29903
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29785
|
-
style: styles$
|
|
29904
|
+
style: styles$E.container
|
|
29786
29905
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29787
29906
|
menuText: "Add locked figure",
|
|
29788
|
-
style: styles$
|
|
29789
|
-
},
|
|
29907
|
+
style: styles$E.addElementSelect
|
|
29908
|
+
}, figureTypesCurrent.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29790
29909
|
key: `${id}-${figureType}`,
|
|
29791
29910
|
label: figureType,
|
|
29792
29911
|
onClick: () => onChange(figureType)
|
|
29793
29912
|
}))));
|
|
29794
29913
|
};
|
|
29795
|
-
const styles$
|
|
29914
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
29796
29915
|
container: {
|
|
29797
29916
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29798
29917
|
},
|
|
@@ -29802,6 +29921,45 @@ const styles$z = aphrodite.StyleSheet.create({
|
|
|
29802
29921
|
}
|
|
29803
29922
|
});
|
|
29804
29923
|
|
|
29924
|
+
/**
|
|
29925
|
+
* This is a custom text field of type="number" for use in Perseus Editors.
|
|
29926
|
+
*
|
|
29927
|
+
* This makes it so that the text field's input number updates on scroll
|
|
29928
|
+
* without scrolling the page.
|
|
29929
|
+
*
|
|
29930
|
+
* NOTE 1: Native HTML number inputs do not update the number value on scroll,
|
|
29931
|
+
* they only scroll the page. Inputs in React do NOT work this way (explanation
|
|
29932
|
+
* here: https://stackoverflow.com/a/68266494). By default, scrolling on a
|
|
29933
|
+
* focused number input in React causes BOTH the input value to change AND
|
|
29934
|
+
* the page to scroll. The behavior in this component is an improvement on
|
|
29935
|
+
* the React behavior, but it's the opposite of the native HTML behavior.
|
|
29936
|
+
*
|
|
29937
|
+
* NOTE 2: Firefox seems to have a custom override for this. Even with this
|
|
29938
|
+
* stopPropogation, Firefox matches the native HTML behavior.
|
|
29939
|
+
*/
|
|
29940
|
+
const ScrolllessNumberTextField = props => {
|
|
29941
|
+
const inputRef = React__namespace.useRef(null);
|
|
29942
|
+
React__namespace.useEffect(() => {
|
|
29943
|
+
const ref = inputRef.current;
|
|
29944
|
+
|
|
29945
|
+
// stopPropogation makes it so that the page scroll event is not
|
|
29946
|
+
// triggered when the input is focused and the user scrolls.
|
|
29947
|
+
// The input value will still change on scroll.
|
|
29948
|
+
const ignoreScroll = e => {
|
|
29949
|
+
e.stopPropagation();
|
|
29950
|
+
};
|
|
29951
|
+
ref?.addEventListener("wheel", ignoreScroll);
|
|
29952
|
+
return () => {
|
|
29953
|
+
ref?.removeEventListener("wheel", ignoreScroll);
|
|
29954
|
+
};
|
|
29955
|
+
}, [inputRef]);
|
|
29956
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, _extends({
|
|
29957
|
+
type: "number"
|
|
29958
|
+
}, props, {
|
|
29959
|
+
ref: inputRef
|
|
29960
|
+
}));
|
|
29961
|
+
};
|
|
29962
|
+
|
|
29805
29963
|
const AngleInput = props => {
|
|
29806
29964
|
const {
|
|
29807
29965
|
angle,
|
|
@@ -29823,19 +29981,18 @@ const AngleInput = props => {
|
|
|
29823
29981
|
}
|
|
29824
29982
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29825
29983
|
tag: "label",
|
|
29826
|
-
style: styles$
|
|
29984
|
+
style: styles$D.row
|
|
29827
29985
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29828
29986
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29829
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29830
|
-
type: "number",
|
|
29987
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29831
29988
|
value: angleInput,
|
|
29832
29989
|
onChange: handleAngleChange,
|
|
29833
|
-
style: styles$
|
|
29990
|
+
style: styles$D.textField
|
|
29834
29991
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29835
29992
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29836
29993
|
}));
|
|
29837
29994
|
};
|
|
29838
|
-
const styles$
|
|
29995
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
29839
29996
|
row: {
|
|
29840
29997
|
display: "flex",
|
|
29841
29998
|
flexDirection: "row",
|
|
@@ -29884,32 +30041,30 @@ const CoordinatePairInput = props => {
|
|
|
29884
30041
|
onChange(newCoords);
|
|
29885
30042
|
}
|
|
29886
30043
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29887
|
-
style: [styles$
|
|
30044
|
+
style: [styles$C.row, style]
|
|
29888
30045
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29889
30046
|
tag: "label",
|
|
29890
|
-
style: styles$
|
|
30047
|
+
style: styles$C.row
|
|
29891
30048
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29892
30049
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29893
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29894
|
-
type: "number",
|
|
30050
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29895
30051
|
value: coordState[0],
|
|
29896
30052
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29897
|
-
style: [styles$
|
|
30053
|
+
style: [styles$C.textField, error ? styles$C.errorField : undefined]
|
|
29898
30054
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29899
30055
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29900
30056
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29901
30057
|
tag: "label",
|
|
29902
|
-
style: styles$
|
|
30058
|
+
style: styles$C.row
|
|
29903
30059
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29904
30060
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29905
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29906
|
-
type: "number",
|
|
30061
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29907
30062
|
value: coordState[1],
|
|
29908
30063
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29909
|
-
style: [styles$
|
|
30064
|
+
style: [styles$C.textField, error ? styles$C.errorField : undefined]
|
|
29910
30065
|
})));
|
|
29911
30066
|
};
|
|
29912
|
-
const styles$
|
|
30067
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
29913
30068
|
row: {
|
|
29914
30069
|
display: "flex",
|
|
29915
30070
|
flexDirection: "row",
|
|
@@ -29942,14 +30097,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29942
30097
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29943
30098
|
expanded: expanded,
|
|
29944
30099
|
onToggle: onToggle,
|
|
29945
|
-
style: [styles$
|
|
29946
|
-
headerStyle: styles$
|
|
30100
|
+
style: [styles$B.container, containerStyle],
|
|
30101
|
+
headerStyle: styles$B.accordionHeader,
|
|
29947
30102
|
header: header
|
|
29948
30103
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29949
|
-
style: [styles$
|
|
30104
|
+
style: [styles$B.accordionPanel, panelStyle]
|
|
29950
30105
|
}, children)));
|
|
29951
30106
|
};
|
|
29952
|
-
const styles$
|
|
30107
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
29953
30108
|
container: {
|
|
29954
30109
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29955
30110
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -29980,13 +30135,13 @@ const ColorSwatch = props => {
|
|
|
29980
30135
|
"aria-label":
|
|
29981
30136
|
// Don't include an aria label for decorative circles.
|
|
29982
30137
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
29983
|
-
style: [styles$
|
|
30138
|
+
style: [styles$A.colorSwatch, {
|
|
29984
30139
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
29985
30140
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
29986
30141
|
}]
|
|
29987
30142
|
});
|
|
29988
30143
|
};
|
|
29989
|
-
const styles$
|
|
30144
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
29990
30145
|
colorSwatch: {
|
|
29991
30146
|
// Add a white outline so that the color swatch is visible when
|
|
29992
30147
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30005,10 +30160,10 @@ const ColorSelect = props => {
|
|
|
30005
30160
|
onChange
|
|
30006
30161
|
} = props;
|
|
30007
30162
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30008
|
-
style: [styles$
|
|
30163
|
+
style: [styles$z.row, style]
|
|
30009
30164
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30010
30165
|
tag: "label",
|
|
30011
|
-
style: styles$
|
|
30166
|
+
style: styles$z.row
|
|
30012
30167
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30013
30168
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30014
30169
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30027,11 +30182,14 @@ const ColorSelect = props => {
|
|
|
30027
30182
|
})
|
|
30028
30183
|
})))));
|
|
30029
30184
|
};
|
|
30030
|
-
const styles$
|
|
30185
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
30031
30186
|
row: {
|
|
30032
30187
|
display: "flex",
|
|
30033
30188
|
flexDirection: "row",
|
|
30034
|
-
alignItems: "center"
|
|
30189
|
+
alignItems: "center",
|
|
30190
|
+
// Set minWidth to "auto" to prevent the component from bleeding
|
|
30191
|
+
// into the margins. (minWidth is 0 by default.)
|
|
30192
|
+
minWidth: "auto"
|
|
30035
30193
|
}
|
|
30036
30194
|
});
|
|
30037
30195
|
|
|
@@ -30043,17 +30201,17 @@ const EllipseSwatch = props => {
|
|
|
30043
30201
|
} = props;
|
|
30044
30202
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30045
30203
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30046
|
-
style: [styles$
|
|
30204
|
+
style: [styles$y.container, {
|
|
30047
30205
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30048
30206
|
}]
|
|
30049
30207
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30050
|
-
style: [styles$
|
|
30208
|
+
style: [styles$y.innerCircle, {
|
|
30051
30209
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30052
|
-
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30210
|
+
opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
|
|
30053
30211
|
}]
|
|
30054
30212
|
}));
|
|
30055
30213
|
};
|
|
30056
|
-
const styles$
|
|
30214
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
30057
30215
|
container: {
|
|
30058
30216
|
// Add a white outline so that the color swatch is visible when
|
|
30059
30217
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30072,6 +30230,40 @@ const styles$t = aphrodite.StyleSheet.create({
|
|
|
30072
30230
|
}
|
|
30073
30231
|
});
|
|
30074
30232
|
|
|
30233
|
+
const LineStrokeSelect = props => {
|
|
30234
|
+
const {
|
|
30235
|
+
selectedValue,
|
|
30236
|
+
onChange
|
|
30237
|
+
} = props;
|
|
30238
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30239
|
+
tag: "label",
|
|
30240
|
+
style: styles$x.lineStrokeSelect
|
|
30241
|
+
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30242
|
+
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30243
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30244
|
+
selectedValue: selectedValue,
|
|
30245
|
+
onChange: onChange
|
|
30246
|
+
// Placeholder is required, but never gets used.
|
|
30247
|
+
,
|
|
30248
|
+
placeholder: ""
|
|
30249
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30250
|
+
value: "solid",
|
|
30251
|
+
label: "solid"
|
|
30252
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30253
|
+
value: "dashed",
|
|
30254
|
+
label: "dashed"
|
|
30255
|
+
})));
|
|
30256
|
+
};
|
|
30257
|
+
const styles$x = aphrodite.StyleSheet.create({
|
|
30258
|
+
lineStrokeSelect: {
|
|
30259
|
+
display: "flex",
|
|
30260
|
+
flexDirection: "row",
|
|
30261
|
+
alignItems: "center",
|
|
30262
|
+
// Allow truncation, stop bleeding over the edge.
|
|
30263
|
+
minWidth: 0
|
|
30264
|
+
}
|
|
30265
|
+
});
|
|
30266
|
+
|
|
30075
30267
|
/**
|
|
30076
30268
|
* The part of a locked figure settings panel that contains actions
|
|
30077
30269
|
* for this panel and its associated locked figure, including
|
|
@@ -30084,40 +30276,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30084
30276
|
onRemove
|
|
30085
30277
|
} = props;
|
|
30086
30278
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30087
|
-
style: styles$
|
|
30279
|
+
style: styles$w.container
|
|
30088
30280
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30089
30281
|
startIcon: trashIcon__default["default"],
|
|
30090
30282
|
"aria-label": `Delete locked ${figureType}`,
|
|
30091
30283
|
onClick: onRemove,
|
|
30092
30284
|
kind: "tertiary",
|
|
30093
|
-
style: styles$
|
|
30094
|
-
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null),
|
|
30285
|
+
style: styles$w.deleteButton
|
|
30286
|
+
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30095
30287
|
icon: caretDoubleUpIcon__default["default"],
|
|
30096
30288
|
size: "small",
|
|
30097
30289
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30098
30290
|
onClick: () => onMove("back"),
|
|
30099
|
-
style: styles$
|
|
30291
|
+
style: styles$w.iconButton
|
|
30100
30292
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30101
30293
|
icon: caretUpIcon__default["default"],
|
|
30102
30294
|
size: "small",
|
|
30103
30295
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30104
30296
|
onClick: () => onMove("backward"),
|
|
30105
|
-
style: styles$
|
|
30297
|
+
style: styles$w.iconButton
|
|
30106
30298
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30107
30299
|
icon: caretDownIcon__default["default"],
|
|
30108
30300
|
size: "small",
|
|
30109
30301
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30110
30302
|
onClick: () => onMove("forward"),
|
|
30111
|
-
style: styles$
|
|
30303
|
+
style: styles$w.iconButton
|
|
30112
30304
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30113
30305
|
icon: caretDoubleDownIcon__default["default"],
|
|
30114
30306
|
size: "small",
|
|
30115
30307
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30116
30308
|
onClick: () => onMove("front"),
|
|
30117
|
-
style: styles$
|
|
30118
|
-
}))
|
|
30309
|
+
style: styles$w.iconButton
|
|
30310
|
+
}));
|
|
30119
30311
|
};
|
|
30120
|
-
const styles$
|
|
30312
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
30121
30313
|
container: {
|
|
30122
30314
|
width: "100%",
|
|
30123
30315
|
flexDirection: "row",
|
|
@@ -30164,7 +30356,7 @@ const LockedEllipseSettings = props => {
|
|
|
30164
30356
|
/*#__PURE__*/
|
|
30165
30357
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30166
30358
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30167
|
-
style: styles$
|
|
30359
|
+
style: styles$v.row
|
|
30168
30360
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30169
30361
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30170
30362
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30173,19 +30365,19 @@ const LockedEllipseSettings = props => {
|
|
|
30173
30365
|
strokeStyle: strokeStyle
|
|
30174
30366
|
}))
|
|
30175
30367
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30176
|
-
style: styles$
|
|
30368
|
+
style: styles$v.row
|
|
30177
30369
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30178
30370
|
coord: center,
|
|
30179
|
-
style: styles$
|
|
30371
|
+
style: styles$v.spaceUnder,
|
|
30180
30372
|
onChange: newCoords => onChangeProps({
|
|
30181
30373
|
center: newCoords
|
|
30182
30374
|
})
|
|
30183
30375
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30184
|
-
style: styles$
|
|
30376
|
+
style: styles$v.spaceUnder
|
|
30185
30377
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30186
30378
|
coord: radius,
|
|
30187
30379
|
labels: ["x radius", "y radius"],
|
|
30188
|
-
style: styles$
|
|
30380
|
+
style: styles$v.spaceUnder,
|
|
30189
30381
|
onChange: newCoords => onChangeProps({
|
|
30190
30382
|
radius: newCoords
|
|
30191
30383
|
})
|
|
@@ -30197,7 +30389,7 @@ const LockedEllipseSettings = props => {
|
|
|
30197
30389
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30198
30390
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30199
30391
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30200
|
-
style: [styles$
|
|
30392
|
+
style: [styles$v.row, styles$v.spaceUnder]
|
|
30201
30393
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30202
30394
|
selectedValue: color,
|
|
30203
30395
|
onChange: handleColorChange
|
|
@@ -30205,7 +30397,7 @@ const LockedEllipseSettings = props => {
|
|
|
30205
30397
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30206
30398
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30207
30399
|
tag: "label",
|
|
30208
|
-
style: styles$
|
|
30400
|
+
style: [styles$v.row, styles$v.truncatedWidth]
|
|
30209
30401
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30210
30402
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30211
30403
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30220,40 +30412,258 @@ const LockedEllipseSettings = props => {
|
|
|
30220
30412
|
key: option,
|
|
30221
30413
|
value: option,
|
|
30222
30414
|
label: option
|
|
30223
|
-
}))))), /*#__PURE__*/React__namespace.createElement(
|
|
30224
|
-
tag: "label",
|
|
30225
|
-
style: styles$r.row
|
|
30226
|
-
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30227
|
-
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30228
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30415
|
+
}))))), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30229
30416
|
selectedValue: strokeStyle,
|
|
30230
30417
|
onChange: value => onChangeProps({
|
|
30231
30418
|
strokeStyle: value
|
|
30232
30419
|
})
|
|
30420
|
+
}), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30421
|
+
figureType: props.type,
|
|
30422
|
+
onMove: onMove,
|
|
30423
|
+
onRemove: onRemove
|
|
30424
|
+
}));
|
|
30425
|
+
};
|
|
30426
|
+
const styles$v = aphrodite.StyleSheet.create({
|
|
30427
|
+
row: {
|
|
30428
|
+
display: "flex",
|
|
30429
|
+
flexDirection: "row",
|
|
30430
|
+
alignItems: "center"
|
|
30431
|
+
},
|
|
30432
|
+
spaceUnder: {
|
|
30433
|
+
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30434
|
+
},
|
|
30435
|
+
truncatedWidth: {
|
|
30436
|
+
// Allow truncation, stop bleeding over the edge.
|
|
30437
|
+
minWidth: 0
|
|
30438
|
+
}
|
|
30439
|
+
});
|
|
30440
|
+
|
|
30441
|
+
const LineSwatch = props => {
|
|
30442
|
+
const {
|
|
30443
|
+
color,
|
|
30444
|
+
lineStyle
|
|
30445
|
+
} = props;
|
|
30446
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30447
|
+
style: styles$u.container
|
|
30448
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30449
|
+
"aria-label": `${color}, ${lineStyle}`,
|
|
30450
|
+
style: [styles$u.lineSwatch, {
|
|
30451
|
+
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30452
|
+
}]
|
|
30453
|
+
}));
|
|
30454
|
+
};
|
|
30455
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
30456
|
+
container: {
|
|
30457
|
+
backgroundColor: wonderBlocksTokens.color.white,
|
|
30458
|
+
justifyContent: "center",
|
|
30459
|
+
padding: wonderBlocksTokens.spacing.xSmall_8,
|
|
30460
|
+
borderRadius: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30461
|
+
},
|
|
30462
|
+
lineSwatch: {
|
|
30463
|
+
width: 40
|
|
30464
|
+
}
|
|
30465
|
+
});
|
|
30466
|
+
|
|
30467
|
+
/**
|
|
30468
|
+
* LockedFunctionSettings is a component that allows the user to edit the
|
|
30469
|
+
* settings of specifically a locked function on the graph.
|
|
30470
|
+
*
|
|
30471
|
+
* Used in the interactive graph editor's locked figures section.
|
|
30472
|
+
*/
|
|
30473
|
+
const LockedFunctionSettings = props => {
|
|
30474
|
+
const {
|
|
30475
|
+
color: lineColor,
|
|
30476
|
+
strokeStyle,
|
|
30477
|
+
equation,
|
|
30478
|
+
directionalAxis,
|
|
30479
|
+
domain,
|
|
30480
|
+
onChangeProps,
|
|
30481
|
+
onMove,
|
|
30482
|
+
onRemove
|
|
30483
|
+
} = props;
|
|
30484
|
+
const equationPrefix = directionalAxis === "x" ? "y=" : "x=";
|
|
30485
|
+
const lineLabel = `Function (${equationPrefix}${equation})`;
|
|
30486
|
+
|
|
30487
|
+
// Tracking the string value of domain constraints to handle interim state of
|
|
30488
|
+
// entering a negative value, as well as representing Infinity as an empty string.
|
|
30489
|
+
// This variable is used when specifying the values of the input fields.
|
|
30490
|
+
const [domainEntries, setDomainEntries] = React.useState([domain && domain[0] !== -Infinity ? domain[0].toString() : "", domain && domain[1] !== Infinity ? domain[1].toString() : ""]);
|
|
30491
|
+
React.useEffect(() => {
|
|
30492
|
+
// "useEffect" used to maintain parity between domain constraints and their string representation.
|
|
30493
|
+
setDomainEntries([domain && domain[0] !== -Infinity ? domain[0].toString() : "", domain && domain[1] !== Infinity ? domain[1].toString() : ""]);
|
|
30494
|
+
}, [domain]);
|
|
30495
|
+
|
|
30496
|
+
// Generic function for handling property changes (except for 'domain')
|
|
30497
|
+
function handlePropChange(property, newValue) {
|
|
30498
|
+
const updatedProps = {};
|
|
30499
|
+
updatedProps[property] = newValue;
|
|
30500
|
+
onChangeProps(updatedProps);
|
|
30501
|
+
}
|
|
30502
|
+
|
|
30503
|
+
/*
|
|
30504
|
+
Reason for having a separate 'propChange' function for 'domain':
|
|
30505
|
+
Domain entries are optional. Their default value is +/- Infinity.
|
|
30506
|
+
Since input fields that are empty evaluate to zero, there needs to be
|
|
30507
|
+
dedicated code to convert empty to Infinity.
|
|
30508
|
+
*/
|
|
30509
|
+
function handleDomainChange(limitIndex, newValueString) {
|
|
30510
|
+
const newDomainEntries = [...domainEntries];
|
|
30511
|
+
newDomainEntries[limitIndex] = newValueString;
|
|
30512
|
+
setDomainEntries(newDomainEntries);
|
|
30513
|
+
const newDomain = domain ? [...domain] : [-Infinity, Infinity];
|
|
30514
|
+
let newValue = parseFloat(newValueString);
|
|
30515
|
+
if (newValueString === "" && limitIndex === 0) {
|
|
30516
|
+
newValue = -Infinity;
|
|
30517
|
+
} else if (newValueString === "" && limitIndex === 1) {
|
|
30518
|
+
newValue = Infinity;
|
|
30519
|
+
}
|
|
30520
|
+
newDomain[limitIndex] = newValue;
|
|
30521
|
+
onChangeProps({
|
|
30522
|
+
domain: newDomain
|
|
30523
|
+
});
|
|
30524
|
+
}
|
|
30525
|
+
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30526
|
+
expanded: props.expanded,
|
|
30527
|
+
onToggle: props.onToggle,
|
|
30528
|
+
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30529
|
+
style: styles$t.row
|
|
30530
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
|
|
30531
|
+
style: styles$t.accordionHeader
|
|
30532
|
+
}, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30533
|
+
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30534
|
+
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
30535
|
+
color: lineColor,
|
|
30536
|
+
lineStyle: strokeStyle
|
|
30537
|
+
}))
|
|
30538
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30539
|
+
style: [styles$t.row, styles$t.spaceUnder]
|
|
30540
|
+
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30541
|
+
selectedValue: lineColor,
|
|
30542
|
+
onChange: newValue => {
|
|
30543
|
+
handlePropChange("color", newValue);
|
|
30544
|
+
}
|
|
30545
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30546
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
30547
|
+
}), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30548
|
+
selectedValue: strokeStyle,
|
|
30549
|
+
onChange: newValue => {
|
|
30550
|
+
handlePropChange("strokeStyle", newValue);
|
|
30551
|
+
}
|
|
30552
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30553
|
+
style: [styles$t.row, styles$t.rowSpace]
|
|
30554
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30555
|
+
selectedValue: directionalAxis,
|
|
30556
|
+
onChange: newValue => {
|
|
30557
|
+
handlePropChange("directionalAxis", newValue);
|
|
30558
|
+
},
|
|
30559
|
+
"aria-label": "equation prefix",
|
|
30560
|
+
style: styles$t.equationPrefix
|
|
30233
30561
|
// Placeholder is required, but never gets used.
|
|
30234
30562
|
,
|
|
30235
30563
|
placeholder: ""
|
|
30236
30564
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30237
|
-
value: "
|
|
30238
|
-
label: "
|
|
30565
|
+
value: "x",
|
|
30566
|
+
label: "y ="
|
|
30239
30567
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30240
|
-
value: "
|
|
30241
|
-
label: "
|
|
30568
|
+
value: "y",
|
|
30569
|
+
label: "x ="
|
|
30570
|
+
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30571
|
+
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30572
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
30573
|
+
type: "text",
|
|
30574
|
+
"aria-label": "equation",
|
|
30575
|
+
value: equation,
|
|
30576
|
+
onChange: newValue => {
|
|
30577
|
+
handlePropChange("equation", newValue);
|
|
30578
|
+
},
|
|
30579
|
+
style: [styles$t.textField]
|
|
30580
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30581
|
+
style: [styles$t.row, styles$t.rowSpace]
|
|
30582
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30583
|
+
tag: "label",
|
|
30584
|
+
style: styles$t.domainMin
|
|
30585
|
+
}, "domain min", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30586
|
+
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30587
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
30588
|
+
type: "number",
|
|
30589
|
+
style: styles$t.domainMinField,
|
|
30590
|
+
value: domainEntries[0],
|
|
30591
|
+
onChange: newValue => {
|
|
30592
|
+
handleDomainChange(0, newValue);
|
|
30593
|
+
}
|
|
30594
|
+
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30595
|
+
size: wonderBlocksTokens.spacing.medium_16
|
|
30596
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30597
|
+
tag: "label",
|
|
30598
|
+
"aria-label": "domain max",
|
|
30599
|
+
style: styles$t.domainMax
|
|
30600
|
+
}, "max", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30601
|
+
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30602
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
30603
|
+
type: "number",
|
|
30604
|
+
style: styles$t.domainMaxField,
|
|
30605
|
+
value: domainEntries[1],
|
|
30606
|
+
onChange: newValue => {
|
|
30607
|
+
handleDomainChange(1, newValue);
|
|
30608
|
+
}
|
|
30242
30609
|
}))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30243
|
-
showM2Features: props.showM2Features,
|
|
30244
30610
|
figureType: props.type,
|
|
30245
30611
|
onMove: onMove,
|
|
30246
30612
|
onRemove: onRemove
|
|
30247
30613
|
}));
|
|
30248
30614
|
};
|
|
30249
|
-
const styles$
|
|
30615
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
30616
|
+
accordionHeader: {
|
|
30617
|
+
textOverflow: "ellipsis",
|
|
30618
|
+
// A maximum width needs to be specified in order for the ellipsis to work.
|
|
30619
|
+
// The 64px in the calculation accounts for the line swatch (56px) and the preceding strut (8px).
|
|
30620
|
+
// Margin and padding won't work here because they would create space between the header text and the swatch.
|
|
30621
|
+
maxWidth: "calc(100% - 64px)",
|
|
30622
|
+
overflow: "hidden",
|
|
30623
|
+
whiteSpace: "nowrap"
|
|
30624
|
+
},
|
|
30625
|
+
equationPrefix: {
|
|
30626
|
+
minWidth: "auto"
|
|
30627
|
+
},
|
|
30628
|
+
domainMin: {
|
|
30629
|
+
alignItems: "center",
|
|
30630
|
+
display: "flex",
|
|
30631
|
+
// The 'width' property is applied to the label, which wraps the text and the input field.
|
|
30632
|
+
// The width of the input fields (min/max) should be the same (to have a consistent look),
|
|
30633
|
+
// so the following calculation distributes the space accordingly.
|
|
30634
|
+
// For the "domain min" block, the text is 82.7px, and the strut is 6px (88.7px total).
|
|
30635
|
+
// The "domain max" block is 30.23px, and the strut is 6px (36.23px total).
|
|
30636
|
+
// The calculation takes the remain space after the text & struts (141px total) are removed,
|
|
30637
|
+
// and divides it between the two input fields equally.
|
|
30638
|
+
// The calculation reads: "Take 1/2 of the non-text space, and add the required space for this label's text"
|
|
30639
|
+
width: "calc(((100% - 141px) / 2) + 88.7px)",
|
|
30640
|
+
// @ts-expect-error // TS2353: textWrap does not exist in type CSSProperties
|
|
30641
|
+
textWrap: "nowrap"
|
|
30642
|
+
},
|
|
30643
|
+
domainMinField: {
|
|
30644
|
+
width: "calc(100% - 88.7px)" // make room for the label
|
|
30645
|
+
},
|
|
30646
|
+
|
|
30647
|
+
domainMax: {
|
|
30648
|
+
alignItems: "center",
|
|
30649
|
+
display: "flex",
|
|
30650
|
+
// See explanation for "domainMin" for the calculation below.
|
|
30651
|
+
width: "calc(((100% - 141px) / 2) + 36.2px)"
|
|
30652
|
+
},
|
|
30653
|
+
domainMaxField: {
|
|
30654
|
+
width: "calc(100% - 36.2px)" // make room for the label
|
|
30655
|
+
},
|
|
30656
|
+
|
|
30657
|
+
rowSpace: {
|
|
30658
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
30659
|
+
},
|
|
30250
30660
|
row: {
|
|
30251
30661
|
display: "flex",
|
|
30252
30662
|
flexDirection: "row",
|
|
30253
30663
|
alignItems: "center"
|
|
30254
30664
|
},
|
|
30255
|
-
|
|
30256
|
-
|
|
30665
|
+
textField: {
|
|
30666
|
+
flexGrow: "1"
|
|
30257
30667
|
}
|
|
30258
30668
|
});
|
|
30259
30669
|
|
|
@@ -30267,7 +30677,7 @@ const LabeledSwitch = props => {
|
|
|
30267
30677
|
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30268
30678
|
const switchId = ids.get("switch");
|
|
30269
30679
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30270
|
-
style: [styles$
|
|
30680
|
+
style: [styles$s.row, style]
|
|
30271
30681
|
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30272
30682
|
id: switchId,
|
|
30273
30683
|
checked: checked,
|
|
@@ -30279,7 +30689,7 @@ const LabeledSwitch = props => {
|
|
|
30279
30689
|
htmlFor: switchId
|
|
30280
30690
|
}, label));
|
|
30281
30691
|
};
|
|
30282
|
-
const styles$
|
|
30692
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
30283
30693
|
row: {
|
|
30284
30694
|
flexDirection: "row",
|
|
30285
30695
|
alignItems: "center"
|
|
@@ -30313,13 +30723,13 @@ const DefiningPointSettings = props => {
|
|
|
30313
30723
|
return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30314
30724
|
expanded: expanded,
|
|
30315
30725
|
onToggle: onToggle,
|
|
30316
|
-
containerStyle: styles$
|
|
30317
|
-
panelStyle: styles$
|
|
30726
|
+
containerStyle: styles$r.container,
|
|
30727
|
+
panelStyle: styles$r.accordionPanel,
|
|
30318
30728
|
header:
|
|
30319
30729
|
/*#__PURE__*/
|
|
30320
30730
|
// Summary: Point, coords, color (filled/open)
|
|
30321
30731
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30322
|
-
style: styles$
|
|
30732
|
+
style: styles$r.row
|
|
30323
30733
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30324
30734
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30325
30735
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30329,7 +30739,7 @@ const DefiningPointSettings = props => {
|
|
|
30329
30739
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30330
30740
|
coord: coord,
|
|
30331
30741
|
error: !!error,
|
|
30332
|
-
style: styles$
|
|
30742
|
+
style: styles$r.spaceUnder,
|
|
30333
30743
|
onChange: newCoords => {
|
|
30334
30744
|
onChangeProps({
|
|
30335
30745
|
coord: newCoords
|
|
@@ -30338,12 +30748,12 @@ const DefiningPointSettings = props => {
|
|
|
30338
30748
|
}), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30339
30749
|
label: "show point on graph",
|
|
30340
30750
|
checked: !!showPoint,
|
|
30341
|
-
style: showPoint && styles$
|
|
30751
|
+
style: showPoint && styles$r.spaceUnder,
|
|
30342
30752
|
onChange: onTogglePoint
|
|
30343
30753
|
}), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30344
30754
|
selectedValue: pointColor,
|
|
30345
30755
|
onChange: handleColorChange,
|
|
30346
|
-
style: styles$
|
|
30756
|
+
style: styles$r.spaceUnder
|
|
30347
30757
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30348
30758
|
label: "open point",
|
|
30349
30759
|
checked: !filled,
|
|
@@ -30354,7 +30764,7 @@ const DefiningPointSettings = props => {
|
|
|
30354
30764
|
}
|
|
30355
30765
|
})));
|
|
30356
30766
|
};
|
|
30357
|
-
const styles$
|
|
30767
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
30358
30768
|
container: {
|
|
30359
30769
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30360
30770
|
marginBottom: 0,
|
|
@@ -30375,32 +30785,6 @@ const styles$p = aphrodite.StyleSheet.create({
|
|
|
30375
30785
|
}
|
|
30376
30786
|
});
|
|
30377
30787
|
|
|
30378
|
-
const LineSwatch = props => {
|
|
30379
|
-
const {
|
|
30380
|
-
color,
|
|
30381
|
-
lineStyle
|
|
30382
|
-
} = props;
|
|
30383
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30384
|
-
style: styles$o.container
|
|
30385
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30386
|
-
"aria-label": `${color}, ${lineStyle}`,
|
|
30387
|
-
style: [styles$o.lineSwatch, {
|
|
30388
|
-
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30389
|
-
}]
|
|
30390
|
-
}));
|
|
30391
|
-
};
|
|
30392
|
-
const styles$o = aphrodite.StyleSheet.create({
|
|
30393
|
-
container: {
|
|
30394
|
-
backgroundColor: wonderBlocksTokens.color.white,
|
|
30395
|
-
justifyContent: "center",
|
|
30396
|
-
padding: wonderBlocksTokens.spacing.xSmall_8,
|
|
30397
|
-
borderRadius: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30398
|
-
},
|
|
30399
|
-
lineSwatch: {
|
|
30400
|
-
width: 40
|
|
30401
|
-
}
|
|
30402
|
-
});
|
|
30403
|
-
|
|
30404
30788
|
const lengthZeroStr = "The line cannot have length 0.";
|
|
30405
30789
|
const LockedLineSettings = props => {
|
|
30406
30790
|
const {
|
|
@@ -30448,7 +30832,7 @@ const LockedLineSettings = props => {
|
|
|
30448
30832
|
expanded: props.expanded,
|
|
30449
30833
|
onToggle: props.onToggle,
|
|
30450
30834
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30451
|
-
style: styles$
|
|
30835
|
+
style: styles$q.row
|
|
30452
30836
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30453
30837
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30454
30838
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30457,7 +30841,7 @@ const LockedLineSettings = props => {
|
|
|
30457
30841
|
}))
|
|
30458
30842
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30459
30843
|
tag: "label",
|
|
30460
|
-
style: [styles$
|
|
30844
|
+
style: [styles$q.row, styles$q.spaceUnder]
|
|
30461
30845
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30462
30846
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30463
30847
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30478,34 +30862,19 @@ const LockedLineSettings = props => {
|
|
|
30478
30862
|
value: "segment",
|
|
30479
30863
|
label: "segment"
|
|
30480
30864
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30481
|
-
style: styles$
|
|
30865
|
+
style: styles$q.row
|
|
30482
30866
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30483
30867
|
selectedValue: lineColor,
|
|
30484
30868
|
onChange: handleColorChange
|
|
30485
30869
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30486
30870
|
size: wonderBlocksTokens.spacing.small_12
|
|
30487
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
30488
|
-
tag: "label",
|
|
30489
|
-
style: styles$n.row
|
|
30490
|
-
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30491
|
-
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30492
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30871
|
+
}), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30493
30872
|
selectedValue: lineStyle,
|
|
30494
30873
|
onChange: value => onChangeProps({
|
|
30495
30874
|
lineStyle: value
|
|
30496
30875
|
})
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
placeholder: "",
|
|
30500
|
-
style: styles$n.selectMarginOffset
|
|
30501
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30502
|
-
value: "solid",
|
|
30503
|
-
label: "solid"
|
|
30504
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30505
|
-
value: "dashed",
|
|
30506
|
-
label: "dashed"
|
|
30507
|
-
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30508
|
-
style: styles$n.errorText
|
|
30876
|
+
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30877
|
+
style: styles$q.errorText
|
|
30509
30878
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30510
30879
|
label: "Point 1",
|
|
30511
30880
|
showPoint: showPoint1,
|
|
@@ -30525,13 +30894,12 @@ const LockedLineSettings = props => {
|
|
|
30525
30894
|
}),
|
|
30526
30895
|
onChangeProps: newProps => handleChangePoint(newProps, 1)
|
|
30527
30896
|
})), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30528
|
-
showM2Features: props.showM2Features,
|
|
30529
30897
|
figureType: props.type,
|
|
30530
30898
|
onMove: onMove,
|
|
30531
30899
|
onRemove: onRemove
|
|
30532
30900
|
}));
|
|
30533
30901
|
};
|
|
30534
|
-
const styles$
|
|
30902
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30535
30903
|
row: {
|
|
30536
30904
|
display: "flex",
|
|
30537
30905
|
flexDirection: "row",
|
|
@@ -30540,10 +30908,6 @@ const styles$n = aphrodite.StyleSheet.create({
|
|
|
30540
30908
|
spaceUnder: {
|
|
30541
30909
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30542
30910
|
},
|
|
30543
|
-
selectMarginOffset: {
|
|
30544
|
-
// Align with the point settings accordions.
|
|
30545
|
-
marginInlineEnd: -wonderBlocksTokens.spacing.xxxSmall_4
|
|
30546
|
-
},
|
|
30547
30911
|
errorText: {
|
|
30548
30912
|
color: wonderBlocksTokens.color.red
|
|
30549
30913
|
}
|
|
@@ -30576,7 +30940,7 @@ const LockedPointSettings = props => {
|
|
|
30576
30940
|
/*#__PURE__*/
|
|
30577
30941
|
// Summary: Point, coords, color (filled/open)
|
|
30578
30942
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30579
|
-
style: styles$
|
|
30943
|
+
style: styles$p.row
|
|
30580
30944
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30581
30945
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30582
30946
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30585,7 +30949,7 @@ const LockedPointSettings = props => {
|
|
|
30585
30949
|
}))
|
|
30586
30950
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30587
30951
|
coord: coord,
|
|
30588
|
-
style: styles$
|
|
30952
|
+
style: styles$p.spaceUnder,
|
|
30589
30953
|
onChange: newCoord => {
|
|
30590
30954
|
onChangeProps({
|
|
30591
30955
|
coord: newCoord
|
|
@@ -30594,7 +30958,7 @@ const LockedPointSettings = props => {
|
|
|
30594
30958
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30595
30959
|
selectedValue: pointColor,
|
|
30596
30960
|
onChange: handleColorChange,
|
|
30597
|
-
style: styles$
|
|
30961
|
+
style: styles$p.spaceUnder
|
|
30598
30962
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30599
30963
|
label: "open point",
|
|
30600
30964
|
checked: !filled,
|
|
@@ -30604,13 +30968,12 @@ const LockedPointSettings = props => {
|
|
|
30604
30968
|
});
|
|
30605
30969
|
}
|
|
30606
30970
|
}), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30607
|
-
showM2Features: props.showM2Features,
|
|
30608
30971
|
figureType: props.type,
|
|
30609
30972
|
onMove: onMove,
|
|
30610
30973
|
onRemove: onRemove
|
|
30611
30974
|
}));
|
|
30612
30975
|
};
|
|
30613
|
-
const styles$
|
|
30976
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30614
30977
|
row: {
|
|
30615
30978
|
flexDirection: "row",
|
|
30616
30979
|
alignItems: "center"
|
|
@@ -30628,17 +30991,17 @@ const PolygonSwatch = props => {
|
|
|
30628
30991
|
} = props;
|
|
30629
30992
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30630
30993
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30631
|
-
style: [styles$
|
|
30994
|
+
style: [styles$o.container, {
|
|
30632
30995
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30633
30996
|
}]
|
|
30634
30997
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30635
|
-
style: [styles$
|
|
30998
|
+
style: [styles$o.innerSquare, {
|
|
30636
30999
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30637
|
-
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
31000
|
+
opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
|
|
30638
31001
|
}]
|
|
30639
31002
|
}));
|
|
30640
31003
|
};
|
|
30641
|
-
const styles$
|
|
31004
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30642
31005
|
container: {
|
|
30643
31006
|
// Add a white outline so that the color swatch is visible when
|
|
30644
31007
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30680,7 +31043,7 @@ const LockedPolygonSettings = props => {
|
|
|
30680
31043
|
/*#__PURE__*/
|
|
30681
31044
|
// Summary: Polygon, number of sides, style swatch
|
|
30682
31045
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30683
|
-
style: styles$
|
|
31046
|
+
style: styles$n.row
|
|
30684
31047
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30685
31048
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30686
31049
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30689,7 +31052,7 @@ const LockedPolygonSettings = props => {
|
|
|
30689
31052
|
strokeStyle: strokeStyle
|
|
30690
31053
|
}))
|
|
30691
31054
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30692
|
-
style: [styles$
|
|
31055
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
30693
31056
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30694
31057
|
selectedValue: color,
|
|
30695
31058
|
onChange: handleColorChange
|
|
@@ -30697,7 +31060,7 @@ const LockedPolygonSettings = props => {
|
|
|
30697
31060
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30698
31061
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30699
31062
|
tag: "label",
|
|
30700
|
-
style: styles$
|
|
31063
|
+
style: [styles$n.row, styles$n.truncatedWidth]
|
|
30701
31064
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30702
31065
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30703
31066
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30712,42 +31075,28 @@ const LockedPolygonSettings = props => {
|
|
|
30712
31075
|
key: option,
|
|
30713
31076
|
value: option,
|
|
30714
31077
|
label: option
|
|
30715
|
-
}))))), /*#__PURE__*/React__namespace.createElement(
|
|
30716
|
-
tag: "label",
|
|
30717
|
-
style: [styles$k.row, styles$k.spaceUnder]
|
|
30718
|
-
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30719
|
-
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30720
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31078
|
+
}))))), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30721
31079
|
selectedValue: strokeStyle,
|
|
30722
31080
|
onChange: value => onChangeProps({
|
|
30723
31081
|
strokeStyle: value
|
|
30724
31082
|
})
|
|
30725
|
-
|
|
30726
|
-
,
|
|
30727
|
-
placeholder: ""
|
|
30728
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30729
|
-
value: "solid",
|
|
30730
|
-
label: "solid"
|
|
30731
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30732
|
-
value: "dashed",
|
|
30733
|
-
label: "dashed"
|
|
30734
|
-
}))), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
31083
|
+
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30735
31084
|
label: "show vertices",
|
|
30736
31085
|
checked: showVertices,
|
|
30737
31086
|
onChange: newValue => onChangeProps({
|
|
30738
31087
|
showVertices: newValue
|
|
30739
31088
|
}),
|
|
30740
|
-
style: styles$
|
|
31089
|
+
style: styles$n.spaceUnder
|
|
30741
31090
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30742
31091
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30743
31092
|
expanded: true,
|
|
30744
|
-
containerStyle: styles$
|
|
30745
|
-
panelStyle: styles$
|
|
31093
|
+
containerStyle: styles$n.pointAccordionContainer,
|
|
31094
|
+
panelStyle: styles$n.pointAccordionPanel
|
|
30746
31095
|
}, points.map((point, index) => {
|
|
30747
31096
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30748
31097
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30749
|
-
key: `locked-polygon-point
|
|
30750
|
-
style: [styles$
|
|
31098
|
+
key: `locked-polygon-point-index-${index}`,
|
|
31099
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
30751
31100
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30752
31101
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30753
31102
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30775,7 +31124,7 @@ const LockedPolygonSettings = props => {
|
|
|
30775
31124
|
points: newPoints
|
|
30776
31125
|
});
|
|
30777
31126
|
},
|
|
30778
|
-
style: styles$
|
|
31127
|
+
style: styles$n.icon
|
|
30779
31128
|
}));
|
|
30780
31129
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30781
31130
|
kind: "tertiary",
|
|
@@ -30786,13 +31135,12 @@ const LockedPolygonSettings = props => {
|
|
|
30786
31135
|
});
|
|
30787
31136
|
}
|
|
30788
31137
|
}, "Add point")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30789
|
-
showM2Features: props.showM2Features,
|
|
30790
31138
|
figureType: props.type,
|
|
30791
31139
|
onMove: onMove,
|
|
30792
31140
|
onRemove: onRemove
|
|
30793
31141
|
}));
|
|
30794
31142
|
};
|
|
30795
|
-
const styles$
|
|
31143
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30796
31144
|
row: {
|
|
30797
31145
|
display: "flex",
|
|
30798
31146
|
flexDirection: "row",
|
|
@@ -30809,6 +31157,10 @@ const styles$k = aphrodite.StyleSheet.create({
|
|
|
30809
31157
|
},
|
|
30810
31158
|
spaceUnder: {
|
|
30811
31159
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
31160
|
+
},
|
|
31161
|
+
truncatedWidth: {
|
|
31162
|
+
// Allow truncation, stop bleeding over the edge.
|
|
31163
|
+
minWidth: 0
|
|
30812
31164
|
}
|
|
30813
31165
|
});
|
|
30814
31166
|
|
|
@@ -30850,7 +31202,7 @@ const LockedVectorSettings = props => {
|
|
|
30850
31202
|
expanded: props.expanded,
|
|
30851
31203
|
onToggle: props.onToggle,
|
|
30852
31204
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30853
|
-
style: styles$
|
|
31205
|
+
style: styles$m.row
|
|
30854
31206
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30855
31207
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30856
31208
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30858,19 +31210,19 @@ const LockedVectorSettings = props => {
|
|
|
30858
31210
|
lineStyle: "solid"
|
|
30859
31211
|
}))
|
|
30860
31212
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30861
|
-
style: [styles$
|
|
31213
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30862
31214
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30863
31215
|
selectedValue: lineColor,
|
|
30864
31216
|
onChange: handleColorChange
|
|
30865
31217
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30866
|
-
style: styles$
|
|
31218
|
+
style: styles$m.errorText
|
|
30867
31219
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30868
31220
|
expanded: true // Initial state is expanded
|
|
30869
31221
|
,
|
|
30870
|
-
containerStyle: styles$
|
|
30871
|
-
panelStyle: styles$
|
|
31222
|
+
containerStyle: styles$m.container,
|
|
31223
|
+
panelStyle: styles$m.accordionPanel,
|
|
30872
31224
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30873
|
-
style: styles$
|
|
31225
|
+
style: styles$m.row
|
|
30874
31226
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30875
31227
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30876
31228
|
coord: tail,
|
|
@@ -30881,10 +31233,10 @@ const LockedVectorSettings = props => {
|
|
|
30881
31233
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30882
31234
|
expanded: true // Initial state is expanded
|
|
30883
31235
|
,
|
|
30884
|
-
containerStyle: styles$
|
|
30885
|
-
panelStyle: styles$
|
|
31236
|
+
containerStyle: styles$m.container,
|
|
31237
|
+
panelStyle: styles$m.accordionPanel,
|
|
30886
31238
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30887
|
-
style: styles$
|
|
31239
|
+
style: styles$m.row
|
|
30888
31240
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30889
31241
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30890
31242
|
coord: tip,
|
|
@@ -30893,13 +31245,12 @@ const LockedVectorSettings = props => {
|
|
|
30893
31245
|
handleChangePoint(newProps, 1);
|
|
30894
31246
|
}
|
|
30895
31247
|
})), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30896
|
-
showM2Features: props.showM2Features,
|
|
30897
31248
|
figureType: props.type,
|
|
30898
31249
|
onMove: onMove,
|
|
30899
31250
|
onRemove: onRemove
|
|
30900
31251
|
}));
|
|
30901
31252
|
};
|
|
30902
|
-
const styles$
|
|
31253
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30903
31254
|
accordionPanel: {
|
|
30904
31255
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30905
31256
|
},
|
|
@@ -30936,19 +31287,16 @@ const LockedFigureSettings = props => {
|
|
|
30936
31287
|
case "line":
|
|
30937
31288
|
return /*#__PURE__*/React__namespace.createElement(LockedLineSettings, props);
|
|
30938
31289
|
case "vector":
|
|
30939
|
-
|
|
30940
|
-
return /*#__PURE__*/React__namespace.createElement(LockedVectorSettings, props);
|
|
30941
|
-
}
|
|
30942
|
-
break;
|
|
31290
|
+
return /*#__PURE__*/React__namespace.createElement(LockedVectorSettings, props);
|
|
30943
31291
|
case "ellipse":
|
|
30944
|
-
|
|
30945
|
-
return /*#__PURE__*/React__namespace.createElement(LockedEllipseSettings, props);
|
|
30946
|
-
}
|
|
30947
|
-
break;
|
|
31292
|
+
return /*#__PURE__*/React__namespace.createElement(LockedEllipseSettings, props);
|
|
30948
31293
|
case "polygon":
|
|
30949
|
-
|
|
30950
|
-
|
|
31294
|
+
return /*#__PURE__*/React__namespace.createElement(LockedPolygonSettings, props);
|
|
31295
|
+
case "function":
|
|
31296
|
+
if (props.showM2bFeatures) {
|
|
31297
|
+
return /*#__PURE__*/React__namespace.createElement(LockedFunctionSettings, props);
|
|
30951
31298
|
}
|
|
31299
|
+
break;
|
|
30952
31300
|
}
|
|
30953
31301
|
return null;
|
|
30954
31302
|
};
|
|
@@ -31054,15 +31402,8 @@ const LockedFiguresSection = props => {
|
|
|
31054
31402
|
onToggle: () => setIsExpanded(!isExpanded),
|
|
31055
31403
|
isCollapsible: true
|
|
31056
31404
|
}), isExpanded && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
|
|
31057
|
-
if (figure.type === "function") {
|
|
31058
|
-
// TODO(LEMS-1947): Add locked function settings.
|
|
31059
|
-
// Remove this block once function locked figure settings are
|
|
31060
|
-
// implemented.
|
|
31061
|
-
return;
|
|
31062
|
-
}
|
|
31063
31405
|
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
31064
31406
|
key: `${uniqueId}-locked-${figure}-${index}`,
|
|
31065
|
-
showM2Features: props.showM2Features,
|
|
31066
31407
|
showM2bFeatures: props.showM2bFeatures,
|
|
31067
31408
|
expanded: expandedStates[index],
|
|
31068
31409
|
onToggle: newValue => {
|
|
@@ -31076,9 +31417,8 @@ const LockedFiguresSection = props => {
|
|
|
31076
31417
|
onRemove: () => removeLockedFigure(index)
|
|
31077
31418
|
}));
|
|
31078
31419
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31079
|
-
style: styles$
|
|
31420
|
+
style: styles$l.buttonContainer
|
|
31080
31421
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31081
|
-
showM2Features: props.showM2Features,
|
|
31082
31422
|
showM2bFeatures: props.showM2bFeatures,
|
|
31083
31423
|
id: `${uniqueId}-select`,
|
|
31084
31424
|
onChange: addLockedFigure
|
|
@@ -31087,10 +31427,10 @@ const LockedFiguresSection = props => {
|
|
|
31087
31427
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31088
31428
|
kind: "secondary",
|
|
31089
31429
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31090
|
-
style: styles$
|
|
31430
|
+
style: styles$l.button
|
|
31091
31431
|
}, buttonLabel))));
|
|
31092
31432
|
};
|
|
31093
|
-
const styles$
|
|
31433
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
31094
31434
|
buttonContainer: {
|
|
31095
31435
|
flexDirection: "row",
|
|
31096
31436
|
alignItems: "center"
|
|
@@ -31126,7 +31466,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31126
31466
|
// Never uses placeholder, always has value
|
|
31127
31467
|
,
|
|
31128
31468
|
placeholder: "",
|
|
31129
|
-
style: styles$
|
|
31469
|
+
style: styles$k.singleSelectShort
|
|
31130
31470
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31131
31471
|
key: n,
|
|
31132
31472
|
value: `${n}`,
|
|
@@ -31137,7 +31477,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31137
31477
|
label: "unlimited"
|
|
31138
31478
|
})]);
|
|
31139
31479
|
};
|
|
31140
|
-
const styles$
|
|
31480
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
31141
31481
|
singleSelectShort: {
|
|
31142
31482
|
// Non-standard spacing, but it's the smallest we can go
|
|
31143
31483
|
// without running into styling issues with the dropdown.
|
|
@@ -31150,7 +31490,7 @@ const GraphTypeSelector = props => {
|
|
|
31150
31490
|
selectedValue: props.graphType,
|
|
31151
31491
|
onChange: props.onChange,
|
|
31152
31492
|
placeholder: "Select a graph type",
|
|
31153
|
-
style: styles$
|
|
31493
|
+
style: styles$j.singleSelectShort
|
|
31154
31494
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31155
31495
|
value: "linear",
|
|
31156
31496
|
label: "Linear function"
|
|
@@ -31183,7 +31523,7 @@ const GraphTypeSelector = props => {
|
|
|
31183
31523
|
label: "Angle"
|
|
31184
31524
|
}));
|
|
31185
31525
|
};
|
|
31186
|
-
const styles$
|
|
31526
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
31187
31527
|
singleSelectShort: {
|
|
31188
31528
|
// Non-standard spacing, but it's the smallest we can go
|
|
31189
31529
|
// without running into styling issues with the dropdown.
|
|
@@ -31218,7 +31558,6 @@ function InteractiveGraphCorrectAnswer(props) {
|
|
|
31218
31558
|
const {
|
|
31219
31559
|
ButtonGroup: ButtonGroup$2,
|
|
31220
31560
|
InfoTip: InfoTip$c,
|
|
31221
|
-
PropCheckBox: PropCheckBox$7,
|
|
31222
31561
|
RangeInput: RangeInput$4
|
|
31223
31562
|
} = perseus.components;
|
|
31224
31563
|
const defaultBackgroundImage$1 = {
|
|
@@ -31606,16 +31945,20 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31606
31945
|
onChange: this.change("markings")
|
|
31607
31946
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
31608
31947
|
className: "perseus-widget-left-col"
|
|
31609
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
31948
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
31610
31949
|
label: "Show tooltips",
|
|
31611
|
-
|
|
31612
|
-
onChange:
|
|
31950
|
+
checked: this.props.showTooltips,
|
|
31951
|
+
onChange: value => {
|
|
31952
|
+
this.change({
|
|
31953
|
+
showTooltips: value
|
|
31954
|
+
});
|
|
31955
|
+
}
|
|
31613
31956
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31614
31957
|
label: "Background image URL:",
|
|
31615
|
-
style: styles$
|
|
31958
|
+
style: styles$i.resetSpaceTop
|
|
31616
31959
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31617
31960
|
type: "text",
|
|
31618
|
-
className: aphrodite.css(styles$
|
|
31961
|
+
className: aphrodite.css(styles$i.backgroundUrlInput),
|
|
31619
31962
|
ref: this.bgUrlRef,
|
|
31620
31963
|
value: this.state.backgroundImage.url || "",
|
|
31621
31964
|
onChange: e => {
|
|
@@ -31631,14 +31974,18 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31631
31974
|
onKeyPress: this.changeBackgroundUrl,
|
|
31632
31975
|
onBlur: this.changeBackgroundUrl
|
|
31633
31976
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31634
|
-
style: styles$
|
|
31977
|
+
style: styles$i.protractorSection
|
|
31635
31978
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31636
|
-
style: styles$
|
|
31637
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
31979
|
+
style: styles$i.checkboxRow
|
|
31980
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
31638
31981
|
label: "Show protractor",
|
|
31639
|
-
|
|
31640
|
-
onChange:
|
|
31641
|
-
|
|
31982
|
+
checked: this.props.showProtractor,
|
|
31983
|
+
onChange: value => {
|
|
31984
|
+
this.change({
|
|
31985
|
+
showProtractor: value
|
|
31986
|
+
});
|
|
31987
|
+
},
|
|
31988
|
+
style: styles$i.resetSpaceTop
|
|
31642
31989
|
})), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31643
31990
|
layout: "floating",
|
|
31644
31991
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31646,7 +31993,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31646
31993
|
}))));
|
|
31647
31994
|
}
|
|
31648
31995
|
}
|
|
31649
|
-
const styles$
|
|
31996
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
31650
31997
|
resetSpaceTop: {
|
|
31651
31998
|
marginTop: 0
|
|
31652
31999
|
},
|
|
@@ -31685,14 +32032,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31685
32032
|
const num = +newValue;
|
|
31686
32033
|
onChange(num);
|
|
31687
32034
|
},
|
|
31688
|
-
style: styles$
|
|
32035
|
+
style: styles$h.singleSelectShort
|
|
31689
32036
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31690
32037
|
key: n,
|
|
31691
32038
|
value: `${n}`,
|
|
31692
32039
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31693
32040
|
})));
|
|
31694
32041
|
};
|
|
31695
|
-
const styles$
|
|
32042
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
31696
32043
|
singleSelectShort: {
|
|
31697
32044
|
// Non-standard spacing, but it's the smallest we can go
|
|
31698
32045
|
// without running into styling issues with the dropdown.
|
|
@@ -31700,15 +32047,26 @@ const styles$e = aphrodite.StyleSheet.create({
|
|
|
31700
32047
|
}
|
|
31701
32048
|
});
|
|
31702
32049
|
|
|
32050
|
+
const StartCoordsAngle = props => {
|
|
32051
|
+
const {
|
|
32052
|
+
startCoords
|
|
32053
|
+
} = props;
|
|
32054
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, "WIP", /*#__PURE__*/React__namespace.createElement("br", null), " Start coords:", startCoords.map((coord, index) => {
|
|
32055
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32056
|
+
key: index
|
|
32057
|
+
}, `Point ${index + 1}: (${coord[0]}, ${coord[1]})`);
|
|
32058
|
+
}));
|
|
32059
|
+
};
|
|
32060
|
+
|
|
31703
32061
|
const StartCoordsCircle = props => {
|
|
31704
32062
|
const {
|
|
31705
32063
|
startCoords,
|
|
31706
32064
|
onChange
|
|
31707
32065
|
} = props;
|
|
31708
32066
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31709
|
-
style: styles$
|
|
32067
|
+
style: styles$g.tile
|
|
31710
32068
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31711
|
-
style: styles$
|
|
32069
|
+
style: styles$g.row
|
|
31712
32070
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Center:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31713
32071
|
size: wonderBlocksTokens.spacing.small_12
|
|
31714
32072
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31721,22 +32079,21 @@ const StartCoordsCircle = props => {
|
|
|
31721
32079
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31722
32080
|
size: wonderBlocksTokens.spacing.small_12
|
|
31723
32081
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31724
|
-
style: styles$
|
|
32082
|
+
style: styles$g.row
|
|
31725
32083
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Radius:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31726
32084
|
size: wonderBlocksTokens.spacing.small_12
|
|
31727
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
32085
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
31728
32086
|
value: startCoords.radius.toString(),
|
|
31729
|
-
type: "number",
|
|
31730
32087
|
onChange: value => {
|
|
31731
32088
|
onChange({
|
|
31732
32089
|
center: startCoords.center,
|
|
31733
32090
|
radius: parseFloat(value)
|
|
31734
32091
|
});
|
|
31735
32092
|
},
|
|
31736
|
-
style: styles$
|
|
32093
|
+
style: styles$g.textField
|
|
31737
32094
|
})));
|
|
31738
32095
|
};
|
|
31739
|
-
const styles$
|
|
32096
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31740
32097
|
tile: {
|
|
31741
32098
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31742
32099
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31758,7 +32115,7 @@ const StartCoordsLine = props => {
|
|
|
31758
32115
|
onChange
|
|
31759
32116
|
} = props;
|
|
31760
32117
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31761
|
-
style: styles$
|
|
32118
|
+
style: styles$f.tile
|
|
31762
32119
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31763
32120
|
size: wonderBlocksTokens.spacing.small_12
|
|
31764
32121
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31766,7 +32123,7 @@ const StartCoordsLine = props => {
|
|
|
31766
32123
|
labels: ["x", "y"],
|
|
31767
32124
|
onChange: value => onChange([value, startCoords[1]])
|
|
31768
32125
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31769
|
-
style: styles$
|
|
32126
|
+
style: styles$f.tile
|
|
31770
32127
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31771
32128
|
size: wonderBlocksTokens.spacing.small_12
|
|
31772
32129
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31775,7 +32132,7 @@ const StartCoordsLine = props => {
|
|
|
31775
32132
|
onChange: value => onChange([startCoords[0], value])
|
|
31776
32133
|
})));
|
|
31777
32134
|
};
|
|
31778
|
-
const styles$
|
|
32135
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31779
32136
|
tile: {
|
|
31780
32137
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31781
32138
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31798,7 +32155,7 @@ const StartCoordsMultiline = props => {
|
|
|
31798
32155
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31799
32156
|
expanded: true
|
|
31800
32157
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31801
|
-
style: styles$
|
|
32158
|
+
style: styles$e.nestedTile
|
|
31802
32159
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31803
32160
|
size: wonderBlocksTokens.spacing.small_12
|
|
31804
32161
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31810,7 +32167,7 @@ const StartCoordsMultiline = props => {
|
|
|
31810
32167
|
onChange(newCoords);
|
|
31811
32168
|
}
|
|
31812
32169
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31813
|
-
style: styles$
|
|
32170
|
+
style: styles$e.nestedTile
|
|
31814
32171
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31815
32172
|
size: wonderBlocksTokens.spacing.small_12
|
|
31816
32173
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31823,7 +32180,7 @@ const StartCoordsMultiline = props => {
|
|
|
31823
32180
|
}
|
|
31824
32181
|
})))));
|
|
31825
32182
|
};
|
|
31826
|
-
const styles$
|
|
32183
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31827
32184
|
nestedTile: {
|
|
31828
32185
|
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
31829
32186
|
flexDirection: "row",
|
|
@@ -31831,6 +32188,145 @@ const styles$b = aphrodite.StyleSheet.create({
|
|
|
31831
32188
|
}
|
|
31832
32189
|
});
|
|
31833
32190
|
|
|
32191
|
+
const StartCoordsPoint = props => {
|
|
32192
|
+
const {
|
|
32193
|
+
startCoords,
|
|
32194
|
+
onChange
|
|
32195
|
+
} = props;
|
|
32196
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, startCoords.map((coord, index) => {
|
|
32197
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32198
|
+
key: index,
|
|
32199
|
+
style: styles$d.tile
|
|
32200
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point ${index + 1}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32201
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32202
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32203
|
+
coord: coord,
|
|
32204
|
+
labels: ["x", "y"],
|
|
32205
|
+
onChange: newCoord => {
|
|
32206
|
+
const newStartCoords = [...startCoords];
|
|
32207
|
+
newStartCoords[index] = newCoord;
|
|
32208
|
+
onChange(newStartCoords);
|
|
32209
|
+
}
|
|
32210
|
+
}));
|
|
32211
|
+
}));
|
|
32212
|
+
};
|
|
32213
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
32214
|
+
tile: {
|
|
32215
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
32216
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
32217
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
32218
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
32219
|
+
flexDirection: "row",
|
|
32220
|
+
alignItems: "center"
|
|
32221
|
+
}
|
|
32222
|
+
});
|
|
32223
|
+
|
|
32224
|
+
const StartCoordsQuadratic = props => {
|
|
32225
|
+
const {
|
|
32226
|
+
startCoords,
|
|
32227
|
+
onChange
|
|
32228
|
+
} = props;
|
|
32229
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32230
|
+
style: styles$c.equationSection
|
|
32231
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Starting equation:"), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
32232
|
+
style: styles$c.equationBody
|
|
32233
|
+
}, getQuadraticEquation(startCoords))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32234
|
+
style: styles$c.tile
|
|
32235
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32236
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32237
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32238
|
+
coord: startCoords[0],
|
|
32239
|
+
labels: ["x", "y"],
|
|
32240
|
+
onChange: value => onChange([value, startCoords[1], startCoords[2]])
|
|
32241
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32242
|
+
style: styles$c.tile
|
|
32243
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32244
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32245
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32246
|
+
coord: startCoords[1],
|
|
32247
|
+
labels: ["x", "y"],
|
|
32248
|
+
onChange: value => onChange([startCoords[0], value, startCoords[2]])
|
|
32249
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32250
|
+
style: styles$c.tile
|
|
32251
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 3:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32252
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32253
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32254
|
+
coord: startCoords[2],
|
|
32255
|
+
labels: ["x", "y"],
|
|
32256
|
+
onChange: value => onChange([startCoords[0], startCoords[1], value])
|
|
32257
|
+
})));
|
|
32258
|
+
};
|
|
32259
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
32260
|
+
tile: {
|
|
32261
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
32262
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
32263
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
32264
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
32265
|
+
flexDirection: "row",
|
|
32266
|
+
alignItems: "center"
|
|
32267
|
+
},
|
|
32268
|
+
equationSection: {
|
|
32269
|
+
marginTop: wonderBlocksTokens.spacing.small_12
|
|
32270
|
+
},
|
|
32271
|
+
equationBody: {
|
|
32272
|
+
backgroundColor: wonderBlocksTokens.color.fadedOffBlack8,
|
|
32273
|
+
border: `1px solid ${wonderBlocksTokens.color.fadedOffBlack32}`,
|
|
32274
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
32275
|
+
paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
|
|
32276
|
+
paddingRight: wonderBlocksTokens.spacing.xSmall_8,
|
|
32277
|
+
fontSize: wonderBlocksTokens.font.size.xSmall
|
|
32278
|
+
}
|
|
32279
|
+
});
|
|
32280
|
+
|
|
32281
|
+
const StartCoordsSinusoid = props => {
|
|
32282
|
+
const {
|
|
32283
|
+
startCoords,
|
|
32284
|
+
onChange
|
|
32285
|
+
} = props;
|
|
32286
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32287
|
+
style: styles$b.equationSection
|
|
32288
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Starting equation:"), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.BodyMonospace, {
|
|
32289
|
+
style: styles$b.equationBody
|
|
32290
|
+
}, getSinusoidEquation(startCoords))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32291
|
+
style: styles$b.tile
|
|
32292
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32293
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32294
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32295
|
+
coord: startCoords[0],
|
|
32296
|
+
labels: ["x", "y"],
|
|
32297
|
+
onChange: value => onChange([value, startCoords[1]])
|
|
32298
|
+
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
32299
|
+
style: styles$b.tile
|
|
32300
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
32301
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
32302
|
+
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
32303
|
+
coord: startCoords[1],
|
|
32304
|
+
labels: ["x", "y"],
|
|
32305
|
+
onChange: value => onChange([startCoords[0], value])
|
|
32306
|
+
})));
|
|
32307
|
+
};
|
|
32308
|
+
const styles$b = aphrodite.StyleSheet.create({
|
|
32309
|
+
tile: {
|
|
32310
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
32311
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
32312
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
32313
|
+
borderRadius: wonderBlocksTokens.spacing.xSmall_8,
|
|
32314
|
+
flexDirection: "row",
|
|
32315
|
+
alignItems: "center"
|
|
32316
|
+
},
|
|
32317
|
+
equationSection: {
|
|
32318
|
+
marginTop: wonderBlocksTokens.spacing.small_12
|
|
32319
|
+
},
|
|
32320
|
+
equationBody: {
|
|
32321
|
+
backgroundColor: wonderBlocksTokens.color.fadedOffBlack8,
|
|
32322
|
+
border: `1px solid ${wonderBlocksTokens.color.fadedOffBlack32}`,
|
|
32323
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
32324
|
+
paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
|
|
32325
|
+
paddingRight: wonderBlocksTokens.spacing.xSmall_8,
|
|
32326
|
+
fontSize: wonderBlocksTokens.font.size.xSmall
|
|
32327
|
+
}
|
|
32328
|
+
});
|
|
32329
|
+
|
|
31834
32330
|
const StartCoordsSettingsInner = props => {
|
|
31835
32331
|
const {
|
|
31836
32332
|
type,
|
|
@@ -31871,6 +32367,36 @@ const StartCoordsSettingsInner = props => {
|
|
|
31871
32367
|
},
|
|
31872
32368
|
onChange: onChange
|
|
31873
32369
|
});
|
|
32370
|
+
case "sinusoid":
|
|
32371
|
+
const sinusoidCoords = perseus.getSinusoidCoords(props, range, step);
|
|
32372
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsSinusoid, {
|
|
32373
|
+
startCoords: sinusoidCoords,
|
|
32374
|
+
onChange: onChange
|
|
32375
|
+
});
|
|
32376
|
+
case "quadratic":
|
|
32377
|
+
const quadraticCoords = perseus.getQuadraticCoords(props, range, step);
|
|
32378
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsQuadratic, {
|
|
32379
|
+
startCoords: quadraticCoords,
|
|
32380
|
+
onChange: onChange
|
|
32381
|
+
});
|
|
32382
|
+
// Graphs with startCoords of type ReadonlyArray<Coord>
|
|
32383
|
+
case "point":
|
|
32384
|
+
case "polygon":
|
|
32385
|
+
const pointCoords = type === "point" ? perseus.getPointCoords(props, range, step) : perseus.getPolygonCoords(props, range, step);
|
|
32386
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsPoint, {
|
|
32387
|
+
startCoords: pointCoords,
|
|
32388
|
+
onChange: onChange
|
|
32389
|
+
});
|
|
32390
|
+
case "angle":
|
|
32391
|
+
const angleCoords = perseus.getAngleCoords({
|
|
32392
|
+
graph: props,
|
|
32393
|
+
range,
|
|
32394
|
+
step
|
|
32395
|
+
});
|
|
32396
|
+
return /*#__PURE__*/React__namespace.createElement(StartCoordsAngle, {
|
|
32397
|
+
startCoords: angleCoords,
|
|
32398
|
+
onChange: onChange
|
|
32399
|
+
});
|
|
31874
32400
|
default:
|
|
31875
32401
|
return null;
|
|
31876
32402
|
}
|
|
@@ -32090,7 +32616,8 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32090
32616
|
coords: null
|
|
32091
32617
|
};
|
|
32092
32618
|
this.props.onChange({
|
|
32093
|
-
correct: graph
|
|
32619
|
+
correct: graph,
|
|
32620
|
+
graph: graph
|
|
32094
32621
|
});
|
|
32095
32622
|
},
|
|
32096
32623
|
style: styles$a.singleSelectShort
|
|
@@ -32162,7 +32689,9 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32162
32689
|
}
|
|
32163
32690
|
});
|
|
32164
32691
|
}
|
|
32165
|
-
})), this.props.graph?.type &&
|
|
32692
|
+
})), this.props.graph?.type &&
|
|
32693
|
+
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32694
|
+
shouldShowStartCoordsUI(this.props.apiOptions.flags, this.props.graph) && /*#__PURE__*/React__namespace.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32166
32695
|
range: this.props.range,
|
|
32167
32696
|
step: this.props.step,
|
|
32168
32697
|
onChange: this.changeStartCoords
|
|
@@ -32219,7 +32748,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32219
32748
|
// Only show the "Add locked figure" dropdown if the graph
|
|
32220
32749
|
// is using Mafs.
|
|
32221
32750
|
this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
|
|
32222
|
-
showM2Features: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m2"],
|
|
32223
32751
|
showM2bFeatures: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m2b"],
|
|
32224
32752
|
figures: this.props.lockedFigures,
|
|
32225
32753
|
onChange: this.props.onChange
|
|
@@ -33789,7 +34317,6 @@ const styles = aphrodite.StyleSheet.create({
|
|
|
33789
34317
|
/* eslint-disable react/forbid-prop-types, react/sort-comp */
|
|
33790
34318
|
const {
|
|
33791
34319
|
InfoTip: InfoTip$a,
|
|
33792
|
-
PropCheckBox: PropCheckBox$6,
|
|
33793
34320
|
TextListEditor: TextListEditor$3
|
|
33794
34321
|
} = perseus.components;
|
|
33795
34322
|
class MatcherEditor extends React__namespace.Component {
|
|
@@ -33841,14 +34368,22 @@ class MatcherEditor extends React__namespace.Component {
|
|
|
33841
34368
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33842
34369
|
,
|
|
33843
34370
|
onChange: this.onLabelChange.bind(this, 1)
|
|
33844
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(
|
|
34371
|
+
})), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
33845
34372
|
label: "Order of the matched pairs matters:",
|
|
33846
|
-
|
|
33847
|
-
onChange:
|
|
33848
|
-
|
|
34373
|
+
checked: this.props.orderMatters,
|
|
34374
|
+
onChange: value => {
|
|
34375
|
+
this.props.onChange({
|
|
34376
|
+
orderMatters: value
|
|
34377
|
+
});
|
|
34378
|
+
}
|
|
34379
|
+
}), /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "With this option enabled, only the order provided above will be treated as correct. This is useful when ordering is significant, such as in the context of a proof."), /*#__PURE__*/React__namespace.createElement("p", null, "If disabled, pairwise matching is sufficient. To make this clear, the left column becomes fixed in the provided order and only the cards in the right column can be moved."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
33849
34380
|
label: "Padding:",
|
|
33850
|
-
|
|
33851
|
-
onChange:
|
|
34381
|
+
checked: this.props.padding,
|
|
34382
|
+
onChange: value => {
|
|
34383
|
+
this.props.onChange({
|
|
34384
|
+
padding: value
|
|
34385
|
+
});
|
|
34386
|
+
}
|
|
33852
34387
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
33853
34388
|
}
|
|
33854
34389
|
onLabelChange = (index, e) => {
|
|
@@ -34001,7 +34536,6 @@ class MatrixEditor extends React__namespace.Component {
|
|
|
34001
34536
|
const {
|
|
34002
34537
|
InfoTip: InfoTip$9,
|
|
34003
34538
|
NumberInput: NumberInput$7,
|
|
34004
|
-
PropCheckBox: PropCheckBox$5,
|
|
34005
34539
|
RangeInput: RangeInput$2
|
|
34006
34540
|
} = perseus.components;
|
|
34007
34541
|
const defaultImage = {
|
|
@@ -34075,16 +34609,24 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
34075
34609
|
className: "perseus-widget-row"
|
|
34076
34610
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34077
34611
|
className: "perseus-widget-left-col"
|
|
34078
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34612
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34079
34613
|
label: "Show ruler",
|
|
34080
|
-
|
|
34081
|
-
onChange:
|
|
34614
|
+
checked: this.props.showRuler,
|
|
34615
|
+
onChange: value => {
|
|
34616
|
+
this.props.onChange({
|
|
34617
|
+
showRuler: value
|
|
34618
|
+
});
|
|
34619
|
+
}
|
|
34082
34620
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34083
34621
|
className: "perseus-widget-right-col"
|
|
34084
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34622
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34085
34623
|
label: "Show protractor",
|
|
34086
|
-
|
|
34087
|
-
onChange:
|
|
34624
|
+
checked: this.props.showProtractor,
|
|
34625
|
+
onChange: value => {
|
|
34626
|
+
this.props.onChange({
|
|
34627
|
+
showProtractor: value
|
|
34628
|
+
});
|
|
34629
|
+
}
|
|
34088
34630
|
}))), this.props.showRuler && /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, " ", "Ruler label:", " ", /*#__PURE__*/React__namespace.createElement("select", {
|
|
34089
34631
|
onChange: e =>
|
|
34090
34632
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
|
|
@@ -34211,7 +34753,6 @@ const {
|
|
|
34211
34753
|
ButtonGroup: ButtonGroup$1,
|
|
34212
34754
|
InfoTip: InfoTip$8,
|
|
34213
34755
|
NumberInput: NumberInput$5,
|
|
34214
|
-
PropCheckBox: PropCheckBox$4,
|
|
34215
34756
|
RangeInput: RangeInput$1
|
|
34216
34757
|
} = perseus.components;
|
|
34217
34758
|
const bound = (x, gt, lt) => Math.min(Math.max(x, gt), lt);
|
|
@@ -34451,22 +34992,34 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34451
34992
|
className: "perseus-widget-row"
|
|
34452
34993
|
}, !this.props.static && /*#__PURE__*/React__namespace.createElement("div", {
|
|
34453
34994
|
className: "perseus-widget-left-col"
|
|
34454
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34995
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34455
34996
|
label: "Show tick controller",
|
|
34456
|
-
|
|
34457
|
-
onChange:
|
|
34997
|
+
checked: this.props.isTickCtrl,
|
|
34998
|
+
onChange: value => {
|
|
34999
|
+
this.props.onChange({
|
|
35000
|
+
isTickCtrl: value
|
|
35001
|
+
});
|
|
35002
|
+
}
|
|
34458
35003
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34459
35004
|
className: "perseus-widget-right-col"
|
|
34460
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35005
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34461
35006
|
label: "Show label ticks",
|
|
34462
|
-
|
|
34463
|
-
onChange:
|
|
35007
|
+
checked: this.props.labelTicks,
|
|
35008
|
+
onChange: value => {
|
|
35009
|
+
this.props.onChange({
|
|
35010
|
+
labelTicks: value
|
|
35011
|
+
});
|
|
35012
|
+
}
|
|
34464
35013
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34465
35014
|
className: "perseus-widget-row"
|
|
34466
|
-
}, !this.props.static && /*#__PURE__*/React__namespace.createElement(
|
|
35015
|
+
}, !this.props.static && /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34467
35016
|
label: "Show tooltips",
|
|
34468
|
-
|
|
34469
|
-
onChange:
|
|
35017
|
+
checked: this.props.showTooltips,
|
|
35018
|
+
onChange: value => {
|
|
35019
|
+
this.props.onChange({
|
|
35020
|
+
showTooltips: value
|
|
35021
|
+
});
|
|
35022
|
+
}
|
|
34470
35023
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34471
35024
|
className: "perseus-widget-row"
|
|
34472
35025
|
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
@@ -34517,7 +35070,6 @@ const {
|
|
|
34517
35070
|
InlineIcon: InlineIcon$1,
|
|
34518
35071
|
MultiButtonGroup,
|
|
34519
35072
|
NumberInput: NumberInput$4,
|
|
34520
|
-
PropCheckBox: PropCheckBox$3,
|
|
34521
35073
|
TextInput: TextInput$3
|
|
34522
35074
|
} = perseus.components;
|
|
34523
35075
|
const {
|
|
@@ -34611,12 +35163,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34611
35163
|
onChange: this.updateAnswer(i, "answerForms") || (() => {})
|
|
34612
35164
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Formats will be autoselected for you based on the given answer; to show no suggested formats and accept all types, simply have a decimal/integer be the answer. Values with \u03C0 will have format \"pi\", and values that are fractions will have some subset (mixed will be \"mixed\" and \"proper\"; improper/proper will both be \"improper\" and \"proper\"). If you would like to specify that it is only a proper fraction (or only a mixed/improper fraction), deselect the other format. Except for specific cases, you should not need to change the autoselected formats."), /*#__PURE__*/React__namespace.createElement("p", null, "To restrict the answer to ", /*#__PURE__*/React__namespace.createElement("em", null, "only"), " an improper fraction (i.e. 7/4), select the improper fraction and toggle \"strict\" to true. This ", /*#__PURE__*/React__namespace.createElement("b", null, "will not"), " ", "accept 1.75 as an answer.", " "), /*#__PURE__*/React__namespace.createElement("p", null, "Unless you are testing that specific skill, please do not restrict the answer format."))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34613
35165
|
className: "perseus-widget-row"
|
|
34614
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35166
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34615
35167
|
label: "Strictly match only these formats",
|
|
34616
|
-
|
|
34617
|
-
|
|
34618
|
-
|
|
34619
|
-
|
|
35168
|
+
checked: answers[i]["strict"],
|
|
35169
|
+
onChange: value => {
|
|
35170
|
+
this.updateAnswer.bind(this, i)({
|
|
35171
|
+
strict: value
|
|
35172
|
+
});
|
|
35173
|
+
}
|
|
34620
35174
|
})));
|
|
34621
35175
|
const maxError = i => /*#__PURE__*/React__namespace.createElement("div", {
|
|
34622
35176
|
className: "perseus-widget-row"
|
|
@@ -34642,10 +35196,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34642
35196
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them.")));
|
|
34643
35197
|
const rightAlign = /*#__PURE__*/React__namespace.createElement("div", {
|
|
34644
35198
|
className: "perseus-widget-row"
|
|
34645
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35199
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34646
35200
|
label: "Right alignment",
|
|
34647
|
-
|
|
34648
|
-
onChange:
|
|
35201
|
+
checked: this.props.rightAlign,
|
|
35202
|
+
onChange: value => {
|
|
35203
|
+
this.props.onChange({
|
|
35204
|
+
rightAlign: value
|
|
35205
|
+
});
|
|
35206
|
+
}
|
|
34649
35207
|
}));
|
|
34650
35208
|
const labelText = /*#__PURE__*/React__namespace.createElement("div", {
|
|
34651
35209
|
className: "perseus-widget-row"
|
|
@@ -34655,10 +35213,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34655
35213
|
})), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "Text to describe this input. This will be shown to users using screenreaders.")));
|
|
34656
35214
|
const coefficientCheck = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34657
35215
|
className: "perseus-widget-row"
|
|
34658
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35216
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34659
35217
|
label: "Coefficient",
|
|
34660
|
-
|
|
34661
|
-
onChange:
|
|
35218
|
+
checked: this.props.coefficient,
|
|
35219
|
+
onChange: value => {
|
|
35220
|
+
this.props.onChange({
|
|
35221
|
+
coefficient: value
|
|
35222
|
+
});
|
|
35223
|
+
}
|
|
34662
35224
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$7, null, /*#__PURE__*/React__namespace.createElement("p", null, "A coefficient style number allows the student to use - for -1 and an empty string to mean 1."))));
|
|
34663
35225
|
const addAnswerButton = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
34664
35226
|
href: "#",
|
|
@@ -35009,8 +35571,7 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
35009
35571
|
}
|
|
35010
35572
|
|
|
35011
35573
|
const {
|
|
35012
|
-
InfoTip: InfoTip$5
|
|
35013
|
-
PropCheckBox: PropCheckBox$2
|
|
35574
|
+
InfoTip: InfoTip$5
|
|
35014
35575
|
} = perseus.components;
|
|
35015
35576
|
class PassageEditor extends React__namespace.Component {
|
|
35016
35577
|
static propTypes = {
|
|
@@ -35075,11 +35636,14 @@ class PassageEditor extends React__namespace.Component {
|
|
|
35075
35636
|
className: "perseus-widget-passage-editor"
|
|
35076
35637
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
35077
35638
|
className: "perseus-widget-row"
|
|
35078
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35639
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35079
35640
|
label: "Show line numbers",
|
|
35080
|
-
|
|
35081
|
-
|
|
35082
|
-
|
|
35641
|
+
checked: this.props.showLineNumbers,
|
|
35642
|
+
onChange: value => {
|
|
35643
|
+
this.props.onChange({
|
|
35644
|
+
showLineNumbers: value
|
|
35645
|
+
});
|
|
35646
|
+
}
|
|
35083
35647
|
})), /*#__PURE__*/React__namespace.createElement("div", null, "Passage title:", /*#__PURE__*/React__namespace.createElement(InfoTip$5, null, /*#__PURE__*/React__namespace.createElement("p", null, "An optional title that will appear directly above the passage in the same font style. (E.g. Passage 1)")), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("input", {
|
|
35084
35648
|
type: "text",
|
|
35085
35649
|
defaultValue: this.props.passageTitle,
|
|
@@ -35551,8 +36115,7 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
35551
36115
|
|
|
35552
36116
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/forbid-prop-types, react/sort-comp */
|
|
35553
36117
|
const {
|
|
35554
|
-
InlineIcon
|
|
35555
|
-
PropCheckBox: PropCheckBox$1
|
|
36118
|
+
InlineIcon
|
|
35556
36119
|
} = perseus.components;
|
|
35557
36120
|
const {
|
|
35558
36121
|
iconPlus,
|
|
@@ -35656,25 +36219,34 @@ class RadioEditor extends React__namespace.Component {
|
|
|
35656
36219
|
target: "_blank"
|
|
35657
36220
|
}, "Multiple choice style guide"), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("div", {
|
|
35658
36221
|
className: "perseus-widget-left-col"
|
|
35659
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36222
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35660
36223
|
label: "Multiple selections",
|
|
35661
|
-
|
|
35662
|
-
|
|
35663
|
-
|
|
36224
|
+
checked: this.props.multipleSelect,
|
|
36225
|
+
onChange: value => {
|
|
36226
|
+
this.onMultipleSelectChange({
|
|
36227
|
+
multipleSelect: value
|
|
36228
|
+
});
|
|
36229
|
+
}
|
|
35664
36230
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
35665
36231
|
className: "perseus-widget-right-col"
|
|
35666
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36232
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35667
36233
|
label: "Randomize order",
|
|
35668
|
-
|
|
35669
|
-
|
|
35670
|
-
|
|
36234
|
+
checked: this.props.randomize,
|
|
36235
|
+
onChange: value => {
|
|
36236
|
+
this.props.onChange({
|
|
36237
|
+
randomize: value
|
|
36238
|
+
});
|
|
36239
|
+
}
|
|
35671
36240
|
})), this.props.multipleSelect && /*#__PURE__*/React__namespace.createElement("div", {
|
|
35672
36241
|
className: "perseus-widget-left-col"
|
|
35673
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36242
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35674
36243
|
label: "Specify number correct",
|
|
35675
|
-
|
|
35676
|
-
|
|
35677
|
-
|
|
36244
|
+
checked: this.props.countChoices,
|
|
36245
|
+
onChange: value => {
|
|
36246
|
+
this.onCountChoicesChange({
|
|
36247
|
+
countChoices: value
|
|
36248
|
+
});
|
|
36249
|
+
}
|
|
35678
36250
|
}))), /*#__PURE__*/React__namespace.createElement(perseus.BaseRadio, {
|
|
35679
36251
|
multipleSelect: this.props.multipleSelect,
|
|
35680
36252
|
countChoices: this.props.countChoices,
|
|
@@ -35903,7 +36475,6 @@ class SimpleMarkdownTesterEditor extends React__namespace.Component {
|
|
|
35903
36475
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
35904
36476
|
const {
|
|
35905
36477
|
InfoTip: InfoTip$2,
|
|
35906
|
-
PropCheckBox,
|
|
35907
36478
|
TextListEditor
|
|
35908
36479
|
} = perseus.components;
|
|
35909
36480
|
const HORIZONTAL = "horizontal";
|
|
@@ -35949,10 +36520,14 @@ class SorterEditor extends React__namespace.Component {
|
|
|
35949
36520
|
value: HORIZONTAL
|
|
35950
36521
|
}, "Horizontal"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
35951
36522
|
value: VERTICAL
|
|
35952
|
-
}, "Vertical"))), /*#__PURE__*/React__namespace.createElement(InfoTip$2, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the horizontal layout for short text and small images. The vertical layout is best for longer text and larger images."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(
|
|
36523
|
+
}, "Vertical"))), /*#__PURE__*/React__namespace.createElement(InfoTip$2, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the horizontal layout for short text and small images. The vertical layout is best for longer text and larger images."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35953
36524
|
label: "Padding:",
|
|
35954
|
-
|
|
35955
|
-
onChange:
|
|
36525
|
+
checked: this.props.padding,
|
|
36526
|
+
onChange: value => {
|
|
36527
|
+
this.props.onChange({
|
|
36528
|
+
padding: value
|
|
36529
|
+
});
|
|
36530
|
+
}
|
|
35956
36531
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$2, null, /*#__PURE__*/React__namespace.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
35957
36532
|
}
|
|
35958
36533
|
}
|