@khanacademy/perseus-editor 17.1.0 → 17.1.1

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
@@ -96,7 +96,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
96
96
 
97
97
  // This file is processed by a Rollup plugin (replace) to inject the production
98
98
  const libName = "@khanacademy/perseus-editor";
99
- const libVersion = "17.1.0";
99
+ const libVersion = "17.1.1";
100
100
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
101
101
 
102
102
  function _extends() {
@@ -29156,7 +29156,7 @@ const LockedFigureSelect = props => {
29156
29156
  id,
29157
29157
  onChange
29158
29158
  } = props;
29159
- const figureTypes = ["point", "line", "vector", "ellipse", "polygon", "function", ...(props.showLabelsFlag ? ["label"] : [])];
29159
+ const figureTypes = ["point", "line", "vector", "ellipse", "polygon", "function", "label"];
29160
29160
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29161
29161
  style: styles$C.container
29162
29162
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
@@ -94410,7 +94410,6 @@ const {
94410
94410
  } = perseus.components;
94411
94411
  const LockedEllipseSettings = props => {
94412
94412
  const {
94413
- flags,
94414
94413
  center,
94415
94414
  radius,
94416
94415
  angle,
@@ -94563,7 +94562,7 @@ const LockedEllipseSettings = props => {
94563
94562
  onChange: value => onChangeProps({
94564
94563
  strokeStyle: value
94565
94564
  })
94566
- }), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
94565
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
94567
94566
  size: wonderBlocksTokens.spacing.small_12
94568
94567
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
94569
94568
  style: styles$r.horizontalRule
@@ -94573,7 +94572,7 @@ const LockedEllipseSettings = props => {
94573
94572
  onChangeProps: newProps => {
94574
94573
  onChangeProps(newProps);
94575
94574
  }
94576
- })), flags?.["mafs"]?.["locked-ellipse-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
94575
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
94577
94576
  size: wonderBlocksTokens.spacing.xxxSmall_4
94578
94577
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
94579
94578
  style: styles$r.horizontalRule
@@ -94607,7 +94606,7 @@ const LockedEllipseSettings = props => {
94607
94606
  });
94608
94607
  },
94609
94608
  style: styles$r.addButton
94610
- }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
94609
+ }, "Add visible label"), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
94611
94610
  figureType: props.type,
94612
94611
  onMove: onMove,
94613
94612
  onRemove: onRemove
@@ -94672,7 +94671,6 @@ const examples = {
94672
94671
 
94673
94672
  const LockedFunctionSettings = props => {
94674
94673
  const {
94675
- flags,
94676
94674
  color: lineColor,
94677
94675
  strokeStyle,
94678
94676
  equation,
@@ -94891,7 +94889,7 @@ const LockedFunctionSettings = props => {
94891
94889
  example: example,
94892
94890
  index: index,
94893
94891
  pasteEquationFn: handlePropChange
94894
- })))), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
94892
+ })))), /*#__PURE__*/React__namespace.createElement(Strut, {
94895
94893
  size: wonderBlocksTokens.spacing.small_12
94896
94894
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
94897
94895
  style: styles$p.horizontalRule
@@ -94901,7 +94899,7 @@ const LockedFunctionSettings = props => {
94901
94899
  onChangeProps: newProps => {
94902
94900
  onChangeProps(newProps);
94903
94901
  }
94904
- })), flags?.["mafs"]?.["locked-function-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
94902
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
94905
94903
  size: wonderBlocksTokens.spacing.xxxSmall_4
94906
94904
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
94907
94905
  style: styles$p.horizontalRule
@@ -94935,7 +94933,7 @@ const LockedFunctionSettings = props => {
94935
94933
  });
94936
94934
  },
94937
94935
  style: styles$p.addButton
94938
- }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
94936
+ }, "Add visible label"), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
94939
94937
  figureType: props.type,
94940
94938
  onMove: onMove,
94941
94939
  onRemove: onRemove
@@ -95108,7 +95106,6 @@ const styles$o = aphrodite.StyleSheet.create({
95108
95106
 
95109
95107
  const LockedPointSettings = props => {
95110
95108
  const {
95111
- flags,
95112
95109
  headerLabel,
95113
95110
  coord,
95114
95111
  color: pointColor,
@@ -95234,7 +95231,7 @@ const LockedPointSettings = props => {
95234
95231
  filled: !newValue
95235
95232
  });
95236
95233
  }
95237
- })), !isDefiningPoint && flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95234
+ })), !isDefiningPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95238
95235
  size: wonderBlocksTokens.spacing.small_12
