@khanacademy/perseus 20.4.1 → 20.5.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
@@ -33,6 +33,7 @@ var caretDown = require('@phosphor-icons/core/assets/regular/caret-down.svg');
33
33
  var caretUp = require('@phosphor-icons/core/assets/regular/caret-up.svg');
34
34
  var debounce$1 = require('lodash.debounce');
35
35
  var mafs = require('mafs');
36
+ var wonderBlocksTokens = require('@khanacademy/wonder-blocks-tokens');
36
37
  var wonderBlocksIcon = require('@khanacademy/wonder-blocks-icon');
37
38
  var questionIcon = require('@phosphor-icons/core/regular/question.svg');
38
39
  var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
@@ -28278,6 +28279,18 @@ class Graph extends React__namespace.Component {
28278
28279
  }
28279
28280
  }
28280
28281
 
28282
+ /**
28283
+ * Takes a style object with color names and converts them to actual
28284
+ * Wonder Blocks color values. This way, we can use colors and their
28285
+ * names in the editor UI without having to convert them back and forth.
28286
+ */
28287
+ function convertStyle(style) {
28288
+ return {
28289
+ ...style,
28290
+ stroke: wonderBlocksTokens.color[style?.stroke || "blue"],
28291
+ fill: wonderBlocksTokens.color[style?.fill || "blue"]
28292
+ };
28293
+ }
28281
28294
  const GraphLockedLayer = props => {
28282
28295
  const {
28283
28296
  lockedFigures
@@ -28291,7 +28304,7 @@ const GraphLockedLayer = props => {
28291
28304
  x: x,
28292
28305
  y: y,
28293
28306
  svgCircleProps: {
28294
- style: figure.style
28307
+ style: convertStyle(figure.style)
28295
28308
  }
28296
28309
  });
28297
28310
  }
@@ -41605,7 +41618,7 @@ const init = function (options) {
41605
41618
 
41606
41619
  // This file is processed by a Rollup plugin (replace) to inject the production
41607
41620
  const libName = "@khanacademy/perseus";
41608
- const libVersion = "20.4.1";
41621
+ const libVersion = "20.5.0";
41609
41622
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
41610
41623
 
41611
41624
  const apiVersion = {