@khanacademy/perseus-editor 11.2.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-settings.d.ts +2 -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/util.d.ts +1 -0
- 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 +864 -440
- 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 +861 -435
- package/dist/index.js.map +1 -1
- package/dist/item-editor.d.ts +2 -2
- package/dist/widgets/interactive-graph-editor.d.ts +517 -129
- 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
|
|
@@ -29773,6 +29806,25 @@ function getDefaultGraphStartCoords(graph, range, step) {
|
|
|
29773
29806
|
...graph,
|
|
29774
29807
|
startCoords: undefined
|
|
29775
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
|
+
});
|
|
29776
29828
|
default:
|
|
29777
29829
|
return undefined;
|
|
29778
29830
|
}
|
|
@@ -29804,6 +29856,35 @@ const getQuadraticEquation = startCoords => {
|
|
|
29804
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;
|
|
29805
29857
|
return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
|
|
29806
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
|
+
};
|
|
29807
29888
|
|
|
29808
29889
|
/**
|
|
29809
29890
|
* Dropdown for selecting a locked figure to add to an interactive graph.
|
|
@@ -29820,17 +29901,17 @@ const LockedFigureSelect = props => {
|
|
|
29820
29901
|
const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
|
|
29821
29902
|
const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
|
|
29822
29903
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29823
|
-
style: styles$
|
|
29904
|
+
style: styles$E.container
|
|
29824
29905
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
29825
29906
|
menuText: "Add locked figure",
|
|
29826
|
-
style: styles$
|
|
29907
|
+
style: styles$E.addElementSelect
|
|
29827
29908
|
}, figureTypesCurrent.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
29828
29909
|
key: `${id}-${figureType}`,
|
|
29829
29910
|
label: figureType,
|
|
29830
29911
|
onClick: () => onChange(figureType)
|
|
29831
29912
|
}))));
|
|
29832
29913
|
};
|
|
29833
|
-
const styles$
|
|
29914
|
+
const styles$E = aphrodite.StyleSheet.create({
|
|
29834
29915
|
container: {
|
|
29835
29916
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
29836
29917
|
},
|
|
@@ -29840,6 +29921,45 @@ const styles$B = aphrodite.StyleSheet.create({
|
|
|
29840
29921
|
}
|
|
29841
29922
|
});
|
|
29842
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
|
+
|
|
29843
29963
|
const AngleInput = props => {
|
|
29844
29964
|
const {
|
|
29845
29965
|
angle,
|
|
@@ -29861,19 +29981,18 @@ const AngleInput = props => {
|
|
|
29861
29981
|
}
|
|
29862
29982
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29863
29983
|
tag: "label",
|
|
29864
|
-
style: styles$
|
|
29984
|
+
style: styles$D.row
|
|
29865
29985
|
}, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29866
29986
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29867
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29868
|
-
type: "number",
|
|
29987
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29869
29988
|
value: angleInput,
|
|
29870
29989
|
onChange: handleAngleChange,
|
|
29871
|
-
style: styles$
|
|
29990
|
+
style: styles$D.textField
|
|
29872
29991
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29873
29992
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29874
29993
|
}));
|
|
29875
29994
|
};
|
|
29876
|
-
const styles$
|
|
29995
|
+
const styles$D = aphrodite.StyleSheet.create({
|
|
29877
29996
|
row: {
|
|
29878
29997
|
display: "flex",
|
|
29879
29998
|
flexDirection: "row",
|
|
@@ -29922,32 +30041,30 @@ const CoordinatePairInput = props => {
|
|
|
29922
30041
|
onChange(newCoords);
|
|
29923
30042
|
}
|
|
29924
30043
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29925
|
-
style: [styles$
|
|
30044
|
+
style: [styles$C.row, style]
|
|
29926
30045
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29927
30046
|
tag: "label",
|
|
29928
|
-
style: styles$
|
|
30047
|
+
style: styles$C.row
|
|
29929
30048
|
}, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29930
30049
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29931
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29932
|
-
type: "number",
|
|
30050
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29933
30051
|
value: coordState[0],
|
|
29934
30052
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
29935
|
-
style: [styles$
|
|
30053
|
+
style: [styles$C.textField, error ? styles$C.errorField : undefined]
|
|
29936
30054
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29937
30055
|
size: wonderBlocksTokens.spacing.medium_16
|
|
29938
30056
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
29939
30057
|
tag: "label",
|
|
29940
|
-
style: styles$
|
|
30058
|
+
style: styles$C.row
|
|
29941
30059
|
}, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
29942
30060
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
29943
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
29944
|
-
type: "number",
|
|
30061
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
29945
30062
|
value: coordState[1],
|
|
29946
30063
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
29947
|
-
style: [styles$
|
|
30064
|
+
style: [styles$C.textField, error ? styles$C.errorField : undefined]
|
|
29948
30065
|
})));
|
|
29949
30066
|
};
|
|
29950
|
-
const styles$
|
|
30067
|
+
const styles$C = aphrodite.StyleSheet.create({
|
|
29951
30068
|
row: {
|
|
29952
30069
|
display: "flex",
|
|
29953
30070
|
flexDirection: "row",
|
|
@@ -29980,14 +30097,14 @@ const PerseusEditorAccordion = props => {
|
|
|
29980
30097
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
29981
30098
|
expanded: expanded,
|
|
29982
30099
|
onToggle: onToggle,
|
|
29983
|
-
style: [styles$
|
|
29984
|
-
headerStyle: styles$
|
|
30100
|
+
style: [styles$B.container, containerStyle],
|
|
30101
|
+
headerStyle: styles$B.accordionHeader,
|
|
29985
30102
|
header: header
|
|
29986
30103
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29987
|
-
style: [styles$
|
|
30104
|
+
style: [styles$B.accordionPanel, panelStyle]
|
|
29988
30105
|
}, children)));
|
|
29989
30106
|
};
|
|
29990
|
-
const styles$
|
|
30107
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
29991
30108
|
container: {
|
|
29992
30109
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
29993
30110
|
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
@@ -30018,13 +30135,13 @@ const ColorSwatch = props => {
|
|
|
30018
30135
|
"aria-label":
|
|
30019
30136
|
// Don't include an aria label for decorative circles.
|
|
30020
30137
|
!decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
30021
|
-
style: [styles$
|
|
30138
|
+
style: [styles$A.colorSwatch, {
|
|
30022
30139
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
30023
30140
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
30024
30141
|
}]
|
|
30025
30142
|
});
|
|
30026
30143
|
};
|
|
30027
|
-
const styles$
|
|
30144
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
30028
30145
|
colorSwatch: {
|
|
30029
30146
|
// Add a white outline so that the color swatch is visible when
|
|
30030
30147
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30043,10 +30160,10 @@ const ColorSelect = props => {
|
|
|
30043
30160
|
onChange
|
|
30044
30161
|
} = props;
|
|
30045
30162
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30046
|
-
style: [styles$
|
|
30163
|
+
style: [styles$z.row, style]
|
|
30047
30164
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30048
30165
|
tag: "label",
|
|
30049
|
-
style: styles$
|
|
30166
|
+
style: styles$z.row
|
|
30050
30167
|
}, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30051
30168
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30052
30169
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30065,11 +30182,14 @@ const ColorSelect = props => {
|
|
|
30065
30182
|
})
|
|
30066
30183
|
})))));
|
|
30067
30184
|
};
|
|
30068
|
-
const styles$
|
|
30185
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
30069
30186
|
row: {
|
|
30070
30187
|
display: "flex",
|
|
30071
30188
|
flexDirection: "row",
|
|
30072
|
-
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"
|
|
30073
30193
|
}
|
|
30074
30194
|
});
|
|
30075
30195
|
|
|
@@ -30081,17 +30201,17 @@ const EllipseSwatch = props => {
|
|
|
30081
30201
|
} = props;
|
|
30082
30202
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30083
30203
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30084
|
-
style: [styles$
|
|
30204
|
+
style: [styles$y.container, {
|
|
30085
30205
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30086
30206
|
}]
|
|
30087
30207
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30088
|
-
style: [styles$
|
|
30208
|
+
style: [styles$y.innerCircle, {
|
|
30089
30209
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30090
|
-
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
30210
|
+
opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
|
|
30091
30211
|
}]
|
|
30092
30212
|
}));
|
|
30093
30213
|
};
|
|
30094
|
-
const styles$
|
|
30214
|
+
const styles$y = aphrodite.StyleSheet.create({
|
|
30095
30215
|
container: {
|
|
30096
30216
|
// Add a white outline so that the color swatch is visible when
|
|
30097
30217
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30110,6 +30230,40 @@ const styles$v = aphrodite.StyleSheet.create({
|
|
|
30110
30230
|
}
|
|
30111
30231
|
});
|
|
30112
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
|
+
|
|
30113
30267
|
/**
|
|
30114
30268
|
* The part of a locked figure settings panel that contains actions
|
|
30115
30269
|
* for this panel and its associated locked figure, including
|
|
@@ -30122,40 +30276,40 @@ const LockedFigureSettingsActions = props => {
|
|
|
30122
30276
|
onRemove
|
|
30123
30277
|
} = props;
|
|
30124
30278
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30125
|
-
style: styles$
|
|
30279
|
+
style: styles$w.container
|
|
30126
30280
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30127
30281
|
startIcon: trashIcon__default["default"],
|
|
30128
30282
|
"aria-label": `Delete locked ${figureType}`,
|
|
30129
30283
|
onClick: onRemove,
|
|
30130
30284
|
kind: "tertiary",
|
|
30131
|
-
style: styles$
|
|
30285
|
+
style: styles$w.deleteButton
|
|
30132
30286
|
}, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30133
30287
|
icon: caretDoubleUpIcon__default["default"],
|
|
30134
30288
|
size: "small",
|
|
30135
30289
|
"aria-label": `Move locked ${figureType} to the back`,
|
|
30136
30290
|
onClick: () => onMove("back"),
|
|
30137
|
-
style: styles$
|
|
30291
|
+
style: styles$w.iconButton
|
|
30138
30292
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30139
30293
|
icon: caretUpIcon__default["default"],
|
|
30140
30294
|
size: "small",
|
|
30141
30295
|
"aria-label": `Move locked ${figureType} backward`,
|
|
30142
30296
|
onClick: () => onMove("backward"),
|
|
30143
|
-
style: styles$
|
|
30297
|
+
style: styles$w.iconButton
|
|
30144
30298
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30145
30299
|
icon: caretDownIcon__default["default"],
|
|
30146
30300
|
size: "small",
|
|
30147
30301
|
"aria-label": `Move locked ${figureType} forward`,
|
|
30148
30302
|
onClick: () => onMove("forward"),
|
|
30149
|
-
style: styles$
|
|
30303
|
+
style: styles$w.iconButton
|
|
30150
30304
|
}), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
|
|
30151
30305
|
icon: caretDoubleDownIcon__default["default"],
|
|
30152
30306
|
size: "small",
|
|
30153
30307
|
"aria-label": `Move locked ${figureType} to the front`,
|
|
30154
30308
|
onClick: () => onMove("front"),
|
|
30155
|
-
style: styles$
|
|
30309
|
+
style: styles$w.iconButton
|
|
30156
30310
|
}));
|
|
30157
30311
|
};
|
|
30158
|
-
const styles$
|
|
30312
|
+
const styles$w = aphrodite.StyleSheet.create({
|
|
30159
30313
|
container: {
|
|
30160
30314
|
width: "100%",
|
|
30161
30315
|
flexDirection: "row",
|
|
@@ -30202,7 +30356,7 @@ const LockedEllipseSettings = props => {
|
|
|
30202
30356
|
/*#__PURE__*/
|
|
30203
30357
|
// Summary: Ellipse, center, radius, color (opacity, dashed)
|
|
30204
30358
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30205
|
-
style: styles$
|
|
30359
|
+
style: styles$v.row
|
|
30206
30360
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30207
30361
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30208
30362
|
}), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
|
|
@@ -30211,19 +30365,19 @@ const LockedEllipseSettings = props => {
|
|
|
30211
30365
|
strokeStyle: strokeStyle
|
|
30212
30366
|
}))
|
|
30213
30367
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30214
|
-
style: styles$
|
|
30368
|
+
style: styles$v.row
|
|
30215
30369
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30216
30370
|
coord: center,
|
|
30217
|
-
style: styles$
|
|
30371
|
+
style: styles$v.spaceUnder,
|
|
30218
30372
|
onChange: newCoords => onChangeProps({
|
|
30219
30373
|
center: newCoords
|
|
30220
30374
|
})
|
|
30221
30375
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30222
|
-
style: styles$
|
|
30376
|
+
style: styles$v.spaceUnder
|
|
30223
30377
|
}, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30224
30378
|
coord: radius,
|
|
30225
30379
|
labels: ["x radius", "y radius"],
|
|
30226
|
-
style: styles$
|
|
30380
|
+
style: styles$v.spaceUnder,
|
|
30227
30381
|
onChange: newCoords => onChangeProps({
|
|
30228
30382
|
radius: newCoords
|
|
30229
30383
|
})
|
|
@@ -30235,7 +30389,7 @@ const LockedEllipseSettings = props => {
|
|
|
30235
30389
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30236
30390
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30237
30391
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30238
|
-
style: [styles$
|
|
30392
|
+
style: [styles$v.row, styles$v.spaceUnder]
|
|
30239
30393
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30240
30394
|
selectedValue: color,
|
|
30241
30395
|
onChange: handleColorChange
|
|
@@ -30243,7 +30397,7 @@ const LockedEllipseSettings = props => {
|
|
|
30243
30397
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30244
30398
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30245
30399
|
tag: "label",
|
|
30246
|
-
style: styles$
|
|
30400
|
+
style: [styles$v.row, styles$v.truncatedWidth]
|
|
30247
30401
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30248
30402
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30249
30403
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30258,25 +30412,200 @@ const LockedEllipseSettings = props => {
|
|
|
30258
30412
|
key: option,
|
|
30259
30413
|
value: option,
|
|
30260
30414
|
label: option
|
|
30261
|
-
}))))), /*#__PURE__*/React__namespace.createElement(
|
|
30262
|
-
tag: "label",
|
|
30263
|
-
style: styles$t.row
|
|
30264
|
-
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30265
|
-
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30266
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30415
|
+
}))))), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30267
30416
|
selectedValue: strokeStyle,
|
|
30268
30417
|
onChange: value => onChangeProps({
|
|
30269
30418
|
strokeStyle: value
|
|
30270
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
|
|
30271
30561
|
// Placeholder is required, but never gets used.
|
|
30272
30562
|
,
|
|
30273
30563
|
placeholder: ""
|
|
30274
30564
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30275
|
-
value: "
|
|
30276
|
-
label: "
|
|
30565
|
+
value: "x",
|
|
30566
|
+
label: "y ="
|
|
30277
30567
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30278
|
-
value: "
|
|
30279
|
-
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
|
+
}
|
|
30280
30609
|
}))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30281
30610
|
figureType: props.type,
|
|
30282
30611
|
onMove: onMove,
|
|
@@ -30284,13 +30613,57 @@ const LockedEllipseSettings = props => {
|
|
|
30284
30613
|
}));
|
|
30285
30614
|
};
|
|
30286
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
|
+
},
|
|
30287
30660
|
row: {
|
|
30288
30661
|
display: "flex",
|
|
30289
30662
|
flexDirection: "row",
|
|
30290
30663
|
alignItems: "center"
|
|
30291
30664
|
},
|
|
30292
|
-
|
|
30293
|
-
|
|
30665
|
+
textField: {
|
|
30666
|
+
flexGrow: "1"
|
|
30294
30667
|
}
|
|
30295
30668
|
});
|
|
30296
30669
|
|
|
@@ -30412,32 +30785,6 @@ const styles$r = aphrodite.StyleSheet.create({
|
|
|
30412
30785
|
}
|
|
30413
30786
|
});
|
|
30414
30787
|
|
|
30415
|
-
const LineSwatch = props => {
|
|
30416
|
-
const {
|
|
30417
|
-
color,
|
|
30418
|
-
lineStyle
|
|
30419
|
-
} = props;
|
|
30420
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30421
|
-
style: styles$q.container
|
|
30422
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30423
|
-
"aria-label": `${color}, ${lineStyle}`,
|
|
30424
|
-
style: [styles$q.lineSwatch, {
|
|
30425
|
-
border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
|
|
30426
|
-
}]
|
|
30427
|
-
}));
|
|
30428
|
-
};
|
|
30429
|
-
const styles$q = aphrodite.StyleSheet.create({
|
|
30430
|
-
container: {
|
|
30431
|
-
backgroundColor: wonderBlocksTokens.color.white,
|
|
30432
|
-
justifyContent: "center",
|
|
30433
|
-
padding: wonderBlocksTokens.spacing.xSmall_8,
|
|
30434
|
-
borderRadius: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30435
|
-
},
|
|
30436
|
-
lineSwatch: {
|
|
30437
|
-
width: 40
|
|
30438
|
-
}
|
|
30439
|
-
});
|
|
30440
|
-
|
|
30441
30788
|
const lengthZeroStr = "The line cannot have length 0.";
|
|
30442
30789
|
const LockedLineSettings = props => {
|
|
30443
30790
|
const {
|
|
@@ -30485,7 +30832,7 @@ const LockedLineSettings = props => {
|
|
|
30485
30832
|
expanded: props.expanded,
|
|
30486
30833
|
onToggle: props.onToggle,
|
|
30487
30834
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30488
|
-
style: styles$
|
|
30835
|
+
style: styles$q.row
|
|
30489
30836
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30490
30837
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30491
30838
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30494,7 +30841,7 @@ const LockedLineSettings = props => {
|
|
|
30494
30841
|
}))
|
|
30495
30842
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30496
30843
|
tag: "label",
|
|
30497
|
-
style: [styles$
|
|
30844
|
+
style: [styles$q.row, styles$q.spaceUnder]
|
|
30498
30845
|
}, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30499
30846
|
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30500
30847
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30515,34 +30862,19 @@ const LockedLineSettings = props => {
|
|
|
30515
30862
|
value: "segment",
|
|
30516
30863
|
label: "segment"
|
|
30517
30864
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30518
|
-
style: styles$
|
|
30865
|
+
style: styles$q.row
|
|
30519
30866
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30520
30867
|
selectedValue: lineColor,
|
|
30521
30868
|
onChange: handleColorChange
|
|
30522
30869
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30523
30870
|
size: wonderBlocksTokens.spacing.small_12
|
|
30524
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
30525
|
-
tag: "label",
|
|
30526
|
-
style: styles$p.row
|
|
30527
|
-
}, "style", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30528
|
-
size: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30529
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30871
|
+
}), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30530
30872
|
selectedValue: lineStyle,
|
|
30531
30873
|
onChange: value => onChangeProps({
|
|
30532
30874
|
lineStyle: value
|
|
30533
30875
|
})
|
|
30534
|
-
|
|
30535
|
-
|
|
30536
|
-
placeholder: "",
|
|
30537
|
-
style: styles$p.selectMarginOffset
|
|
30538
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30539
|
-
value: "solid",
|
|
30540
|
-
label: "solid"
|
|
30541
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30542
|
-
value: "dashed",
|
|
30543
|
-
label: "dashed"
|
|
30544
|
-
})))), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30545
|
-
style: styles$p.errorText
|
|
30876
|
+
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30877
|
+
style: styles$q.errorText
|
|
30546
30878
|
}, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
|
|
30547
30879
|
label: "Point 1",
|
|
30548
30880
|
showPoint: showPoint1,
|
|
@@ -30567,7 +30899,7 @@ const LockedLineSettings = props => {
|
|
|
30567
30899
|
onRemove: onRemove
|
|
30568
30900
|
}));
|
|
30569
30901
|
};
|
|
30570
|
-
const styles$
|
|
30902
|
+
const styles$q = aphrodite.StyleSheet.create({
|
|
30571
30903
|
row: {
|
|
30572
30904
|
display: "flex",
|
|
30573
30905
|
flexDirection: "row",
|
|
@@ -30576,10 +30908,6 @@ const styles$p = aphrodite.StyleSheet.create({
|
|
|
30576
30908
|
spaceUnder: {
|
|
30577
30909
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30578
30910
|
},
|
|
30579
|
-
selectMarginOffset: {
|
|
30580
|
-
// Align with the point settings accordions.
|
|
30581
|
-
marginInlineEnd: -wonderBlocksTokens.spacing.xxxSmall_4
|
|
30582
|
-
},
|
|
30583
30911
|
errorText: {
|
|
30584
30912
|
color: wonderBlocksTokens.color.red
|
|
30585
30913
|
}
|
|
@@ -30612,7 +30940,7 @@ const LockedPointSettings = props => {
|
|
|
30612
30940
|
/*#__PURE__*/
|
|
30613
30941
|
// Summary: Point, coords, color (filled/open)
|
|
30614
30942
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30615
|
-
style: styles$
|
|
30943
|
+
style: styles$p.row
|
|
30616
30944
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30617
30945
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30618
30946
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30621,7 +30949,7 @@ const LockedPointSettings = props => {
|
|
|
30621
30949
|
}))
|
|
30622
30950
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30623
30951
|
coord: coord,
|
|
30624
|
-
style: styles$
|
|
30952
|
+
style: styles$p.spaceUnder,
|
|
30625
30953
|
onChange: newCoord => {
|
|
30626
30954
|
onChangeProps({
|
|
30627
30955
|
coord: newCoord
|
|
@@ -30630,7 +30958,7 @@ const LockedPointSettings = props => {
|
|
|
30630
30958
|
}), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30631
30959
|
selectedValue: pointColor,
|
|
30632
30960
|
onChange: handleColorChange,
|
|
30633
|
-
style: styles$
|
|
30961
|
+
style: styles$p.spaceUnder
|
|
30634
30962
|
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30635
30963
|
label: "open point",
|
|
30636
30964
|
checked: !filled,
|
|
@@ -30645,7 +30973,7 @@ const LockedPointSettings = props => {
|
|
|
30645
30973
|
onRemove: onRemove
|
|
30646
30974
|
}));
|
|
30647
30975
|
};
|
|
30648
|
-
const styles$
|
|
30976
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
30649
30977
|
row: {
|
|
30650
30978
|
flexDirection: "row",
|
|
30651
30979
|
alignItems: "center"
|
|
@@ -30663,17 +30991,17 @@ const PolygonSwatch = props => {
|
|
|
30663
30991
|
} = props;
|
|
30664
30992
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30665
30993
|
"aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
|
|
30666
|
-
style: [styles$
|
|
30994
|
+
style: [styles$o.container, {
|
|
30667
30995
|
border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
|
|
30668
30996
|
}]
|
|
30669
30997
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30670
|
-
style: [styles$
|
|
30998
|
+
style: [styles$o.innerSquare, {
|
|
30671
30999
|
backgroundColor: perseus.lockedFigureColors[color],
|
|
30672
|
-
opacity: perseus.lockedFigureFillStyles[fillStyle]
|
|
31000
|
+
opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
|
|
30673
31001
|
}]
|
|
30674
31002
|
}));
|
|
30675
31003
|
};
|
|
30676
|
-
const styles$
|
|
31004
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
30677
31005
|
container: {
|
|
30678
31006
|
// Add a white outline so that the color swatch is visible when
|
|
30679
31007
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30715,7 +31043,7 @@ const LockedPolygonSettings = props => {
|
|
|
30715
31043
|
/*#__PURE__*/
|
|
30716
31044
|
// Summary: Polygon, number of sides, style swatch
|
|
30717
31045
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30718
|
-
style: styles$
|
|
31046
|
+
style: styles$n.row
|
|
30719
31047
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30720
31048
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30721
31049
|
}), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
|
|
@@ -30724,7 +31052,7 @@ const LockedPolygonSettings = props => {
|
|
|
30724
31052
|
strokeStyle: strokeStyle
|
|
30725
31053
|
}))
|
|
30726
31054
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30727
|
-
style: [styles$
|
|
31055
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
30728
31056
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30729
31057
|
selectedValue: color,
|
|
30730
31058
|
onChange: handleColorChange
|
|
@@ -30732,7 +31060,7 @@ const LockedPolygonSettings = props => {
|
|
|
30732
31060
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30733
31061
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30734
31062
|
tag: "label",
|
|
30735
|
-
style: styles$
|
|
31063
|
+
style: [styles$n.row, styles$n.truncatedWidth]
|
|
30736
31064
|
}, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30737
31065
|
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30738
31066
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
@@ -30747,42 +31075,28 @@ const LockedPolygonSettings = props => {
|
|
|
30747
31075
|
key: option,
|
|
30748
31076
|
value: option,
|
|
30749
31077
|
label: option
|
|
30750
|
-
}))))), /*#__PURE__*/React__namespace.createElement(
|
|
30751
|
-
tag: "label",
|
|
30752
|
-
style: [styles$m.row, styles$m.spaceUnder]
|
|
30753
|
-
}, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30754
|
-
size: wonderBlocksTokens.spacing.xxSmall_6
|
|
30755
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
31078
|
+
}))))), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
|
|
30756
31079
|
selectedValue: strokeStyle,
|
|
30757
31080
|
onChange: value => onChangeProps({
|
|
30758
31081
|
strokeStyle: value
|
|
30759
31082
|
})
|
|
30760
|
-
|
|
30761
|
-
,
|
|
30762
|
-
placeholder: ""
|
|
30763
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30764
|
-
value: "solid",
|
|
30765
|
-
label: "solid"
|
|
30766
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30767
|
-
value: "dashed",
|
|
30768
|
-
label: "dashed"
|
|
30769
|
-
}))), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
31083
|
+
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30770
31084
|
label: "show vertices",
|
|
30771
31085
|
checked: showVertices,
|
|
30772
31086
|
onChange: newValue => onChangeProps({
|
|
30773
31087
|
showVertices: newValue
|
|
30774
31088
|
}),
|
|
30775
|
-
style: styles$
|
|
31089
|
+
style: styles$n.spaceUnder
|
|
30776
31090
|
}), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30777
31091
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
|
|
30778
31092
|
expanded: true,
|
|
30779
|
-
containerStyle: styles$
|
|
30780
|
-
panelStyle: styles$
|
|
31093
|
+
containerStyle: styles$n.pointAccordionContainer,
|
|
31094
|
+
panelStyle: styles$n.pointAccordionPanel
|
|
30781
31095
|
}, points.map((point, index) => {
|
|
30782
31096
|
const pointLabel = String.fromCharCode(65 + index);
|
|
30783
31097
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30784
|
-
key: `locked-polygon-point
|
|
30785
|
-
style: [styles$
|
|
31098
|
+
key: `locked-polygon-point-index-${index}`,
|
|
31099
|
+
style: [styles$n.row, styles$n.spaceUnder]
|
|
30786
31100
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30787
31101
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30788
31102
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -30810,7 +31124,7 @@ const LockedPolygonSettings = props => {
|
|
|
30810
31124
|
points: newPoints
|
|
30811
31125
|
});
|
|
30812
31126
|
},
|
|
30813
|
-
style: styles$
|
|
31127
|
+
style: styles$n.icon
|
|
30814
31128
|
}));
|
|
30815
31129
|
}), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30816
31130
|
kind: "tertiary",
|
|
@@ -30826,7 +31140,7 @@ const LockedPolygonSettings = props => {
|
|
|
30826
31140
|
onRemove: onRemove
|
|
30827
31141
|
}));
|
|
30828
31142
|
};
|
|
30829
|
-
const styles$
|
|
31143
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
30830
31144
|
row: {
|
|
30831
31145
|
display: "flex",
|
|
30832
31146
|
flexDirection: "row",
|
|
@@ -30843,6 +31157,10 @@ const styles$m = aphrodite.StyleSheet.create({
|
|
|
30843
31157
|
},
|
|
30844
31158
|
spaceUnder: {
|
|
30845
31159
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
31160
|
+
},
|
|
31161
|
+
truncatedWidth: {
|
|
31162
|
+
// Allow truncation, stop bleeding over the edge.
|
|
31163
|
+
minWidth: 0
|
|
30846
31164
|
}
|
|
30847
31165
|
});
|
|
30848
31166
|
|
|
@@ -30884,7 +31202,7 @@ const LockedVectorSettings = props => {
|
|
|
30884
31202
|
expanded: props.expanded,
|
|
30885
31203
|
onToggle: props.onToggle,
|
|
30886
31204
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30887
|
-
style: styles$
|
|
31205
|
+
style: styles$m.row
|
|
30888
31206
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30889
31207
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30890
31208
|
}), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
|
|
@@ -30892,19 +31210,19 @@ const LockedVectorSettings = props => {
|
|
|
30892
31210
|
lineStyle: "solid"
|
|
30893
31211
|
}))
|
|
30894
31212
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30895
|
-
style: [styles$
|
|
31213
|
+
style: [styles$m.row, styles$m.spaceUnder]
|
|
30896
31214
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30897
31215
|
selectedValue: lineColor,
|
|
30898
31216
|
onChange: handleColorChange
|
|
30899
31217
|
})), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30900
|
-
style: styles$
|
|
31218
|
+
style: styles$m.errorText
|
|
30901
31219
|
}, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30902
31220
|
expanded: true // Initial state is expanded
|
|
30903
31221
|
,
|
|
30904
|
-
containerStyle: styles$
|
|
30905
|
-
panelStyle: styles$
|
|
31222
|
+
containerStyle: styles$m.container,
|
|
31223
|
+
panelStyle: styles$m.accordionPanel,
|
|
30906
31224
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30907
|
-
style: styles$
|
|
31225
|
+
style: styles$m.row
|
|
30908
31226
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
|
|
30909
31227
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30910
31228
|
coord: tail,
|
|
@@ -30915,10 +31233,10 @@ const LockedVectorSettings = props => {
|
|
|
30915
31233
|
})), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
|
|
30916
31234
|
expanded: true // Initial state is expanded
|
|
30917
31235
|
,
|
|
30918
|
-
containerStyle: styles$
|
|
30919
|
-
panelStyle: styles$
|
|
31236
|
+
containerStyle: styles$m.container,
|
|
31237
|
+
panelStyle: styles$m.accordionPanel,
|
|
30920
31238
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30921
|
-
style: styles$
|
|
31239
|
+
style: styles$m.row
|
|
30922
31240
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
|
|
30923
31241
|
}, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
30924
31242
|
coord: tip,
|
|
@@ -30932,7 +31250,7 @@ const LockedVectorSettings = props => {
|
|
|
30932
31250
|
onRemove: onRemove
|
|
30933
31251
|
}));
|
|
30934
31252
|
};
|
|
30935
|
-
const styles$
|
|
31253
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
30936
31254
|
accordionPanel: {
|
|
30937
31255
|
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30938
31256
|
},
|
|
@@ -30974,6 +31292,11 @@ const LockedFigureSettings = props => {
|
|
|
30974
31292
|
return /*#__PURE__*/React__namespace.createElement(LockedEllipseSettings, props);
|
|
30975
31293
|
case "polygon":
|
|
30976
31294
|
return /*#__PURE__*/React__namespace.createElement(LockedPolygonSettings, props);
|
|
31295
|
+
case "function":
|
|
31296
|
+
if (props.showM2bFeatures) {
|
|
31297
|
+
return /*#__PURE__*/React__namespace.createElement(LockedFunctionSettings, props);
|
|
31298
|
+
}
|
|
31299
|
+
break;
|
|
30977
31300
|
}
|
|
30978
31301
|
return null;
|
|
30979
31302
|
};
|
|
@@ -31079,12 +31402,6 @@ const LockedFiguresSection = props => {
|
|
|
31079
31402
|
onToggle: () => setIsExpanded(!isExpanded),
|
|
31080
31403
|
isCollapsible: true
|
|
31081
31404
|
}), isExpanded && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
|
|
31082
|
-
if (figure.type === "function") {
|
|
31083
|
-
// TODO(LEMS-1947): Add locked function settings.
|
|
31084
|
-
// Remove this block once function locked figure settings are
|
|
31085
|
-
// implemented.
|
|
31086
|
-
return;
|
|
31087
|
-
}
|
|
31088
31405
|
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
31089
31406
|
key: `${uniqueId}-locked-${figure}-${index}`,
|
|
31090
31407
|
showM2bFeatures: props.showM2bFeatures,
|
|
@@ -31100,7 +31417,7 @@ const LockedFiguresSection = props => {
|
|
|
31100
31417
|
onRemove: () => removeLockedFigure(index)
|
|
31101
31418
|
}));
|
|
31102
31419
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31103
|
-
style: styles$
|
|
31420
|
+
style: styles$l.buttonContainer
|
|
31104
31421
|
}, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
|
|
31105
31422
|
showM2bFeatures: props.showM2bFeatures,
|
|
31106
31423
|
id: `${uniqueId}-select`,
|
|
@@ -31110,10 +31427,10 @@ const LockedFiguresSection = props => {
|
|
|
31110
31427
|
}), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
31111
31428
|
kind: "secondary",
|
|
31112
31429
|
onClick: () => toggleExpanded(allCollapsed),
|
|
31113
|
-
style: styles$
|
|
31430
|
+
style: styles$l.button
|
|
31114
31431
|
}, buttonLabel))));
|
|
31115
31432
|
};
|
|
31116
|
-
const styles$
|
|
31433
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
31117
31434
|
buttonContainer: {
|
|
31118
31435
|
flexDirection: "row",
|
|
31119
31436
|
alignItems: "center"
|
|
@@ -31149,7 +31466,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31149
31466
|
// Never uses placeholder, always has value
|
|
31150
31467
|
,
|
|
31151
31468
|
placeholder: "",
|
|
31152
|
-
style: styles$
|
|
31469
|
+
style: styles$k.singleSelectShort
|
|
31153
31470
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31154
31471
|
key: n,
|
|
31155
31472
|
value: `${n}`,
|
|
@@ -31160,7 +31477,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
31160
31477
|
label: "unlimited"
|
|
31161
31478
|
})]);
|
|
31162
31479
|
};
|
|
31163
|
-
const styles$
|
|
31480
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
31164
31481
|
singleSelectShort: {
|
|
31165
31482
|
// Non-standard spacing, but it's the smallest we can go
|
|
31166
31483
|
// without running into styling issues with the dropdown.
|
|
@@ -31173,7 +31490,7 @@ const GraphTypeSelector = props => {
|
|
|
31173
31490
|
selectedValue: props.graphType,
|
|
31174
31491
|
onChange: props.onChange,
|
|
31175
31492
|
placeholder: "Select a graph type",
|
|
31176
|
-
style: styles$
|
|
31493
|
+
style: styles$j.singleSelectShort
|
|
31177
31494
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31178
31495
|
value: "linear",
|
|
31179
31496
|
label: "Linear function"
|
|
@@ -31206,7 +31523,7 @@ const GraphTypeSelector = props => {
|
|
|
31206
31523
|
label: "Angle"
|
|
31207
31524
|
}));
|
|
31208
31525
|
};
|
|
31209
|
-
const styles$
|
|
31526
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
31210
31527
|
singleSelectShort: {
|
|
31211
31528
|
// Non-standard spacing, but it's the smallest we can go
|
|
31212
31529
|
// without running into styling issues with the dropdown.
|
|
@@ -31241,7 +31558,6 @@ function InteractiveGraphCorrectAnswer(props) {
|
|
|
31241
31558
|
const {
|
|
31242
31559
|
ButtonGroup: ButtonGroup$2,
|
|
31243
31560
|
InfoTip: InfoTip$c,
|
|
31244
|
-
PropCheckBox: PropCheckBox$7,
|
|
31245
31561
|
RangeInput: RangeInput$4
|
|
31246
31562
|
} = perseus.components;
|
|
31247
31563
|
const defaultBackgroundImage$1 = {
|
|
@@ -31629,16 +31945,20 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31629
31945
|
onChange: this.change("markings")
|
|
31630
31946
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
31631
31947
|
className: "perseus-widget-left-col"
|
|
31632
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
31948
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
31633
31949
|
label: "Show tooltips",
|
|
31634
|
-
|
|
31635
|
-
onChange:
|
|
31950
|
+
checked: this.props.showTooltips,
|
|
31951
|
+
onChange: value => {
|
|
31952
|
+
this.change({
|
|
31953
|
+
showTooltips: value
|
|
31954
|
+
});
|
|
31955
|
+
}
|
|
31636
31956
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
31637
31957
|
label: "Background image URL:",
|
|
31638
|
-
style: styles$
|
|
31958
|
+
style: styles$i.resetSpaceTop
|
|
31639
31959
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
31640
31960
|
type: "text",
|
|
31641
|
-
className: aphrodite.css(styles$
|
|
31961
|
+
className: aphrodite.css(styles$i.backgroundUrlInput),
|
|
31642
31962
|
ref: this.bgUrlRef,
|
|
31643
31963
|
value: this.state.backgroundImage.url || "",
|
|
31644
31964
|
onChange: e => {
|
|
@@ -31654,14 +31974,18 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31654
31974
|
onKeyPress: this.changeBackgroundUrl,
|
|
31655
31975
|
onBlur: this.changeBackgroundUrl
|
|
31656
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, {
|
|
31657
|
-
style: styles$
|
|
31977
|
+
style: styles$i.protractorSection
|
|
31658
31978
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31659
|
-
style: styles$
|
|
31660
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
31979
|
+
style: styles$i.checkboxRow
|
|
31980
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
31661
31981
|
label: "Show protractor",
|
|
31662
|
-
|
|
31663
|
-
onChange:
|
|
31664
|
-
|
|
31982
|
+
checked: this.props.showProtractor,
|
|
31983
|
+
onChange: value => {
|
|
31984
|
+
this.change({
|
|
31985
|
+
showProtractor: value
|
|
31986
|
+
});
|
|
31987
|
+
},
|
|
31988
|
+
style: styles$i.resetSpaceTop
|
|
31665
31989
|
})), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
|
|
31666
31990
|
layout: "floating",
|
|
31667
31991
|
text: "The protractor is not accessible. Please consider an alternate approach.",
|
|
@@ -31669,7 +31993,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
31669
31993
|
}))));
|
|
31670
31994
|
}
|
|
31671
31995
|
}
|
|
31672
|
-
const styles$
|
|
31996
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
31673
31997
|
resetSpaceTop: {
|
|
31674
31998
|
marginTop: 0
|
|
31675
31999
|
},
|
|
@@ -31708,14 +32032,14 @@ const SegmentCountSelector = _ref => {
|
|
|
31708
32032
|
const num = +newValue;
|
|
31709
32033
|
onChange(num);
|
|
31710
32034
|
},
|
|
31711
|
-
style: styles$
|
|
32035
|
+
style: styles$h.singleSelectShort
|
|
31712
32036
|
}, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
31713
32037
|
key: n,
|
|
31714
32038
|
value: `${n}`,
|
|
31715
32039
|
label: `${n} segment${n > 1 ? "s" : ""}`
|
|
31716
32040
|
})));
|
|
31717
32041
|
};
|
|
31718
|
-
const styles$
|
|
32042
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
31719
32043
|
singleSelectShort: {
|
|
31720
32044
|
// Non-standard spacing, but it's the smallest we can go
|
|
31721
32045
|
// without running into styling issues with the dropdown.
|
|
@@ -31723,15 +32047,26 @@ const styles$g = aphrodite.StyleSheet.create({
|
|
|
31723
32047
|
}
|
|
31724
32048
|
});
|
|
31725
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
|
+
|
|
31726
32061
|
const StartCoordsCircle = props => {
|
|
31727
32062
|
const {
|
|
31728
32063
|
startCoords,
|
|
31729
32064
|
onChange
|
|
31730
32065
|
} = props;
|
|
31731
32066
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31732
|
-
style: styles$
|
|
32067
|
+
style: styles$g.tile
|
|
31733
32068
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31734
|
-
style: styles$
|
|
32069
|
+
style: styles$g.row
|
|
31735
32070
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Center:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31736
32071
|
size: wonderBlocksTokens.spacing.small_12
|
|
31737
32072
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31744,22 +32079,21 @@ const StartCoordsCircle = props => {
|
|
|
31744
32079
|
})), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31745
32080
|
size: wonderBlocksTokens.spacing.small_12
|
|
31746
32081
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31747
|
-
style: styles$
|
|
32082
|
+
style: styles$g.row
|
|
31748
32083
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Radius:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31749
32084
|
size: wonderBlocksTokens.spacing.small_12
|
|
31750
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
32085
|
+
}), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
|
|
31751
32086
|
value: startCoords.radius.toString(),
|
|
31752
|
-
type: "number",
|
|
31753
32087
|
onChange: value => {
|
|
31754
32088
|
onChange({
|
|
31755
32089
|
center: startCoords.center,
|
|
31756
32090
|
radius: parseFloat(value)
|
|
31757
32091
|
});
|
|
31758
32092
|
},
|
|
31759
|
-
style: styles$
|
|
32093
|
+
style: styles$g.textField
|
|
31760
32094
|
})));
|
|
31761
32095
|
};
|
|
31762
|
-
const styles$
|
|
32096
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
31763
32097
|
tile: {
|
|
31764
32098
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31765
32099
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31781,7 +32115,7 @@ const StartCoordsLine = props => {
|
|
|
31781
32115
|
onChange
|
|
31782
32116
|
} = props;
|
|
31783
32117
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31784
|
-
style: styles$
|
|
32118
|
+
style: styles$f.tile
|
|
31785
32119
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31786
32120
|
size: wonderBlocksTokens.spacing.small_12
|
|
31787
32121
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31789,7 +32123,7 @@ const StartCoordsLine = props => {
|
|
|
31789
32123
|
labels: ["x", "y"],
|
|
31790
32124
|
onChange: value => onChange([value, startCoords[1]])
|
|
31791
32125
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31792
|
-
style: styles$
|
|
32126
|
+
style: styles$f.tile
|
|
31793
32127
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31794
32128
|
size: wonderBlocksTokens.spacing.small_12
|
|
31795
32129
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31798,7 +32132,7 @@ const StartCoordsLine = props => {
|
|
|
31798
32132
|
onChange: value => onChange([startCoords[0], value])
|
|
31799
32133
|
})));
|
|
31800
32134
|
};
|
|
31801
|
-
const styles$
|
|
32135
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
31802
32136
|
tile: {
|
|
31803
32137
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
31804
32138
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
@@ -31821,7 +32155,7 @@ const StartCoordsMultiline = props => {
|
|
|
31821
32155
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${graphName} ${i + 1}`),
|
|
31822
32156
|
expanded: true
|
|
31823
32157
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31824
|
-
style: styles$
|
|
32158
|
+
style: styles$e.nestedTile
|
|
31825
32159
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 1:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31826
32160
|
size: wonderBlocksTokens.spacing.small_12
|
|
31827
32161
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31833,7 +32167,7 @@ const StartCoordsMultiline = props => {
|
|
|
31833
32167
|
onChange(newCoords);
|
|
31834
32168
|
}
|
|
31835
32169
|
})), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
31836
|
-
style: styles$
|
|
32170
|
+
style: styles$e.nestedTile
|
|
31837
32171
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Point 2:"), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
31838
32172
|
size: wonderBlocksTokens.spacing.small_12
|
|
31839
32173
|
}), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
|
|
@@ -31846,7 +32180,7 @@ const StartCoordsMultiline = props => {
|
|
|
31846
32180
|
}
|
|
31847
32181
|
})))));
|
|
31848
32182
|
};
|
|
31849
|
-
const styles$
|
|
32183
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
31850
32184
|
nestedTile: {
|
|
31851
32185
|
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
31852
32186
|
flexDirection: "row",
|
|
@@ -31854,6 +32188,39 @@ const styles$d = aphrodite.StyleSheet.create({
|
|
|
31854
32188
|
}
|
|
31855
32189
|
});
|
|
31856
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
|
+
|
|
31857
32224
|
const StartCoordsQuadratic = props => {
|
|
31858
32225
|
const {
|
|
31859
32226
|
startCoords,
|
|
@@ -32012,6 +32379,24 @@ const StartCoordsSettingsInner = props => {
|
|
|
32012
32379
|
startCoords: quadraticCoords,
|
|
32013
32380
|
onChange: onChange
|
|
32014
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
|
+
});
|
|
32015
32400
|
default:
|
|
32016
32401
|
return null;
|
|
32017
32402
|
}
|
|
@@ -32066,10 +32451,6 @@ const POLYGON_SIDES = ___default["default"].map(___default["default"].range(3, 1
|
|
|
32066
32451
|
label: `${value} sides`
|
|
32067
32452
|
});
|
|
32068
32453
|
});
|
|
32069
|
-
|
|
32070
|
-
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32071
|
-
const startCoordsUiPhase1Types = ["linear", "linear-system", "ray", "segment", "circle"];
|
|
32072
|
-
const startCoordsUiPhase2Types = ["sinusoid", "quadratic"];
|
|
32073
32454
|
/**
|
|
32074
32455
|
* An editor for the InteractiveGraph widget, which allows the user to
|
|
32075
32456
|
* specify the graph's properties and the correct answer.
|
|
@@ -32163,9 +32544,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32163
32544
|
className: "perseus-error"
|
|
32164
32545
|
}, this.props.valid);
|
|
32165
32546
|
}
|
|
32166
|
-
const startCoordsPhase1 = this.props.apiOptions?.flags?.mafs?.["start-coords-ui-phase-1"];
|
|
32167
|
-
const startCoordsPhase2 = this.props.apiOptions?.flags?.mafs?.["start-coords-ui-phase-2"];
|
|
32168
|
-
const displayStartCoordsUI = this.props.graph && (startCoordsPhase1 && startCoordsUiPhase1Types.includes(this.props.graph.type) || startCoordsPhase2 && startCoordsUiPhase2Types.includes(this.props.graph.type));
|
|
32169
32547
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
32170
32548
|
label: "Type of Graph:"
|
|
32171
32549
|
}, /*#__PURE__*/React__namespace.createElement(GraphTypeSelector, {
|
|
@@ -32238,7 +32616,8 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32238
32616
|
coords: null
|
|
32239
32617
|
};
|
|
32240
32618
|
this.props.onChange({
|
|
32241
|
-
correct: graph
|
|
32619
|
+
correct: graph,
|
|
32620
|
+
graph: graph
|
|
32242
32621
|
});
|
|
32243
32622
|
},
|
|
32244
32623
|
style: styles$a.singleSelectShort
|
|
@@ -32312,7 +32691,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
32312
32691
|
}
|
|
32313
32692
|
})), this.props.graph?.type &&
|
|
32314
32693
|
// TODO(LEMS-2228): Remove flags once this is fully released
|
|
32315
|
-
|
|
32694
|
+
shouldShowStartCoordsUI(this.props.apiOptions.flags, this.props.graph) && /*#__PURE__*/React__namespace.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
|
|
32316
32695
|
range: this.props.range,
|
|
32317
32696
|
step: this.props.step,
|
|
32318
32697
|
onChange: this.changeStartCoords
|
|
@@ -33938,7 +34317,6 @@ const styles = aphrodite.StyleSheet.create({
|
|
|
33938
34317
|
/* eslint-disable react/forbid-prop-types, react/sort-comp */
|
|
33939
34318
|
const {
|
|
33940
34319
|
InfoTip: InfoTip$a,
|
|
33941
|
-
PropCheckBox: PropCheckBox$6,
|
|
33942
34320
|
TextListEditor: TextListEditor$3
|
|
33943
34321
|
} = perseus.components;
|
|
33944
34322
|
class MatcherEditor extends React__namespace.Component {
|
|
@@ -33990,14 +34368,22 @@ class MatcherEditor extends React__namespace.Component {
|
|
|
33990
34368
|
// eslint-disable-next-line react/jsx-no-bind
|
|
33991
34369
|
,
|
|
33992
34370
|
onChange: this.onLabelChange.bind(this, 1)
|
|
33993
|
-
})), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(
|
|
34371
|
+
})), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
33994
34372
|
label: "Order of the matched pairs matters:",
|
|
33995
|
-
|
|
33996
|
-
onChange:
|
|
33997
|
-
|
|
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, {
|
|
33998
34380
|
label: "Padding:",
|
|
33999
|
-
|
|
34000
|
-
onChange:
|
|
34381
|
+
checked: this.props.padding,
|
|
34382
|
+
onChange: value => {
|
|
34383
|
+
this.props.onChange({
|
|
34384
|
+
padding: value
|
|
34385
|
+
});
|
|
34386
|
+
}
|
|
34001
34387
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$a, null, /*#__PURE__*/React__namespace.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
34002
34388
|
}
|
|
34003
34389
|
onLabelChange = (index, e) => {
|
|
@@ -34150,7 +34536,6 @@ class MatrixEditor extends React__namespace.Component {
|
|
|
34150
34536
|
const {
|
|
34151
34537
|
InfoTip: InfoTip$9,
|
|
34152
34538
|
NumberInput: NumberInput$7,
|
|
34153
|
-
PropCheckBox: PropCheckBox$5,
|
|
34154
34539
|
RangeInput: RangeInput$2
|
|
34155
34540
|
} = perseus.components;
|
|
34156
34541
|
const defaultImage = {
|
|
@@ -34224,16 +34609,24 @@ class MeasurerEditor extends React__namespace.Component {
|
|
|
34224
34609
|
className: "perseus-widget-row"
|
|
34225
34610
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34226
34611
|
className: "perseus-widget-left-col"
|
|
34227
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34612
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34228
34613
|
label: "Show ruler",
|
|
34229
|
-
|
|
34230
|
-
onChange:
|
|
34614
|
+
checked: this.props.showRuler,
|
|
34615
|
+
onChange: value => {
|
|
34616
|
+
this.props.onChange({
|
|
34617
|
+
showRuler: value
|
|
34618
|
+
});
|
|
34619
|
+
}
|
|
34231
34620
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34232
34621
|
className: "perseus-widget-right-col"
|
|
34233
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34622
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34234
34623
|
label: "Show protractor",
|
|
34235
|
-
|
|
34236
|
-
onChange:
|
|
34624
|
+
checked: this.props.showProtractor,
|
|
34625
|
+
onChange: value => {
|
|
34626
|
+
this.props.onChange({
|
|
34627
|
+
showProtractor: value
|
|
34628
|
+
});
|
|
34629
|
+
}
|
|
34237
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", {
|
|
34238
34631
|
onChange: e =>
|
|
34239
34632
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 2.
|
|
@@ -34360,7 +34753,6 @@ const {
|
|
|
34360
34753
|
ButtonGroup: ButtonGroup$1,
|
|
34361
34754
|
InfoTip: InfoTip$8,
|
|
34362
34755
|
NumberInput: NumberInput$5,
|
|
34363
|
-
PropCheckBox: PropCheckBox$4,
|
|
34364
34756
|
RangeInput: RangeInput$1
|
|
34365
34757
|
} = perseus.components;
|
|
34366
34758
|
const bound = (x, gt, lt) => Math.min(Math.max(x, gt), lt);
|
|
@@ -34600,22 +34992,34 @@ class NumberLineEditor extends React__namespace.Component {
|
|
|
34600
34992
|
className: "perseus-widget-row"
|
|
34601
34993
|
}, !this.props.static && /*#__PURE__*/React__namespace.createElement("div", {
|
|
34602
34994
|
className: "perseus-widget-left-col"
|
|
34603
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
34995
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34604
34996
|
label: "Show tick controller",
|
|
34605
|
-
|
|
34606
|
-
onChange:
|
|
34997
|
+
checked: this.props.isTickCtrl,
|
|
34998
|
+
onChange: value => {
|
|
34999
|
+
this.props.onChange({
|
|
35000
|
+
isTickCtrl: value
|
|
35001
|
+
});
|
|
35002
|
+
}
|
|
34607
35003
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34608
35004
|
className: "perseus-widget-right-col"
|
|
34609
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35005
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34610
35006
|
label: "Show label ticks",
|
|
34611
|
-
|
|
34612
|
-
onChange:
|
|
35007
|
+
checked: this.props.labelTicks,
|
|
35008
|
+
onChange: value => {
|
|
35009
|
+
this.props.onChange({
|
|
35010
|
+
labelTicks: value
|
|
35011
|
+
});
|
|
35012
|
+
}
|
|
34613
35013
|
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34614
35014
|
className: "perseus-widget-row"
|
|
34615
|
-
}, !this.props.static && /*#__PURE__*/React__namespace.createElement(
|
|
35015
|
+
}, !this.props.static && /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34616
35016
|
label: "Show tooltips",
|
|
34617
|
-
|
|
34618
|
-
onChange:
|
|
35017
|
+
checked: this.props.showTooltips,
|
|
35018
|
+
onChange: value => {
|
|
35019
|
+
this.props.onChange({
|
|
35020
|
+
showTooltips: value
|
|
35021
|
+
});
|
|
35022
|
+
}
|
|
34619
35023
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
34620
35024
|
className: "perseus-widget-row"
|
|
34621
35025
|
}, isTickCtrl && /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React__namespace.createElement(NumberInput$5, {
|
|
@@ -34666,7 +35070,6 @@ const {
|
|
|
34666
35070
|
InlineIcon: InlineIcon$1,
|
|
34667
35071
|
MultiButtonGroup,
|
|
34668
35072
|
NumberInput: NumberInput$4,
|
|
34669
|
-
PropCheckBox: PropCheckBox$3,
|
|
34670
35073
|
TextInput: TextInput$3
|
|
34671
35074
|
} = perseus.components;
|
|
34672
35075
|
const {
|
|
@@ -34760,12 +35163,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34760
35163
|
onChange: this.updateAnswer(i, "answerForms") || (() => {})
|
|
34761
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", {
|
|
34762
35165
|
className: "perseus-widget-row"
|
|
34763
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35166
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34764
35167
|
label: "Strictly match only these formats",
|
|
34765
|
-
|
|
34766
|
-
|
|
34767
|
-
|
|
34768
|
-
|
|
35168
|
+
checked: answers[i]["strict"],
|
|
35169
|
+
onChange: value => {
|
|
35170
|
+
this.updateAnswer.bind(this, i)({
|
|
35171
|
+
strict: value
|
|
35172
|
+
});
|
|
35173
|
+
}
|
|
34769
35174
|
})));
|
|
34770
35175
|
const maxError = i => /*#__PURE__*/React__namespace.createElement("div", {
|
|
34771
35176
|
className: "perseus-widget-row"
|
|
@@ -34791,10 +35196,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34791
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.")));
|
|
34792
35197
|
const rightAlign = /*#__PURE__*/React__namespace.createElement("div", {
|
|
34793
35198
|
className: "perseus-widget-row"
|
|
34794
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35199
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34795
35200
|
label: "Right alignment",
|
|
34796
|
-
|
|
34797
|
-
onChange:
|
|
35201
|
+
checked: this.props.rightAlign,
|
|
35202
|
+
onChange: value => {
|
|
35203
|
+
this.props.onChange({
|
|
35204
|
+
rightAlign: value
|
|
35205
|
+
});
|
|
35206
|
+
}
|
|
34798
35207
|
}));
|
|
34799
35208
|
const labelText = /*#__PURE__*/React__namespace.createElement("div", {
|
|
34800
35209
|
className: "perseus-widget-row"
|
|
@@ -34804,10 +35213,14 @@ class NumericInputEditor extends React__namespace.Component {
|
|
|
34804
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.")));
|
|
34805
35214
|
const coefficientCheck = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
34806
35215
|
className: "perseus-widget-row"
|
|
34807
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35216
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
34808
35217
|
label: "Coefficient",
|
|
34809
|
-
|
|
34810
|
-
onChange:
|
|
35218
|
+
checked: this.props.coefficient,
|
|
35219
|
+
onChange: value => {
|
|
35220
|
+
this.props.onChange({
|
|
35221
|
+
coefficient: value
|
|
35222
|
+
});
|
|
35223
|
+
}
|
|
34811
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."))));
|
|
34812
35225
|
const addAnswerButton = /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("a", {
|
|
34813
35226
|
href: "#",
|
|
@@ -35158,8 +35571,7 @@ class OrdererEditor extends React__namespace.Component {
|
|
|
35158
35571
|
}
|
|
35159
35572
|
|
|
35160
35573
|
const {
|
|
35161
|
-
InfoTip: InfoTip$5
|
|
35162
|
-
PropCheckBox: PropCheckBox$2
|
|
35574
|
+
InfoTip: InfoTip$5
|
|
35163
35575
|
} = perseus.components;
|
|
35164
35576
|
class PassageEditor extends React__namespace.Component {
|
|
35165
35577
|
static propTypes = {
|
|
@@ -35224,11 +35636,14 @@ class PassageEditor extends React__namespace.Component {
|
|
|
35224
35636
|
className: "perseus-widget-passage-editor"
|
|
35225
35637
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
35226
35638
|
className: "perseus-widget-row"
|
|
35227
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
35639
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35228
35640
|
label: "Show line numbers",
|
|
35229
|
-
|
|
35230
|
-
|
|
35231
|
-
|
|
35641
|
+
checked: this.props.showLineNumbers,
|
|
35642
|
+
onChange: value => {
|
|
35643
|
+
this.props.onChange({
|
|
35644
|
+
showLineNumbers: value
|
|
35645
|
+
});
|
|
35646
|
+
}
|
|
35232
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", {
|
|
35233
35648
|
type: "text",
|
|
35234
35649
|
defaultValue: this.props.passageTitle,
|
|
@@ -35700,8 +36115,7 @@ class PythonProgramEditor extends React__namespace.Component {
|
|
|
35700
36115
|
|
|
35701
36116
|
/* eslint-disable jsx-a11y/anchor-is-valid, react/forbid-prop-types, react/sort-comp */
|
|
35702
36117
|
const {
|
|
35703
|
-
InlineIcon
|
|
35704
|
-
PropCheckBox: PropCheckBox$1
|
|
36118
|
+
InlineIcon
|
|
35705
36119
|
} = perseus.components;
|
|
35706
36120
|
const {
|
|
35707
36121
|
iconPlus,
|
|
@@ -35805,25 +36219,34 @@ class RadioEditor extends React__namespace.Component {
|
|
|
35805
36219
|
target: "_blank"
|
|
35806
36220
|
}, "Multiple choice style guide"), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("div", {
|
|
35807
36221
|
className: "perseus-widget-left-col"
|
|
35808
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36222
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35809
36223
|
label: "Multiple selections",
|
|
35810
|
-
|
|
35811
|
-
|
|
35812
|
-
|
|
36224
|
+
checked: this.props.multipleSelect,
|
|
36225
|
+
onChange: value => {
|
|
36226
|
+
this.onMultipleSelectChange({
|
|
36227
|
+
multipleSelect: value
|
|
36228
|
+
});
|
|
36229
|
+
}
|
|
35813
36230
|
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
35814
36231
|
className: "perseus-widget-right-col"
|
|
35815
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36232
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35816
36233
|
label: "Randomize order",
|
|
35817
|
-
|
|
35818
|
-
|
|
35819
|
-
|
|
36234
|
+
checked: this.props.randomize,
|
|
36235
|
+
onChange: value => {
|
|
36236
|
+
this.props.onChange({
|
|
36237
|
+
randomize: value
|
|
36238
|
+
});
|
|
36239
|
+
}
|
|
35820
36240
|
})), this.props.multipleSelect && /*#__PURE__*/React__namespace.createElement("div", {
|
|
35821
36241
|
className: "perseus-widget-left-col"
|
|
35822
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
36242
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
|
|
35823
36243
|
label: "Specify number correct",
|
|
35824
|
-
|
|
35825
|
-
|
|
35826
|
-
|
|
36244
|
+
checked: this.props.countChoices,
|
|
36245
|
+
onChange: value => {
|
|
36246
|
+
this.onCountChoicesChange({
|
|
36247
|
+
countChoices: value
|
|
36248
|
+
});
|
|
36249
|
+
}
|
|
35827
36250
|
}))), /*#__PURE__*/React__namespace.createElement(perseus.BaseRadio, {
|
|
35828
36251
|
multipleSelect: this.props.multipleSelect,
|
|
35829
36252
|
countChoices: this.props.countChoices,
|
|
@@ -36052,7 +36475,6 @@ class SimpleMarkdownTesterEditor extends React__namespace.Component {
|
|
|
36052
36475
|
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
36053
36476
|
const {
|
|
36054
36477
|
InfoTip: InfoTip$2,
|
|
36055
|
-
PropCheckBox,
|
|
36056
36478
|
TextListEditor
|
|
36057
36479
|
} = perseus.components;
|
|
36058
36480
|
const HORIZONTAL = "horizontal";
|
|
@@ -36098,10 +36520,14 @@ class SorterEditor extends React__namespace.Component {
|
|
|
36098
36520
|
value: HORIZONTAL
|
|
36099
36521
|
}, "Horizontal"), /*#__PURE__*/React__namespace.createElement("option", {
|
|
36100
36522
|
value: VERTICAL
|
|
36101
|
-
}, "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, {
|
|
36102
36524
|
label: "Padding:",
|
|
36103
|
-
|
|
36104
|
-
onChange:
|
|
36525
|
+
checked: this.props.padding,
|
|
36526
|
+
onChange: value => {
|
|
36527
|
+
this.props.onChange({
|
|
36528
|
+
padding: value
|
|
36529
|
+
});
|
|
36530
|
+
}
|
|
36105
36531
|
}), /*#__PURE__*/React__namespace.createElement(InfoTip$2, null, /*#__PURE__*/React__namespace.createElement("p", null, "Padding is good for text, but not needed for images."))));
|
|
36106
36532
|
}
|
|
36107
36533
|
}
|