95239
95236
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95240
95237
  style: styles$n.horizontalRule
@@ -95244,7 +95241,7 @@ const LockedPointSettings = props => {
95244
95241
  onChangeProps: newProps => {
95245
95242
  onChangeProps(newProps);
95246
95243
  }
95247
- })), (!isDefiningPoint && flags?.["mafs"]?.["locked-point-labels"] || isDefiningPoint && flags?.["mafs"]?.["locked-line-labels"]) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95244
+ })), /*#__PURE__*/React__namespace.createElement(Strut, {
95248
95245
  size: wonderBlocksTokens.spacing.xxxSmall_4
95249
95246
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95250
95247
  style: styles$n.horizontalRule
@@ -95281,7 +95278,7 @@ const LockedPointSettings = props => {
95281
95278
  });
95282
95279
  },
95283
95280
  style: styles$n.addButton
95284
- }, "Add visible label")), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95281
+ }, "Add visible label"), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95285
95282
  figureType: props.type,
95286
95283
  onMove: onMove,
95287
95284
  onRemove: onRemove
@@ -95323,7 +95320,6 @@ const styles$n = aphrodite.StyleSheet.create({
95323
95320
  const lengthZeroStr = "The line cannot have length 0.";
95324
95321
  const LockedLineSettings = props => {
95325
95322
  const {
95326
- flags,
95327
95323
  kind,
95328
95324
  points,
95329
95325
  color: lineColor,
@@ -95476,7 +95472,6 @@ const LockedLineSettings = props => {
95476
95472
  })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
95477
95473
  style: styles$m.errorText
95478
95474
  }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
95479
- flags: flags,
95480
95475
  headerLabel: "Point 1",
95481
95476
  expanded: true,
95482
95477
  showPoint: showPoint1,
@@ -95487,7 +95482,6 @@ const LockedLineSettings = props => {
95487
95482
  }),
95488
95483
  onChangeProps: newProps => handleChangePoint(newProps, 0)
95489
95484
  })), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
95490
- flags: flags,
95491
95485
  headerLabel: "Point 2",
95492
95486
  expanded: true,
95493
95487
  showPoint: showPoint2,
@@ -95497,7 +95491,7 @@ const LockedLineSettings = props => {
95497
95491
  showPoint2: newValue
95498
95492
  }),
95499
95493
  onChangeProps: newProps => handleChangePoint(newProps, 1)
95500
- })), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95494
+ })), /*#__PURE__*/React__namespace.createElement(Strut, {
95501
95495
  size: wonderBlocksTokens.spacing.small_12
95502
95496
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95503
95497
  style: styles$m.horizontalRule
@@ -95507,7 +95501,7 @@ const LockedLineSettings = props => {
95507
95501
  onChangeProps: newProps => {
95508
95502
  onChangeProps(newProps);
95509
95503
  }
95510
- })), flags?.["mafs"]?.["locked-line-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95504
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
95511
95505
  size: wonderBlocksTokens.spacing.xxxSmall_4
95512
95506
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95513
95507
  style: styles$m.horizontalRule
@@ -95542,7 +95536,7 @@ const LockedLineSettings = props => {
95542
95536
  });
95543
95537
  },
95544
95538
  style: styles$m.addButton
95545
- }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95539
+ }, "Add visible label"), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95546
95540
  figureType: props.type,
95547
95541
  onMove: onMove,
95548
95542
  onRemove: onRemove
@@ -95609,7 +95603,6 @@ const styles$l = aphrodite.StyleSheet.create({
95609
95603
 
95610
95604
  const LockedPolygonSettings = props => {
95611
95605
  const {
95612
- flags,
95613
95606
  points,
95614
95607
  color,
95615
95608
  showVertices,
@@ -95857,7 +95850,7 @@ const LockedPolygonSettings = props => {
95857
95850
  size: "small",
95858
95851
  icon: arrowFatRight__default["default"],
95859
95852
  onClick: () => handlePolygonMove("right")
95860
- }))))), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95853
+ }))))), /*#__PURE__*/React__namespace.createElement(Strut, {
95861
95854
  size: wonderBlocksTokens.spacing.small_12
95862
95855
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95863
95856
  style: styles$k.horizontalRule
@@ -95867,7 +95860,7 @@ const LockedPolygonSettings = props => {
95867
95860
  onChangeProps: newProps => {
95868
95861
  onChangeProps(newProps);
95869
95862
  }
95870
- })), flags?.["mafs"]?.["locked-polygon-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
95863
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
95871
95864
  size: wonderBlocksTokens.spacing.xxxSmall_4
95872
95865
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
95873
95866
  style: styles$k.horizontalRule
@@ -95901,7 +95894,7 @@ const LockedPolygonSettings = props => {
95901
95894
  });
