@khanacademy/perseus-editor 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/color-select.d.ts +2 -0
- package/dist/components/labeled-switch.d.ts +10 -0
- package/dist/components/locked-figure-settings-accordion.d.ts +10 -0
- package/dist/es/index.js +237 -222
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +238 -223
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -24,10 +24,10 @@ var mathInput = require('@khanacademy/math-input');
|
|
|
24
24
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
25
25
|
var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
|
|
26
26
|
var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
|
|
27
|
+
var Switch = require('@khanacademy/wonder-blocks-switch');
|
|
27
28
|
var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
|
|
28
29
|
var Button = require('@khanacademy/wonder-blocks-button');
|
|
29
30
|
var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
|
|
30
|
-
var Switch = require('@khanacademy/wonder-blocks-switch');
|
|
31
31
|
|
|
32
32
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
33
33
|
|
|
@@ -59,13 +59,13 @@ var caretRight__default = /*#__PURE__*/_interopDefaultLegacy(caretRight);
|
|
|
59
59
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
60
60
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
61
61
|
var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
|
|
62
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
62
63
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
63
64
|
var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
|
|
64
|
-
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
65
65
|
|
|
66
66
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
67
67
|
const libName = "@khanacademy/perseus-editor";
|
|
68
|
-
const libVersion = "6.
|
|
68
|
+
const libVersion = "6.2.0";
|
|
69
69
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
70
70
|
|
|
71
71
|
function _extends() {
|
|
@@ -260,13 +260,13 @@ class SectionControlButton extends React__namespace.Component {
|
|
|
260
260
|
role: "button",
|
|
261
261
|
hideDefaultFocusRing: true,
|
|
262
262
|
"aria-label": title,
|
|
263
|
-
style: styles$
|
|
263
|
+
style: styles$u.button
|
|
264
264
|
}, _ref => {
|
|
265
265
|
return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
const styles$
|
|
269
|
+
const styles$u = aphrodite.StyleSheet.create({
|
|
270
270
|
button: {
|
|
271
271
|
backgroundColor: wonderBlocksTokens.color.gold,
|
|
272
272
|
margin: 2,
|
|
@@ -20785,19 +20785,19 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20785
20785
|
const {
|
|
20786
20786
|
showErrors
|
|
20787
20787
|
} = this.state;
|
|
20788
|
-
const iconStyle = showErrors ? styles$
|
|
20788
|
+
const iconStyle = showErrors ? styles$t.iconExpanded : styles$t.iconCollapsed;
|
|
20789
20789
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20790
|
-
style: styles$
|
|
20790
|
+
style: styles$t.errorContainer
|
|
20791
20791
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20792
|
-
style: styles$
|
|
20792
|
+
style: styles$t.title,
|
|
20793
20793
|
onClick: this.handleToggleTexErrors
|
|
20794
20794
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
|
|
20795
20795
|
icon: caretRight__default["default"],
|
|
20796
20796
|
style: iconStyle
|
|
20797
20797
|
}), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20798
|
-
style: styles$
|
|
20798
|
+
style: styles$t.errorExplanation
|
|
20799
20799
|
}, "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, {
|
|
20800
|
-
style: styles$
|
|
20800
|
+
style: styles$t.error,
|
|
20801
20801
|
key: index
|
|
20802
20802
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
20803
20803
|
style: {
|
|
@@ -20806,7 +20806,7 @@ class TexErrorView extends React__namespace.Component {
|
|
|
20806
20806
|
}, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
|
|
20807
20807
|
}
|
|
20808
20808
|
}
|
|
20809
|
-
const styles$
|
|
20809
|
+
const styles$t = aphrodite.StyleSheet.create({
|
|
20810
20810
|
title: {
|
|
20811
20811
|
backgroundColor: "#eee",
|
|
20812
20812
|
fontSize: "1.25em",
|
|
@@ -24563,12 +24563,12 @@ class SimpleButton extends React__namespace.Component {
|
|
|
24563
24563
|
...otherProps
|
|
24564
24564
|
} = this.props;
|
|
24565
24565
|
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
24566
|
-
className: aphrodite.css(styles$
|
|
24566
|
+
className: aphrodite.css(styles$s.baseButton, color === "green" && styles$s.green, color === "orange" && styles$s.orange),
|
|
24567
24567
|
onClick: onClick
|
|
24568
24568
|
}, otherProps), children);
|
|
24569
24569
|
}
|
|
24570
24570
|
}
|
|
24571
|
-
const styles$
|
|
24571
|
+
const styles$s = aphrodite.StyleSheet.create({
|
|
24572
24572
|
baseButton: {
|
|
24573
24573
|
top: "0",
|
|
24574
24574
|
fontSize: "11px",
|
|
@@ -24781,23 +24781,23 @@ const LeafContainer = _ref2 => {
|
|
|
24781
24781
|
} = _ref2;
|
|
24782
24782
|
const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
|
|
24783
24783
|
const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24784
|
-
className: aphrodite.css(styles$
|
|
24784
|
+
className: aphrodite.css(styles$r.containerHeader)
|
|
24785
24785
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24786
24786
|
depth: path.length,
|
|
24787
|
-
className: aphrodite.css(styles$
|
|
24787
|
+
className: aphrodite.css(styles$r.containerTitle)
|
|
24788
24788
|
}, capitalize(name)));
|
|
24789
24789
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24790
|
-
className: aphrodite.css(styles$
|
|
24790
|
+
className: aphrodite.css(styles$r.container)
|
|
24791
24791
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
24792
|
-
className: aphrodite.css(styles$
|
|
24792
|
+
className: aphrodite.css(styles$r.row, styles$r.rowHeading)
|
|
24793
24793
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24794
|
-
className: aphrodite.css(styles$
|
|
24794
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
24795
24795
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24796
|
-
className: "pod-title " + aphrodite.css(styles$
|
|
24796
|
+
className: "pod-title " + aphrodite.css(styles$r.containerHeader)
|
|
24797
24797
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24798
|
-
className: aphrodite.css(styles$
|
|
24798
|
+
className: aphrodite.css(styles$r.containerTitle)
|
|
24799
24799
|
}, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24800
|
-
className: aphrodite.css(styles$
|
|
24800
|
+
className: aphrodite.css(styles$r.columnRight)
|
|
24801
24801
|
}, previewHeading)), children);
|
|
24802
24802
|
};
|
|
24803
24803
|
const ArrayContainer = props => {
|
|
@@ -24810,11 +24810,11 @@ const ArrayContainer = props => {
|
|
|
24810
24810
|
actions
|
|
24811
24811
|
} = props;
|
|
24812
24812
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24813
|
-
className: aphrodite.css(styles$
|
|
24813
|
+
className: aphrodite.css(styles$r.container)
|
|
24814
24814
|
}, controls && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24815
|
-
className: aphrodite.css(styles$
|
|
24815
|
+
className: aphrodite.css(styles$r.columnLeft, styles$r.containerHeader)
|
|
24816
24816
|
}, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24817
|
-
className: aphrodite.css(styles$
|
|
24817
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
24818
24818
|
}, /*#__PURE__*/React__namespace.createElement("a", {
|
|
24819
24819
|
href: "javascript:void 0",
|
|
24820
24820
|
onClick: () => actions.addArrayElement(path, shape.elementShape)
|
|
@@ -24828,28 +24828,28 @@ const ObjectContainer = _ref3 => {
|
|
|
24828
24828
|
path
|
|
24829
24829
|
} = _ref3;
|
|
24830
24830
|
const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
|
|
24831
|
-
className: aphrodite.css(styles$
|
|
24831
|
+
className: aphrodite.css(styles$r.containerHeader)
|
|
24832
24832
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24833
24833
|
depth: path.length,
|
|
24834
|
-
className: aphrodite.css(styles$
|
|
24834
|
+
className: aphrodite.css(styles$r.containerTitle)
|
|
24835
24835
|
}, capitalize(name)), controls);
|
|
24836
24836
|
const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
24837
|
-
className: aphrodite.css(styles$
|
|
24837
|
+
className: aphrodite.css(styles$r.containerHeader, styles$r.previewCollectionHeader)
|
|
24838
24838
|
}, /*#__PURE__*/React__namespace.createElement(Header, {
|
|
24839
24839
|
depth: path.length,
|
|
24840
|
-
className: aphrodite.css(styles$
|
|
24840
|
+
className: aphrodite.css(styles$r.containerTitle)
|
|
24841
24841
|
}, capitalize(name)));
|
|
24842
24842
|
const hasBothHeadings = headingEditor && headingPreview;
|
|
24843
24843
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
24844
|
-
className: aphrodite.css(styles$
|
|
24844
|
+
className: aphrodite.css(styles$r.container)
|
|
24845
24845
|
}, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
|
|
24846
|
-
className: aphrodite.css(styles$
|
|
24846
|
+
className: aphrodite.css(styles$r.row)
|
|
24847
24847
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24848
|
-
className: aphrodite.css(styles$
|
|
24848
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
24849
24849
|
}, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24850
|
-
className: aphrodite.css(styles$
|
|
24850
|
+
className: aphrodite.css(styles$r.columnRight)
|
|
24851
24851
|
}, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24852
|
-
className: aphrodite.css(path.length > 0 && styles$
|
|
24852
|
+
className: aphrodite.css(path.length > 0 && styles$r.contentIndent)
|
|
24853
24853
|
}, children));
|
|
24854
24854
|
};
|
|
24855
24855
|
|
|
@@ -24969,11 +24969,11 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24969
24969
|
className: "framework-perseus"
|
|
24970
24970
|
}, lens(renderers).get(path));
|
|
24971
24971
|
return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24972
|
-
className: aphrodite.css(styles$
|
|
24972
|
+
className: aphrodite.css(styles$r.row)
|
|
24973
24973
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24974
|
-
className: aphrodite.css(styles$
|
|
24974
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
24975
24975
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24976
|
-
className: aphrodite.css(sticky && styles$
|
|
24976
|
+
className: aphrodite.css(sticky && styles$r.sticky)
|
|
24977
24977
|
},
|
|
24978
24978
|
/*#__PURE__*/
|
|
24979
24979
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
@@ -24981,9 +24981,9 @@ const ItemNodeContent = withStickiness(props => {
|
|
|
24981
24981
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
24982
24982
|
apiOptions: apiOptions
|
|
24983
24983
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
24984
|
-
className: aphrodite.css(styles$
|
|
24984
|
+
className: aphrodite.css(styles$r.columnRight)
|
|
24985
24985
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
24986
|
-
className: aphrodite.css(sticky && styles$
|
|
24986
|
+
className: aphrodite.css(sticky && styles$r.sticky)
|
|
24987
24987
|
}, preview))));
|
|
24988
24988
|
});
|
|
24989
24989
|
const HintNodeContent = withStickiness(props => {
|
|
@@ -24999,13 +24999,13 @@ const HintNodeContent = withStickiness(props => {
|
|
|
24999
24999
|
className: "framework-perseus"
|
|
25000
25000
|
}, lens(renderers).get(path));
|
|
25001
25001
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25002
|
-
className: aphrodite.css(styles$
|
|
25002
|
+
className: aphrodite.css(styles$r.row)
|
|
25003
25003
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25004
|
-
className: aphrodite.css(styles$
|
|
25004
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
25005
25005
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25006
|
-
className: aphrodite.css(sticky && styles$
|
|
25006
|
+
className: aphrodite.css(sticky && styles$r.sticky)
|
|
25007
25007
|
}, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
|
|
25008
|
-
className: aphrodite.css(styles$
|
|
25008
|
+
className: aphrodite.css(styles$r.hintEditor),
|
|
25009
25009
|
onChange: newVal => actions.mergeValueAtPath(path, newVal),
|
|
25010
25010
|
apiOptions: apiOptions,
|
|
25011
25011
|
showTitle: false,
|
|
@@ -25020,9 +25020,9 @@ const HintNodeContent = withStickiness(props => {
|
|
|
25020
25020
|
isFirst: true,
|
|
25021
25021
|
isLast: true
|
|
25022
25022
|
})))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25023
|
-
className: aphrodite.css(styles$
|
|
25023
|
+
className: aphrodite.css(styles$r.columnRight)
|
|
25024
25024
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25025
|
-
className: aphrodite.css(sticky && styles$
|
|
25025
|
+
className: aphrodite.css(sticky && styles$r.sticky)
|
|
25026
25026
|
}, preview)));
|
|
25027
25027
|
});
|
|
25028
25028
|
const TagsNodeContent = props => {
|
|
@@ -25039,9 +25039,9 @@ const TagsNodeContent = props => {
|
|
|
25039
25039
|
return null;
|
|
25040
25040
|
}
|
|
25041
25041
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25042
|
-
className: aphrodite.css(styles$
|
|
25042
|
+
className: aphrodite.css(styles$r.columnLeft)
|
|
25043
25043
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25044
|
-
className: aphrodite.css(styles$
|
|
25044
|
+
className: aphrodite.css(styles$r.tagsEditor)
|
|
25045
25045
|
}, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
|
|
25046
25046
|
value: data,
|
|
25047
25047
|
onChange: newVal => actions.setValueAtPath(path, newVal),
|
|
@@ -25072,23 +25072,23 @@ const ArrayNodeContent = props => {
|
|
|
25072
25072
|
const subpath = path.concat(i);
|
|
25073
25073
|
const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25074
25074
|
key: "moveArrayElementUp",
|
|
25075
|
-
className: aphrodite.css(styles$
|
|
25075
|
+
className: aphrodite.css(styles$r.control)
|
|
25076
25076
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25077
25077
|
color: "orange",
|
|
25078
25078
|
title: "Move up",
|
|
25079
25079
|
onClick: () => actions.moveArrayElementUp(subpath)
|
|
25080
25080
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25081
|
-
className: aphrodite.css(styles$
|
|
25081
|
+
className: aphrodite.css(styles$r.verticalFlip)
|
|
25082
25082
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
|
|
25083
25083
|
key: "moveArrayElementDown",
|
|
25084
|
-
className: aphrodite.css(styles$
|
|
25084
|
+
className: aphrodite.css(styles$r.control)
|
|
25085
25085
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25086
25086
|
color: "orange",
|
|
25087
25087
|
title: "Move down",
|
|
25088
25088
|
onClick: () => actions.moveArrayElementDown(subpath)
|
|
25089
25089
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25090
25090
|
key: "removeArrayElement",
|
|
25091
|
-
className: aphrodite.css(styles$
|
|
25091
|
+
className: aphrodite.css(styles$r.control)
|
|
25092
25092
|
}, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
|
|
25093
25093
|
color: "orange",
|
|
25094
25094
|
title: "Delete",
|
|
@@ -25096,7 +25096,7 @@ const ArrayNodeContent = props => {
|
|
|
25096
25096
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
|
|
25097
25097
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
25098
25098
|
key: i,
|
|
25099
|
-
className: aphrodite.css(styles$
|
|
25099
|
+
className: aphrodite.css(styles$r.arrayElement, !elementIsLeaf && styles$r.arrayElementAndNotLeaf)
|
|
25100
25100
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25101
25101
|
key: i,
|
|
25102
25102
|
shape: shape.elementShape,
|
|
@@ -25122,7 +25122,7 @@ const ObjectNodeContent = props => {
|
|
|
25122
25122
|
// made sense to the shape's author is the order in which we'll iterate :)
|
|
25123
25123
|
const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
|
|
25124
25124
|
key: subkey,
|
|
25125
|
-
className: aphrodite.css(styles$
|
|
25125
|
+
className: aphrodite.css(styles$r.objectElement)
|
|
25126
25126
|
}, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
|
|
25127
25127
|
shape: shape.shape[subkey],
|
|
25128
25128
|
data: data[subkey],
|
|
@@ -25292,7 +25292,7 @@ class MultiRendererEditor extends React__namespace.Component {
|
|
|
25292
25292
|
}, this._renderContent());
|
|
25293
25293
|
}
|
|
25294
25294
|
}
|
|
25295
|
-
const styles$
|
|
25295
|
+
const styles$r = aphrodite.StyleSheet.create({
|
|
25296
25296
|
// This is used in a number of places throughout this file.
|
|
25297
25297
|
container: {},
|
|
25298
25298
|
// eslint-disable-next-line react-native/no-unused-styles
|
|
@@ -25444,47 +25444,47 @@ const StatefulArticleEditor = createReactClass__default["default"]({
|
|
|
25444
25444
|
screen
|
|
25445
25445
|
} = this.state;
|
|
25446
25446
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
25447
|
-
style: styles$
|
|
25447
|
+
style: styles$q.controlBar
|
|
25448
25448
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
25449
|
-
style: styles$
|
|
25449
|
+
style: styles$q.controls
|
|
25450
25450
|
}, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25451
25451
|
onClick: () => this.setState({
|
|
25452
25452
|
mode: "edit"
|
|
25453
25453
|
}),
|
|
25454
|
-
style: mode === "edit" ? styles$
|
|
25454
|
+
style: mode === "edit" ? styles$q.controlSelected : styles$q.control
|
|
25455
25455
|
}, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25456
25456
|
onClick: () => this.setState({
|
|
25457
25457
|
mode: "preview"
|
|
25458
25458
|
}),
|
|
25459
|
-
style: mode === "preview" ? styles$
|
|
25459
|
+
style: mode === "preview" ? styles$q.controlSelected : styles$q.control
|
|
25460
25460
|
}, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25461
25461
|
onClick: () => this.setState({
|
|
25462
25462
|
mode: "json"
|
|
25463
25463
|
}),
|
|
25464
|
-
style: mode === "json" ? styles$
|
|
25464
|
+
style: mode === "json" ? styles$q.controlSelected : styles$q.control
|
|
25465
25465
|
}, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
|
|
25466
|
-
style: styles$
|
|
25466
|
+
style: styles$q.controls
|
|
25467
25467
|
}, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25468
25468
|
onClick: () => this.setState({
|
|
25469
25469
|
screen: "phone"
|
|
25470
25470
|
}),
|
|
25471
|
-
style: screen === "phone" ? styles$
|
|
25471
|
+
style: screen === "phone" ? styles$q.controlSelected : styles$q.control
|
|
25472
25472
|
}, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25473
25473
|
onClick: () => this.setState({
|
|
25474
25474
|
screen: "tablet"
|
|
25475
25475
|
}),
|
|
25476
|
-
style: screen === "tablet" ? styles$
|
|
25476
|
+
style: screen === "tablet" ? styles$q.controlSelected : styles$q.control
|
|
25477
25477
|
}, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
|
|
25478
25478
|
onClick: () => this.setState({
|
|
25479
25479
|
screen: "desktop"
|
|
25480
25480
|
}),
|
|
25481
|
-
style: screen === "desktop" ? styles$
|
|
25481
|
+
style: screen === "desktop" ? styles$q.controlSelected : styles$q.control
|
|
25482
25482
|
}, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
25483
|
-
style: styles$
|
|
25483
|
+
style: styles$q.editor
|
|
25484
25484
|
}, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
|
|
25485
25485
|
}
|
|
25486
25486
|
});
|
|
25487
|
-
const styles$
|
|
25487
|
+
const styles$q = {
|
|
25488
25488
|
controlBar: {
|
|
25489
25489
|
marginBottom: 25,
|
|
25490
25490
|
marginTop: 5
|
|
@@ -27023,10 +27023,10 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27023
27023
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27024
27024
|
className: "perseus-widget-row"
|
|
27025
27025
|
}, /*#__PURE__*/React__namespace.createElement("label", {
|
|
27026
|
-
className: aphrodite.css(styles$
|
|
27026
|
+
className: aphrodite.css(styles$p.title)
|
|
27027
27027
|
}, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
|
|
27028
27028
|
value: this.props.title,
|
|
27029
|
-
className: aphrodite.css(styles$
|
|
27029
|
+
className: aphrodite.css(styles$p.input)
|
|
27030
27030
|
// @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
|
|
27031
27031
|
,
|
|
27032
27032
|
onChange: this.change("title")
|
|
@@ -27051,7 +27051,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27051
27051
|
}, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
|
|
27052
27052
|
className: "perseus-hint-editor"
|
|
27053
27053
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
27054
|
-
className: aphrodite.css(styles$
|
|
27054
|
+
className: aphrodite.css(styles$p.hintsTitle)
|
|
27055
27055
|
}, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
|
|
27056
27056
|
ref: this.hintEditor,
|
|
27057
27057
|
content: this.props.hint ? this.props.hint.content : "",
|
|
@@ -27083,7 +27083,7 @@ class GradedGroupEditor extends React__namespace.Component {
|
|
|
27083
27083
|
};
|
|
27084
27084
|
};
|
|
27085
27085
|
}
|
|
27086
|
-
const styles$
|
|
27086
|
+
const styles$p = aphrodite.StyleSheet.create({
|
|
27087
27087
|
title: {
|
|
27088
27088
|
fontSize: 18,
|
|
27089
27089
|
fontWeight: "bold"
|
|
@@ -28453,13 +28453,13 @@ function MathquillInput(props) {
|
|
|
28453
28453
|
}
|
|
28454
28454
|
});
|
|
28455
28455
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
28456
|
-
style: styles$
|
|
28456
|
+
style: styles$o.outerWrapper
|
|
28457
28457
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
28458
28458
|
ref: mathFieldWrapperRef,
|
|
28459
28459
|
className: "perseus-math-input mq-editable-field mq-math-mode"
|
|
28460
28460
|
}));
|
|
28461
28461
|
}
|
|
28462
|
-
const styles$
|
|
28462
|
+
const styles$o = aphrodite.StyleSheet.create({
|
|
28463
28463
|
outerWrapper: {
|
|
28464
28464
|
display: "inline-block",
|
|
28465
28465
|
borderStyle: "solid",
|
|
@@ -29545,7 +29545,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
29545
29545
|
// Never uses placeholder, always has value
|
|
29546
29546
|
,
|
|
29547
29547
|
placeholder: "",
|
|
29548
|
-
style: styles$
|
|
29548
|
+
style: styles$n.singleSelectShort
|
|
29549
29549
|
}, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
29550
29550
|
key: n,
|
|
29551
29551
|
value: `${n}`,
|
|
@@ -29556,7 +29556,7 @@ const GraphPointsCountSelector = _ref => {
|
|
|
29556
29556
|
label: "unlimited"
|
|
29557
29557
|
})]);
|
|
29558
29558
|
};
|
|
29559
|
-
const styles$
|
|
29559
|
+
const styles$n = aphrodite.StyleSheet.create({
|
|
29560
29560
|
singleSelectShort: {
|
|
29561
29561
|
// Non-standard spacing, but it's the smallest we can go
|
|
29562
29562
|
// without running into styling issues with the dropdown.
|
|
@@ -29569,7 +29569,7 @@ const GraphTypeSelector = props => {
|
|
|
29569
29569
|
selectedValue: props.graphType,
|
|
29570
29570
|
onChange: props.onChange,
|
|
29571
29571
|
placeholder: "Select a graph type",
|
|
29572
|
-
style: styles$
|
|
29572
|
+
style: styles$m.singleSelectShort
|
|
29573
29573
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
29574
29574
|
value: "linear",
|
|
29575
29575
|
label: "Linear function"
|
|
@@ -29602,7 +29602,7 @@ const GraphTypeSelector = props => {
|
|
|
29602
29602
|
label: "Angle"
|
|
29603
29603
|
}));
|
|
29604
29604
|
};
|
|
29605
|
-
const styles$
|
|
29605
|
+
const styles$m = aphrodite.StyleSheet.create({
|
|
29606
29606
|
singleSelectShort: {
|
|
29607
29607
|
// Non-standard spacing, but it's the smallest we can go
|
|
29608
29608
|
// without running into styling issues with the dropdown.
|
|
@@ -29619,16 +29619,16 @@ const LabeledRow = props => {
|
|
|
29619
29619
|
style
|
|
29620
29620
|
} = props;
|
|
29621
29621
|
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
29622
|
-
className: aphrodite.css(styles$
|
|
29622
|
+
className: aphrodite.css(styles$l.label)
|
|
29623
29623
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
29624
|
-
style: [styles$
|
|
29624
|
+
style: [styles$l.row, style]
|
|
29625
29625
|
}, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29626
|
-
style: styles$
|
|
29626
|
+
style: styles$l.spaceEnd
|
|
29627
29627
|
}, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
|
|
29628
|
-
style: styles$
|
|
29628
|
+
style: styles$l.spaceStart
|
|
29629
29629
|
}, label)));
|
|
29630
29630
|
};
|
|
29631
|
-
const styles$
|
|
29631
|
+
const styles$l = aphrodite.StyleSheet.create({
|
|
29632
29632
|
label: {
|
|
29633
29633
|
width: "fit-content"
|
|
29634
29634
|
},
|
|
@@ -30050,10 +30050,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30050
30050
|
onChange: this.change
|
|
30051
30051
|
}))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
30052
30052
|
label: "Background image URL:",
|
|
30053
|
-
style: styles$
|
|
30053
|
+
style: styles$k.resetSpaceTop
|
|
30054
30054
|
}, /*#__PURE__*/React__namespace.createElement("input", {
|
|
30055
30055
|
type: "text",
|
|
30056
|
-
className: aphrodite.css(styles$
|
|
30056
|
+
className: aphrodite.css(styles$k.backgroundUrlInput),
|
|
30057
30057
|
ref: this.bgUrlRef,
|
|
30058
30058
|
value: this.state.backgroundImage.url || "",
|
|
30059
30059
|
onChange: e => {
|
|
@@ -30069,24 +30069,24 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30069
30069
|
onKeyPress: this.changeBackgroundUrl,
|
|
30070
30070
|
onBlur: this.changeBackgroundUrl
|
|
30071
30071
|
}), /*#__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, {
|
|
30072
|
-
style: styles$
|
|
30072
|
+
style: styles$k.rulerSection
|
|
30073
30073
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30074
|
-
style: styles$
|
|
30074
|
+
style: styles$k.checkboxRow
|
|
30075
30075
|
}, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30076
30076
|
label: "Show ruler",
|
|
30077
30077
|
showRuler: this.props.showRuler,
|
|
30078
30078
|
onChange: this.change,
|
|
30079
|
-
style: styles$
|
|
30079
|
+
style: styles$k.resetSpaceTop
|
|
30080
30080
|
}), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
|
|
30081
30081
|
label: "Show protractor",
|
|
30082
30082
|
showProtractor: this.props.showProtractor,
|
|
30083
30083
|
onChange: this.change,
|
|
30084
|
-
style: styles$
|
|
30084
|
+
style: styles$k.resetSpaceTop
|
|
30085
30085
|
})), this.props.showRuler && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30086
|
-
style: styles$
|
|
30086
|
+
style: styles$k.spaceTop
|
|
30087
30087
|
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
30088
30088
|
label: "Ruler label:",
|
|
30089
|
-
style: styles$
|
|
30089
|
+
style: styles$k.resetSpaceTop
|
|
30090
30090
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30091
30091
|
id: "ruler-label-select",
|
|
30092
30092
|
selectedValue: this.props.rulerLabel,
|
|
@@ -30096,7 +30096,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30096
30096
|
});
|
|
30097
30097
|
},
|
|
30098
30098
|
placeholder: "None",
|
|
30099
|
-
style: styles$
|
|
30099
|
+
style: styles$k.singleSelectShort
|
|
30100
30100
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30101
30101
|
value: "",
|
|
30102
30102
|
label: "None",
|
|
@@ -30137,7 +30137,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30137
30137
|
});
|
|
30138
30138
|
},
|
|
30139
30139
|
placeholder: "10",
|
|
30140
|
-
style: styles$
|
|
30140
|
+
style: styles$k.singleSelectShort
|
|
30141
30141
|
}, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30142
30142
|
key: value,
|
|
30143
30143
|
value: `${value}`,
|
|
@@ -30145,7 +30145,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
30145
30145
|
})))))));
|
|
30146
30146
|
}
|
|
30147
30147
|
}
|
|
30148
|
-
const styles$
|
|
30148
|
+
const styles$k = aphrodite.StyleSheet.create({
|
|
30149
30149
|
resetSpaceTop: {
|
|
30150
30150
|
marginTop: 0
|
|
30151
30151
|
},
|
|
@@ -30189,10 +30189,10 @@ const LockedFigureSelect = props => {
|
|
|
30189
30189
|
onChange
|
|
30190
30190
|
} = props;
|
|
30191
30191
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30192
|
-
style: styles$
|
|
30192
|
+
style: styles$j.container
|
|
30193
30193
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
|
|
30194
30194
|
menuText: "Add locked figure",
|
|
30195
|
-
style: styles$
|
|
30195
|
+
style: styles$j.addElementSelect
|
|
30196
30196
|
}, [/*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
|
|
30197
30197
|
key: `${id}-point`,
|
|
30198
30198
|
label: "Point",
|
|
@@ -30203,9 +30203,9 @@ const LockedFigureSelect = props => {
|
|
|
30203
30203
|
onClick: () => onChange("line")
|
|
30204
30204
|
}, "Line")]));
|
|
30205
30205
|
};
|
|
30206
|
-
const styles$
|
|
30206
|
+
const styles$j = aphrodite.StyleSheet.create({
|
|
30207
30207
|
container: {
|
|
30208
|
-
marginTop: wonderBlocksTokens.spacing.
|
|
30208
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
30209
30209
|
},
|
|
30210
30210
|
addElementSelect: {
|
|
30211
30211
|
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
@@ -30303,13 +30303,13 @@ const ColorSwatch = props => {
|
|
|
30303
30303
|
"aria-label":
|
|
30304
30304
|
// Don't include an aria label for decorative circles.
|
|
30305
30305
|
!decorative ? `Color: ${color}, ${filled ? "filled" : "open"}` : undefined,
|
|
30306
|
-
style: [styles$
|
|
30306
|
+
style: [styles$i.colorSwatch, {
|
|
30307
30307
|
border: `4px solid ${perseus.lockedFigureColors[color]}`,
|
|
30308
30308
|
backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
|
|
30309
30309
|
}]
|
|
30310
30310
|
});
|
|
30311
30311
|
};
|
|
30312
|
-
const styles$
|
|
30312
|
+
const styles$i = aphrodite.StyleSheet.create({
|
|
30313
30313
|
colorSwatch: {
|
|
30314
30314
|
// Add a white outline so that the color swatch is visible when
|
|
30315
30315
|
// the dropdown option is highlighted with its blue background.
|
|
@@ -30325,15 +30325,16 @@ const ColorSelect = props => {
|
|
|
30325
30325
|
const {
|
|
30326
30326
|
id,
|
|
30327
30327
|
selectedValue,
|
|
30328
|
+
style,
|
|
30328
30329
|
onChange
|
|
30329
30330
|
} = props;
|
|
30330
30331
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30331
|
-
style: styles$
|
|
30332
|
+
style: [styles$h.row, style]
|
|
30332
30333
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30333
30334
|
htmlFor: id,
|
|
30334
|
-
style: styles$
|
|
30335
|
+
style: styles$h.label,
|
|
30335
30336
|
tag: "label"
|
|
30336
|
-
}, "
|
|
30337
|
+
}, "color"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30337
30338
|
id: id,
|
|
30338
30339
|
selectedValue: selectedValue,
|
|
30339
30340
|
onChange: onChange
|
|
@@ -30350,13 +30351,84 @@ const ColorSelect = props => {
|
|
|
30350
30351
|
})
|
|
30351
30352
|
}, colorName))));
|
|
30352
30353
|
};
|
|
30353
|
-
const styles$
|
|
30354
|
+
const styles$h = aphrodite.StyleSheet.create({
|
|
30354
30355
|
row: {
|
|
30355
30356
|
flexDirection: "row",
|
|
30356
30357
|
alignItems: "center"
|
|
30357
30358
|
},
|
|
30358
30359
|
label: {
|
|
30359
|
-
marginInlineEnd: wonderBlocksTokens.spacing.
|
|
30360
|
+
marginInlineEnd: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30361
|
+
}
|
|
30362
|
+
});
|
|
30363
|
+
|
|
30364
|
+
const LabeledSwitch = props => {
|
|
30365
|
+
const {
|
|
30366
|
+
checked,
|
|
30367
|
+
label,
|
|
30368
|
+
style,
|
|
30369
|
+
onChange
|
|
30370
|
+
} = props;
|
|
30371
|
+
const ids = wonderBlocksCore.useUniqueIdWithMock();
|
|
30372
|
+
const switchId = ids.get("switch");
|
|
30373
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30374
|
+
style: [styles$g.row, style]
|
|
30375
|
+
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30376
|
+
id: switchId,
|
|
30377
|
+
checked: checked,
|
|
30378
|
+
onChange: onChange
|
|
30379
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30380
|
+
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30381
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30382
|
+
tag: "label",
|
|
30383
|
+
htmlFor: switchId
|
|
30384
|
+
}, label));
|
|
30385
|
+
};
|
|
30386
|
+
const styles$g = aphrodite.StyleSheet.create({
|
|
30387
|
+
row: {
|
|
30388
|
+
flexDirection: "row",
|
|
30389
|
+
alignItems: "center"
|
|
30390
|
+
}
|
|
30391
|
+
});
|
|
30392
|
+
|
|
30393
|
+
const LockedFigureSettingsAccordion = props => {
|
|
30394
|
+
const {
|
|
30395
|
+
children,
|
|
30396
|
+
header,
|
|
30397
|
+
containerStyle,
|
|
30398
|
+
panelStyle
|
|
30399
|
+
} = props;
|
|
30400
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
|
|
30401
|
+
// More specificity so that we can override the default
|
|
30402
|
+
// .heading > h2 > .header styles from the articles.less
|
|
30403
|
+
// file (which is imported in perseus-renderer.less).
|
|
30404
|
+
, {
|
|
30405
|
+
className: "locked-figure-accordion"
|
|
30406
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
30407
|
+
style: [styles$f.container, containerStyle],
|
|
30408
|
+
headerStyle: styles$f.accordionHeader,
|
|
30409
|
+
header: header
|
|
30410
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30411
|
+
style: [styles$f.accordionPanel, panelStyle]
|
|
30412
|
+
}, children)));
|
|
30413
|
+
};
|
|
30414
|
+
const styles$f = aphrodite.StyleSheet.create({
|
|
30415
|
+
container: {
|
|
30416
|
+
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
30417
|
+
marginTop: wonderBlocksTokens.spacing.xSmall_8
|
|
30418
|
+
},
|
|
30419
|
+
accordionHeader: {
|
|
30420
|
+
padding: wonderBlocksTokens.spacing.small_12,
|
|
30421
|
+
// Don't move the dropdown caret.
|
|
30422
|
+
paddingInlineEnd: 0,
|
|
30423
|
+
// Fixed height so the addition of the color swatch doesn't
|
|
30424
|
+
// change the height of the header when toggling.
|
|
30425
|
+
height: wonderBlocksTokens.spacing.xxLarge_48
|
|
30426
|
+
},
|
|
30427
|
+
accordionPanel: {
|
|
30428
|
+
paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
|
|
30429
|
+
paddingBottom: wonderBlocksTokens.spacing.xxxSmall_4,
|
|
30430
|
+
paddingLeft: wonderBlocksTokens.spacing.small_12,
|
|
30431
|
+
paddingRight: wonderBlocksTokens.spacing.small_12
|
|
30360
30432
|
}
|
|
30361
30433
|
});
|
|
30362
30434
|
|
|
@@ -30371,20 +30443,21 @@ const LockedFigureSettingsActions = props => {
|
|
|
30371
30443
|
figureAriaLabel
|
|
30372
30444
|
} = props;
|
|
30373
30445
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30374
|
-
style: styles$
|
|
30446
|
+
style: styles$e.container
|
|
30375
30447
|
}, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
|
|
30376
30448
|
startIcon: trashIcon__default["default"],
|
|
30377
30449
|
"aria-label": `Delete ${figureAriaLabel}`,
|
|
30378
30450
|
onClick: onRemove,
|
|
30379
30451
|
kind: "tertiary",
|
|
30380
|
-
style: styles$
|
|
30452
|
+
style: styles$e.deleteButton
|
|
30381
30453
|
}, "Delete"));
|
|
30382
30454
|
};
|
|
30383
|
-
const styles$
|
|
30455
|
+
const styles$e = aphrodite.StyleSheet.create({
|
|
30384
30456
|
container: {
|
|
30385
30457
|
width: "100%",
|
|
30386
30458
|
flexDirection: "row",
|
|
30387
|
-
alignItems: "center"
|
|
30459
|
+
alignItems: "center",
|
|
30460
|
+
marginTop: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30388
30461
|
},
|
|
30389
30462
|
deleteButton: {
|
|
30390
30463
|
// Line up the delete icon with the rest of the content.
|
|
@@ -30437,13 +30510,14 @@ function getValidNumberFromString(value) {
|
|
|
30437
30510
|
// If the value is not a number, return 0.
|
|
30438
30511
|
return isNaN(parsed) ? 0 : parsed;
|
|
30439
30512
|
}
|
|
30513
|
+
const DEFAULT_COLOR = "green";
|
|
30440
30514
|
function getDefaultFigureForType(type) {
|
|
30441
30515
|
switch (type) {
|
|
30442
30516
|
case "point":
|
|
30443
30517
|
return {
|
|
30444
30518
|
type: "point",
|
|
30445
30519
|
coord: [0, 0],
|
|
30446
|
-
color:
|
|
30520
|
+
color: DEFAULT_COLOR,
|
|
30447
30521
|
filled: true
|
|
30448
30522
|
};
|
|
30449
30523
|
case "line":
|
|
@@ -30454,7 +30528,7 @@ function getDefaultFigureForType(type) {
|
|
|
30454
30528
|
...getDefaultFigureForType("point"),
|
|
30455
30529
|
coord: [2, 2]
|
|
30456
30530
|
}],
|
|
30457
|
-
color:
|
|
30531
|
+
color: DEFAULT_COLOR,
|
|
30458
30532
|
lineStyle: "solid",
|
|
30459
30533
|
showArrows: false,
|
|
30460
30534
|
showStartPoint: false,
|
|
@@ -30496,7 +30570,6 @@ const LockedPointSettings = props => {
|
|
|
30496
30570
|
const xCoordId = ids.get("x-coord");
|
|
30497
30571
|
const yCoordId = ids.get("y-coord");
|
|
30498
30572
|
const colorSelectId = ids.get("point-color-select");
|
|
30499
|
-
const showPointToggleId = ids.get("show-point-toggle");
|
|
30500
30573
|
function handleBlur() {
|
|
30501
30574
|
const validCoord = [getValidNumberFromString(coordState[0]), getValidNumberFromString(coordState[1])];
|
|
30502
30575
|
|
|
@@ -30517,20 +30590,14 @@ const LockedPointSettings = props => {
|
|
|
30517
30590
|
color: newValue
|
|
30518
30591
|
});
|
|
30519
30592
|
}
|
|
30520
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
30521
|
-
|
|
30522
|
-
|
|
30523
|
-
// file (which is imported in perseus-renderer.less).
|
|
30524
|
-
, {
|
|
30525
|
-
className: "locked-figure-accordion"
|
|
30526
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
30527
|
-
style: [styles$e.container, style],
|
|
30528
|
-
headerStyle: styles$e.accordionHeader,
|
|
30593
|
+
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsAccordion, {
|
|
30594
|
+
containerStyle: style,
|
|
30595
|
+
panelStyle: !onRemove && styles$d.accordionPanelWithoutActions,
|
|
30529
30596
|
header:
|
|
30530
30597
|
/*#__PURE__*/
|
|
30531
30598
|
// Summary: Point, coords, color (filled/open)
|
|
30532
30599
|
React__namespace.createElement(wonderBlocksCore.View, {
|
|
30533
|
-
style: styles$
|
|
30600
|
+
style: styles$d.row
|
|
30534
30601
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30535
30602
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30536
30603
|
}), toggled && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
@@ -30538,84 +30605,58 @@ const LockedPointSettings = props => {
|
|
|
30538
30605
|
filled: filled
|
|
30539
30606
|
}))
|
|
30540
30607
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30541
|
-
style: styles$
|
|
30542
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30543
|
-
style: styles$e.row
|
|
30544
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30545
|
-
style: [styles$e.row, styles$e.spaceUnder]
|
|
30608
|
+
style: [styles$d.row, styles$d.spaceUnder]
|
|
30546
30609
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30547
30610
|
htmlFor: xCoordId,
|
|
30548
|
-
style: styles$
|
|
30611
|
+
style: styles$d.label,
|
|
30549
30612
|
tag: "label"
|
|
30550
|
-
}, "x
|
|
30613
|
+
}, "x coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
30551
30614
|
id: xCoordId,
|
|
30552
30615
|
type: "number",
|
|
30553
30616
|
value: coordState[0],
|
|
30554
30617
|
onChange: newValue => handleCoordChange(newValue, 0),
|
|
30555
30618
|
onBlur: handleBlur,
|
|
30556
|
-
style: styles$
|
|
30557
|
-
})
|
|
30619
|
+
style: styles$d.textField
|
|
30620
|
+
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30558
30621
|
size: wonderBlocksTokens.spacing.medium_16
|
|
30559
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
30560
|
-
style: [styles$e.row, styles$e.spaceUnder]
|
|
30561
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30622
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30562
30623
|
htmlFor: yCoordId,
|
|
30563
|
-
style: styles$
|
|
30624
|
+
style: styles$d.label,
|
|
30564
30625
|
tag: "label"
|
|
30565
|
-
}, "y
|
|
30626
|
+
}, "y coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
|
|
30566
30627
|
id: yCoordId,
|
|
30567
30628
|
type: "number",
|
|
30568
30629
|
value: coordState[1],
|
|
30569
30630
|
onChange: newValue => handleCoordChange(newValue, 1),
|
|
30570
30631
|
onBlur: handleBlur,
|
|
30571
|
-
style: styles$
|
|
30572
|
-
}))
|
|
30573
|
-
|
|
30574
|
-
}, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
|
|
30575
|
-
id: showPointToggleId,
|
|
30632
|
+
style: styles$d.textField
|
|
30633
|
+
})), onToggle && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30634
|
+
label: "show point on graph",
|
|
30576
30635
|
checked: !!toggled,
|
|
30636
|
+
style: toggled && styles$d.spaceUnder,
|
|
30577
30637
|
onChange: onToggle
|
|
30578
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
30579
|
-
size: wonderBlocksTokens.spacing.small_12
|
|
30580
|
-
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30581
|
-
tag: "label",
|
|
30582
|
-
htmlFor: showPointToggleId
|
|
30583
|
-
}, "Show point on graph")), toggled && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30638
|
+
}), toggled && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30584
30639
|
id: colorSelectId,
|
|
30585
|
-
selectedValue: pointColor
|
|
30586
|
-
onChange: handleColorChange
|
|
30587
|
-
|
|
30588
|
-
|
|
30589
|
-
|
|
30590
|
-
label: "Open point",
|
|
30640
|
+
selectedValue: pointColor,
|
|
30641
|
+
onChange: handleColorChange,
|
|
30642
|
+
style: styles$d.spaceUnder
|
|
30643
|
+
}), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30644
|
+
label: "open point",
|
|
30591
30645
|
checked: !filled,
|
|
30592
30646
|
onChange: newValue => {
|
|
30593
30647
|
onChangeProps({
|
|
30594
30648
|
filled: !newValue
|
|
30595
30649
|
});
|
|
30596
|
-
}
|
|
30597
|
-
style: styles$e.spaceUnder
|
|
30650
|
+
}
|
|
30598
30651
|
})), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30599
30652
|
onRemove: onRemove,
|
|
30600
30653
|
figureAriaLabel: `locked point at ${coordState[0]}, ${coordState[1]}`
|
|
30601
|
-
}))
|
|
30654
|
+
}));
|
|
30602
30655
|
};
|
|
30603
|
-
const styles$
|
|
30604
|
-
|
|
30605
|
-
|
|
30606
|
-
|
|
30607
|
-
},
|
|
30608
|
-
accordionHeader: {
|
|
30609
|
-
paddingTop: wonderBlocksTokens.spacing.small_12,
|
|
30610
|
-
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
30611
|
-
paddingInlineStart: wonderBlocksTokens.spacing.medium_16,
|
|
30612
|
-
// Fixed height so the addition of the color swatch doesn't
|
|
30613
|
-
// change the height of the header when toggling.
|
|
30614
|
-
height: wonderBlocksTokens.spacing.xxLarge_48
|
|
30615
|
-
},
|
|
30616
|
-
accordionPanel: {
|
|
30617
|
-
padding: wonderBlocksTokens.spacing.medium_16,
|
|
30618
|
-
paddingBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30656
|
+
const styles$d = aphrodite.StyleSheet.create({
|
|
30657
|
+
accordionPanelWithoutActions: {
|
|
30658
|
+
// Need more space since we don't have the actions' margins.
|
|
30659
|
+
paddingBottom: wonderBlocksTokens.spacing.medium_16
|
|
30619
30660
|
},
|
|
30620
30661
|
row: {
|
|
30621
30662
|
flexDirection: "row",
|
|
@@ -30625,7 +30666,7 @@ const styles$e = aphrodite.StyleSheet.create({
|
|
|
30625
30666
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30626
30667
|
},
|
|
30627
30668
|
label: {
|
|
30628
|
-
marginInlineEnd: wonderBlocksTokens.spacing.
|
|
30669
|
+
marginInlineEnd: wonderBlocksTokens.spacing.xxSmall_6
|
|
30629
30670
|
},
|
|
30630
30671
|
textField: {
|
|
30631
30672
|
width: wonderBlocksTokens.spacing.xxxLarge_64
|
|
@@ -30636,7 +30677,7 @@ const LockedLineSettings = props => {
|
|
|
30636
30677
|
const {
|
|
30637
30678
|
kind,
|
|
30638
30679
|
points,
|
|
30639
|
-
color: lineColor
|
|
30680
|
+
color: lineColor,
|
|
30640
30681
|
lineStyle = "solid",
|
|
30641
30682
|
showArrows,
|
|
30642
30683
|
showStartPoint,
|
|
@@ -30677,31 +30718,21 @@ const LockedLineSettings = props => {
|
|
|
30677
30718
|
}]
|
|
30678
30719
|
});
|
|
30679
30720
|
}
|
|
30680
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
30681
|
-
// More specificity so that we can override the default
|
|
30682
|
-
// .heading > h2 > .header styles from the articles.less
|
|
30683
|
-
// file (which is imported in perseus-renderer.less).
|
|
30684
|
-
, {
|
|
30685
|
-
className: "locked-figure-accordion"
|
|
30686
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
|
|
30687
|
-
style: styles$d.container,
|
|
30688
|
-
headerStyle: styles$d.accordionHeader,
|
|
30721
|
+
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsAccordion, {
|
|
30689
30722
|
header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30690
|
-
style: styles$
|
|
30723
|
+
style: styles$c.row
|
|
30691
30724
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30692
30725
|
size: wonderBlocksTokens.spacing.xSmall_8
|
|
30693
30726
|
}), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
|
|
30694
30727
|
color: lineColor
|
|
30695
30728
|
}))
|
|
30696
30729
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30697
|
-
style: styles$
|
|
30698
|
-
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30699
|
-
style: [styles$d.row, styles$d.spaceUnder]
|
|
30730
|
+
style: [styles$c.row, styles$c.spaceUnder]
|
|
30700
30731
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30701
30732
|
htmlFor: kindSelectId,
|
|
30702
|
-
style: styles$
|
|
30733
|
+
style: styles$c.label,
|
|
30703
30734
|
tag: "label"
|
|
30704
|
-
}, "
|
|
30735
|
+
}, "kind"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30705
30736
|
id: kindSelectId,
|
|
30706
30737
|
selectedValue: kind,
|
|
30707
30738
|
onChange: value => onChangeProps({
|
|
@@ -30720,20 +30751,20 @@ const LockedLineSettings = props => {
|
|
|
30720
30751
|
value: "ray",
|
|
30721
30752
|
label: "ray"
|
|
30722
30753
|
}))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30723
|
-
style: [styles$
|
|
30754
|
+
style: [styles$c.row, styles$c.spaceUnder]
|
|
30724
30755
|
}, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
|
|
30725
30756
|
id: colorSelectId,
|
|
30726
|
-
selectedValue: lineColor
|
|
30757
|
+
selectedValue: lineColor,
|
|
30727
30758
|
onChange: handleColorChange
|
|
30728
30759
|
}), /*#__PURE__*/React__namespace.createElement(Strut, {
|
|
30729
|
-
size: wonderBlocksTokens.spacing.
|
|
30760
|
+
size: wonderBlocksTokens.spacing.small_12
|
|
30730
30761
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30731
|
-
style: styles$
|
|
30762
|
+
style: styles$c.row
|
|
30732
30763
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
|
|
30733
30764
|
htmlFor: styleSelectId,
|
|
30734
|
-
style: styles$
|
|
30765
|
+
style: styles$c.label,
|
|
30735
30766
|
tag: "label"
|
|
30736
|
-
}, "
|
|
30767
|
+
}, "style"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
|
|
30737
30768
|
id: styleSelectId,
|
|
30738
30769
|
selectedValue: lineStyle,
|
|
30739
30770
|
onChange: value => onChangeProps({
|
|
@@ -30741,20 +30772,20 @@ const LockedLineSettings = props => {
|
|
|
30741
30772
|
})
|
|
30742
30773
|
// Placeholder is required, but never gets used.
|
|
30743
30774
|
,
|
|
30744
|
-
placeholder: ""
|
|
30775
|
+
placeholder: "",
|
|
30776
|
+
style: styles$c.selectMarginOffset
|
|
30745
30777
|
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30746
30778
|
value: "solid",
|
|
30747
30779
|
label: "solid"
|
|
30748
30780
|
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
|
|
30749
30781
|
value: "dashed",
|
|
30750
30782
|
label: "dashed"
|
|
30751
|
-
})))), /*#__PURE__*/React__namespace.createElement(
|
|
30752
|
-
label: "
|
|
30783
|
+
})))), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
|
|
30784
|
+
label: "show arrows",
|
|
30753
30785
|
checked: showArrows,
|
|
30754
30786
|
onChange: newValue => onChangeProps({
|
|
30755
30787
|
showArrows: newValue
|
|
30756
|
-
})
|
|
30757
|
-
style: styles$d.spaceUnder
|
|
30788
|
+
})
|
|
30758
30789
|
}), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
|
|
30759
30790
|
label: "Start point",
|
|
30760
30791
|
toggled: showStartPoint
|
|
@@ -30763,7 +30794,7 @@ const LockedLineSettings = props => {
|
|
|
30763
30794
|
showStartPoint: newValue
|
|
30764
30795
|
}),
|
|
30765
30796
|
onChangeProps: newProps => handleChangePoint(newProps, 0),
|
|
30766
|
-
style: styles$
|
|
30797
|
+
style: styles$c.lockedPointSettingsContainer
|
|
30767
30798
|
})), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
|
|
30768
30799
|
label: "End point",
|
|
30769
30800
|
toggled: showEndPoint
|
|
@@ -30772,31 +30803,18 @@ const LockedLineSettings = props => {
|
|
|
30772
30803
|
showEndPoint: newValue
|
|
30773
30804
|
}),
|
|
30774
30805
|
onChangeProps: newProps => handleChangePoint(newProps, 1),
|
|
30775
|
-
style: styles$
|
|
30806
|
+
style: styles$c.lockedPointSettingsContainer
|
|
30776
30807
|
})), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
|
|
30777
30808
|
onRemove: onRemove,
|
|
30778
30809
|
figureAriaLabel: `locked line defined by
|
|
30779
30810
|
${startPoint.coord[0]}, ${startPoint.coord[1]} and
|
|
30780
30811
|
${endPoint.coord[0]}, ${endPoint.coord[1]}.`
|
|
30781
|
-
}))
|
|
30812
|
+
}));
|
|
30782
30813
|
};
|
|
30783
|
-
const styles$
|
|
30784
|
-
container: {
|
|
30785
|
-
backgroundColor: wonderBlocksTokens.color.fadedBlue8,
|
|
30786
|
-
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30787
|
-
},
|
|
30788
|
-
accordionHeader: {
|
|
30789
|
-
paddingTop: wonderBlocksTokens.spacing.small_12,
|
|
30790
|
-
paddingBottom: wonderBlocksTokens.spacing.small_12,
|
|
30791
|
-
paddingInlineStart: wonderBlocksTokens.spacing.medium_16
|
|
30792
|
-
},
|
|
30793
|
-
accordionPanel: {
|
|
30794
|
-
padding: wonderBlocksTokens.spacing.medium_16,
|
|
30795
|
-
paddingBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30796
|
-
},
|
|
30814
|
+
const styles$c = aphrodite.StyleSheet.create({
|
|
30797
30815
|
lockedPointSettingsContainer: {
|
|
30798
30816
|
marginTop: wonderBlocksTokens.spacing.xSmall_8,
|
|
30799
|
-
marginBottom:
|
|
30817
|
+
marginBottom: 0,
|
|
30800
30818
|
marginLeft: -wonderBlocksTokens.spacing.xxxSmall_4,
|
|
30801
30819
|
marginRight: -wonderBlocksTokens.spacing.xxxSmall_4,
|
|
30802
30820
|
backgroundColor: wonderBlocksTokens.color.white
|
|
@@ -30809,7 +30827,11 @@ const styles$d = aphrodite.StyleSheet.create({
|
|
|
30809
30827
|
marginBottom: wonderBlocksTokens.spacing.xSmall_8
|
|
30810
30828
|
},
|
|
30811
30829
|
label: {
|
|
30812
|
-
marginInlineEnd: wonderBlocksTokens.spacing.
|
|
30830
|
+
marginInlineEnd: wonderBlocksTokens.spacing.xxxSmall_4
|
|
30831
|
+
},
|
|
30832
|
+
selectMarginOffset: {
|
|
30833
|
+
// Align with the point settings accordions.
|
|
30834
|
+
marginInlineEnd: -wonderBlocksTokens.spacing.xxxSmall_4
|
|
30813
30835
|
}
|
|
30814
30836
|
});
|
|
30815
30837
|
|
|
@@ -30867,9 +30889,7 @@ const LockedFiguresSection = props => {
|
|
|
30867
30889
|
};
|
|
30868
30890
|
onChange(newFigures);
|
|
30869
30891
|
}
|
|
30870
|
-
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
30871
|
-
style: styles$c.container
|
|
30872
|
-
}, figures?.map((figure, index) => /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
30892
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
30873
30893
|
key: `${uniqueId}-locked-${figure}-${index}`
|
|
30874
30894
|
}, figure, {
|
|
30875
30895
|
onChangeProps: newProps => changeProps(index, newProps),
|
|
@@ -30879,11 +30899,6 @@ const LockedFiguresSection = props => {
|
|
|
30879
30899
|
onChange: addLockedFigure
|
|
30880
30900
|
}));
|
|
30881
30901
|
};
|
|
30882
|
-
const styles$c = aphrodite.StyleSheet.create({
|
|
30883
|
-
container: {
|
|
30884
|
-
paddingTop: wonderBlocksTokens.spacing.large_24
|
|
30885
|
-
}
|
|
30886
|
-
});
|
|
30887
30902
|
|
|
30888
30903
|
const SegmentCountSelector = _ref => {
|
|
30889
30904
|
let {
|