@khanacademy/perseus-editor 6.6.0 → 6.7.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/index.js CHANGED
@@ -67,7 +67,7 @@ var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
67
67
 
68
68
  // This file is processed by a Rollup plugin (replace) to inject the production
69
69
  const libName = "@khanacademy/perseus-editor";
70
- const libVersion = "6.6.0";
70
+ const libVersion = "6.7.0";
71
71
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
72
72
 
73
73
  function _extends() {
@@ -31019,6 +31019,15 @@ function getDefaultFigureForType(type) {
31019
31019
  showPoint1: false,
31020
31020
  showPoint2: false
31021
31021
  };
31022
+ case "circle":
31023
+ return {
31024
+ type: "circle",
31025
+ center: [0, 0],
31026
+ radius: 1,
31027
+ color: DEFAULT_COLOR,
31028
+ fillStyle: "none",
31029
+ strokeStyle: "solid"
31030
+ };
31022
31031
  default:
31023
31032
  throw new wonderStuffCore.UnreachableCaseError(type);
31024
31033
  }
@@ -31075,18 +31084,27 @@ const LockedFiguresSection = props => {
31075
31084
  const allCollapsed = expandedStates.every(value => !value);
31076
31085
  const buttonLabel = allCollapsed ? "Expand all" : "Collapse all";
31077
31086
  const showExpandButton = !!figures?.length;
31078
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
31079
- expanded: expandedStates[index],
31080
- onToggle: newValue => {
31081
- const newExpanded = [...expandedStates];
31082
- newExpanded[index] = newValue;
31083
- setExpandedStates(newExpanded);
31084
- },
31085
- key: `${uniqueId}-locked-${figure}-${index}`
31086
- }, figure, {
31087
- onChangeProps: newProps => changeProps(index, newProps),
31088
- onRemove: () => removeLockedFigure(index)
31089
- }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31087
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
31088
+ if (figure.type === "circle") {
31089
+ // TODO(LEMS-1941): Implement circle locked figure settings.
31090
+ // Remove this block once circle locked figure settings are
31091
+ // implemented.
31092
+ return;
31093
+ }
31094
+ return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
31095
+ showM2Features: props.showM2Features,
31096
+ expanded: expandedStates[index],
31097
+ onToggle: newValue => {
31098
+ const newExpanded = [...expandedStates];
31099
+ newExpanded[index] = newValue;
31100
+ setExpandedStates(newExpanded);
31101
+ },
31102
+ key: `${uniqueId}-locked-${figure}-${index}`
31103
+ }, figure, {
31104
+ onChangeProps: newProps => changeProps(index, newProps),
31105
+ onRemove: () => removeLockedFigure(index)
31106
+ }));
31107
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31090
31108
  style: styles$c.buttonContainer
31091
31109
  }, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
31092
31110
  id: `${uniqueId}-select`,
@@ -31451,6 +31469,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
31451
31469
  // Only show the "Add locked figure" dropdown if the graph
31452
31470
  // is using Mafs.
31453
31471
  this.props.graph && this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m1"] && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
31472
+ showM2Features: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-m2"],
31454
31473
  figures: this.props.lockedFigures,
31455
31474
  onChange: this.props.onChange
31456
31475
  }));