95902
95895
  },
95903
95896
  style: styles$k.addButton
95904
- }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95897
+ }, "Add visible label"), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
95905
95898
  figureType: props.type,
95906
95899
  onMove: onMove,
95907
95900
  onRemove: onRemove
@@ -95957,7 +95950,6 @@ const styles$k = aphrodite.StyleSheet.create({
95957
95950
  const lengthErrorMessage = "The vector cannot have length 0.";
95958
95951
  const LockedVectorSettings = props => {
95959
95952
  const {
95960
- flags,
95961
95953
  points,
95962
95954
  color: lineColor,
95963
95955
  labels,
@@ -96082,7 +96074,7 @@ const LockedVectorSettings = props => {
96082
96074
  onChange: newProps => {
96083
96075
  handleChangePoint(newProps, 1);
96084
96076
  }
96085
- })), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
96077
+ })), /*#__PURE__*/React__namespace.createElement(Strut, {
96086
96078
  size: wonderBlocksTokens.spacing.small_12
96087
96079
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
96088
96080
  style: styles$j.horizontalRule
@@ -96092,7 +96084,7 @@ const LockedVectorSettings = props => {
96092
96084
  onChangeProps: newProps => {
96093
96085
  onChangeProps(newProps);
96094
96086
  }
96095
- })), flags?.["mafs"]?.["locked-vector-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
96087
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
96096
96088
  size: wonderBlocksTokens.spacing.xxxSmall_4
96097
96089
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
96098
96090
  style: styles$j.horizontalRule
@@ -96127,7 +96119,7 @@ const LockedVectorSettings = props => {
96127
96119
  });
96128
96120
  },
96129
96121
  style: styles$j.addButton
96130
- }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
96122
+ }, "Add visible label"), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
96131
96123
  figureType: props.type,
96132
96124
  onMove: onMove,
96133
96125
  onRemove: onRemove
@@ -96188,12 +96180,10 @@ const LockedFigureSettings = props => {
96188
96180
  case "function":
96189
96181
  return /*#__PURE__*/React__namespace.createElement(LockedFunctionSettings, props);
96190
96182
  case "label":
96191
- if (props.showLabelsFlag) {
96192
- return /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, props);
96193
- }
96194
- break;
96183
+ return /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, props);
96184
+ default:
96185
+ throw new wonderStuffCore.UnreachableCaseError(props);
96195
96186
  }
96196
- return null;
96197
96187
  };
96198
96188
 
96199
96189
  const LockedFiguresSection = props => {
@@ -96299,8 +96289,6 @@ const LockedFiguresSection = props => {
96299
96289
  }), isExpanded && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
96300
96290
  return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
96301
96291
  key: `${uniqueId}-locked-${figure}-${index}`,
96302
- flags: props.flags,
96303
- showLabelsFlag: props.showLabelsFlag,
96304
96292
  expanded: expandedStates[index],
96305
96293
  onToggle: newValue => {
96306
96294
  const newExpanded = [...expandedStates];
@@ -96315,7 +96303,6 @@ const LockedFiguresSection = props => {
96315
96303
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
96316
96304
  style: styles$i.buttonContainer
96317
96305
  }, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
96318
- showLabelsFlag: props.showLabelsFlag,
96319
96306
  id: `${uniqueId}-select`,
96320
96307
  onChange: addLockedFigure
96321
96308
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
@@ -97372,8 +97359,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
97372
97359
  // Only show the "Add locked figure" dropdown if the graph
97373
97360
  // is using Mafs.
97374
97361
  this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
97375
- flags: this.props.apiOptions.flags,
97376
- showLabelsFlag: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-labels"],
97377
97362
  figures: this.props.lockedFigures,
97378
97363
  onChange: this.props.onChange
97379
97364
  }));