@khanacademy/perseus-editor 18.0.1 → 18.1.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/es/index.js +3 -24
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +3 -24
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor/components/interactive-graph-settings.d.ts +1 -11
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +42 -377
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
|
|
|
147
147
|
|
|
148
148
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
149
149
|
const libName = "@khanacademy/perseus-editor";
|
|
150
|
-
const libVersion = "18.0
|
|
150
|
+
const libVersion = "18.1.0";
|
|
151
151
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
152
152
|
|
|
153
153
|
const devices = {
|
|
@@ -11138,7 +11138,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11138
11138
|
static stateFromProps(props) {
|
|
11139
11139
|
return {
|
|
11140
11140
|
labelsTextbox: props.labels,
|
|
11141
|
-
labelLocation: props.labelLocation,
|
|
11142
11141
|
gridStepTextbox: props.gridStep,
|
|
11143
11142
|
snapStepTextbox: props.snapStep,
|
|
11144
11143
|
stepTextbox: props.step,
|
|
@@ -11159,7 +11158,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11159
11158
|
static defaultProps = {
|
|
11160
11159
|
box: [perseus.interactiveSizes.defaultBoxSizeSmall, perseus.interactiveSizes.defaultBoxSizeSmall],
|
|
11161
11160
|
labels: ["$x$", "$y$"],
|
|
11162
|
-
labelLocation: "onAxis",
|
|
11163
11161
|
range: [[-10, 10], [-10, 10]],
|
|
11164
11162
|
step: [1, 1],
|
|
11165
11163
|
gridStep: [1, 1],
|
|
@@ -11177,7 +11175,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11177
11175
|
this.changeGraph = ___default["default"].debounce(this.changeGraph, 300);
|
|
11178
11176
|
}
|
|
11179
11177
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
11180
|
-
if (!___default["default"].isEqual(this.props.labels, nextProps.labels) || !___default["default"].isEqual(this.props.
|
|
11178
|
+
if (!___default["default"].isEqual(this.props.labels, nextProps.labels) || !___default["default"].isEqual(this.props.gridStep, nextProps.gridStep) || !___default["default"].isEqual(this.props.snapStep, nextProps.snapStep) || !___default["default"].isEqual(this.props.step, nextProps.step) || !___default["default"].isEqual(this.props.range, nextProps.range) || !___default["default"].isEqual(this.props.backgroundImage, nextProps.backgroundImage)) {
|
|
11181
11179
|
this.setState(InteractiveGraphSettings.stateFromProps(nextProps));
|
|
11182
11180
|
}
|
|
11183
11181
|
}
|
|
@@ -11382,7 +11380,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11382
11380
|
};
|
|
11383
11381
|
changeGraph = () => {
|
|
11384
11382
|
const labels = this.state.labelsTextbox;
|
|
11385
|
-
const labelLocation = this.state.labelLocation;
|
|
11386
11383
|
const range = ___default["default"].map(this.state.rangeTextbox, function (range) {
|
|
11387
11384
|
return ___default["default"].map(range, Number);
|
|
11388
11385
|
});
|
|
@@ -11402,7 +11399,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11402
11399
|
this.change({
|
|
11403
11400
|
valid: true,
|
|
11404
11401
|
labels: labels,
|
|
11405
|
-
labelLocation: labelLocation,
|
|
11406
11402
|
range: range,
|
|
11407
11403
|
step: step,
|
|
11408
11404
|
gridStep: gridStep,
|
|
@@ -11427,21 +11423,6 @@ class InteractiveGraphSettings extends React__namespace.Component {
|
|
|
11427
11423
|
className: "graph-settings"
|
|
11428
11424
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11429
11425
|
className: "perseus-widget-row"
|
|
11430
|
-
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
11431
|
-
label: "Label Location"
|
|
11432
|
-
}, /*#__PURE__*/React__namespace.createElement(ButtonGroup$1, {
|
|
11433
|
-
value: this.props.labelLocation,
|
|
11434
|
-
allowEmpty: false,
|
|
11435
|
-
buttons: [{
|
|
11436
|
-
value: "onAxis",
|
|
11437
|
-
content: "On Axis"
|
|
11438
|
-
}, {
|
|
11439
|
-
value: "alongEdge",
|
|
11440
|
-
content: "Along Graph Edge"
|
|
11441
|
-
}],
|
|
11442
|
-
onChange: this.change("labelLocation")
|
|
11443
|
-
}))), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11444
|
-
className: "perseus-widget-row"
|
|
11445
11426
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11446
11427
|
className: "perseus-widget-left-col"
|
|
11447
11428
|
}, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
|
|
@@ -15149,7 +15130,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
15149
15130
|
// is copied from the question editor and pasted into the hint editor
|
|
15150
15131
|
// (double brackets in the markdown).
|
|
15151
15132
|
serialize() {
|
|
15152
|
-
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "
|
|
15133
|
+
const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures", "fullGraphAriaLabel", "fullGraphAriaDescription");
|
|
15153
15134
|
|
|
15154
15135
|
// eslint-disable-next-line react/no-string-refs
|
|
15155
15136
|
const graph = this.refs.graph;
|
|
@@ -15204,7 +15185,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
15204
15185
|
box: this.props.box,
|
|
15205
15186
|
range: this.props.range,
|
|
15206
15187
|
labels: this.props.labels,
|
|
15207
|
-
labelLocation: this.props.labelLocation,
|
|
15208
15188
|
step: this.props.step,
|
|
15209
15189
|
gridStep: gridStep,
|
|
15210
15190
|
snapStep: snapStep,
|
|
@@ -15486,7 +15466,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
|
|
|
15486
15466
|
box: perseus.getInteractiveBoxFromSizeClass(sizeClass),
|
|
15487
15467
|
range: this.props.range,
|
|
15488
15468
|
labels: this.props.labels,
|
|
15489
|
-
labelLocation: this.props.labelLocation,
|
|
15490
15469
|
step: this.props.step,
|
|
15491
15470
|
gridStep: gridStep,
|
|
15492
15471
|
snapStep: snapStep,
|