@khanacademy/perseus-editor 7.0.1 → 7.0.3
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/util.d.ts +2 -1
- package/dist/es/index.js +15 -14
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor.d.ts +206 -211
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
|
|
|
81
81
|
|
|
82
82
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
83
83
|
const libName = "@khanacademy/perseus-editor";
|
|
84
|
-
const libVersion = "7.0.
|
|
84
|
+
const libVersion = "7.0.3";
|
|
85
85
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
86
86
|
|
|
87
87
|
function _extends() {
|
|
@@ -29765,6 +29765,14 @@ function getDefaultFigureForType(type) {
|
|
|
29765
29765
|
fillStyle: "none",
|
|
29766
29766
|
strokeStyle: "solid"
|
|
29767
29767
|
};
|
|
29768
|
+
case "function":
|
|
29769
|
+
return {
|
|
29770
|
+
type: "function",
|
|
29771
|
+
color: DEFAULT_COLOR,
|
|
29772
|
+
strokeStyle: "solid",
|
|
29773
|
+
equation: "x^2",
|
|
29774
|
+
directionalAxis: "x"
|
|
29775
|
+
};
|
|
29768
29776
|
default:
|
|
29769
29777
|
throw new wonderStuffCore.UnreachableCaseError(type);
|
|
29770
29778
|
}
|
|
@@ -31050,6 +31058,12 @@ const LockedFiguresSection = props => {
|
|
|
31050
31058
|
const buttonLabel = allCollapsed ? "Expand all" : "Collapse all";
|
|
31051
31059
|
const showExpandButton = !!figures?.length;
|
|
31052
31060
|
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
|
|
31061
|
+
if (figure.type === "function") {
|
|
31062
|
+
// TODO(LEMS-1947): Add locked function settings.
|
|
31063
|
+
// Remove this block once function locked figure settings are
|
|
31064
|
+
// implemented.
|
|
31065
|
+
return;
|
|
31066
|
+
}
|
|
31053
31067
|
return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
|
|
31054
31068
|
key: `${uniqueId}-locked-${figure}-${index}`,
|
|
31055
31069
|
showM2Features: props.showM2Features,
|
|
@@ -31835,15 +31849,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31835
31849
|
UNSAFE_componentWillMount() {
|
|
31836
31850
|
DeprecationMixin.UNSAFE_componentWillMount.call(this);
|
|
31837
31851
|
}
|
|
31838
|
-
static buildGraphKey(correct) {
|
|
31839
|
-
const testGraphKey = [];
|
|
31840
|
-
for (const key in correct) {
|
|
31841
|
-
if (correct[key]) {
|
|
31842
|
-
typeof correct[key] === "number" || typeof correct[key] === "string" || typeof correct[key] === "boolean" ? testGraphKey.push(correct[key]) : testGraphKey.push(0);
|
|
31843
|
-
}
|
|
31844
|
-
}
|
|
31845
|
-
return testGraphKey.join(":");
|
|
31846
|
-
}
|
|
31847
31852
|
render() {
|
|
31848
31853
|
let graph;
|
|
31849
31854
|
let equationString;
|
|
@@ -31886,9 +31891,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31886
31891
|
});
|
|
31887
31892
|
}
|
|
31888
31893
|
};
|
|
31889
|
-
// This is used to force a remount of the graph component
|
|
31890
|
-
// when there's a significant change
|
|
31891
|
-
const graphKey = InteractiveGraphEditor.buildGraphKey(correct);
|
|
31892
31894
|
graph =
|
|
31893
31895
|
/*#__PURE__*/
|
|
31894
31896
|
// There are a bunch of props that renderer.jsx passes to widgets via
|
|
@@ -31896,7 +31898,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
31896
31898
|
// bother passing.
|
|
31897
31899
|
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
31898
31900
|
React__namespace.createElement(InteractiveGraph, _extends({}, graphProps, {
|
|
31899
|
-
key: graphKey,
|
|
31900
31901
|
containerSizeClass: sizeClass,
|
|
31901
31902
|
apiOptions: {
|
|
31902
31903
|
...this.props.apiOptions,
|