@khanacademy/perseus-core 3.4.0 → 3.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.d.ts CHANGED
@@ -88,8 +88,15 @@ export { default as getOrdererPublicWidgetOptions } from "./widgets/orderer/orde
88
88
  export { default as getCategorizerPublicWidgetOptions } from "./widgets/categorizer/categorizer-util";
89
89
  export { default as getCSProgramPublicWidgetOptions } from "./widgets/cs-program/cs-program-util";
90
90
  export { default as getExpressionPublicWidgetOptions } from "./widgets/expression/expression-util";
91
+ export { default as getGrapherPublicWidgetOptions } from "./widgets/grapher/grapher-util";
92
+ export { default as getInteractiveGraphPublicWidgetOptions } from "./widgets/interactive-graph/interactive-graph-util";
91
93
  export { default as getLabelImagePublicWidgetOptions } from "./widgets/label-image/label-image-util";
92
94
  export { default as getSorterPublicWidgetOptions } from "./widgets/sorter/sorter-util";
93
95
  export { default as getDropdownPublicWidgetOptions } from "./widgets/dropdown/dropdown-util";
94
96
  export { default as getNumericInputPublicWidgetOptions } from "./widgets/numeric-input/numeric-input-util";
95
97
  export { default as getNumberLinePublicWidgetOptions } from "./widgets/number-line/number-line-util";
98
+ export { default as getRadioPublicWidgetOptions } from "./widgets/radio/radio-util";
99
+ export { default as getTablePublicWidgetOptions } from "./widgets/table/table-util";
100
+ export { default as getIFramePublicWidgetOptions } from "./widgets/iframe/iframe-util";
101
+ export { default as getMatrixPublicWidgetOptions } from "./widgets/matrix/matrix-util";
102
+ export { default as getPlotterPublicWidgetOptions } from "./widgets/plotter/plotter-util";
package/dist/index.js CHANGED
@@ -4606,7 +4606,7 @@ function throwErrorIfCheatingDetected() {
4606
4606
 
4607
4607
  // This file is processed by a Rollup plugin (replace) to inject the production
4608
4608
  const libName = "@khanacademy/perseus-core";
4609
- const libVersion = "3.4.0";
4609
+ const libVersion = "3.5.0";
4610
4610
  addLibraryVersionToPerseusDebug(libName, libVersion);
4611
4611
 
4612
4612
  /**
@@ -5524,6 +5524,22 @@ function getExpressionPublicWidgetOptions(options) {
5524
5524
  };
5525
5525
  }
5526
5526
 
5527
+ function getGrapherPublicWidgetOptions(options) {
5528
+ const {
5529
+ correct: _,
5530
+ ...publicOptions
5531
+ } = options;
5532
+ return publicOptions;
5533
+ }
5534
+
5535
+ function getInteractiveGraphPublicWidgetOptions(options) {
5536
+ const {
5537
+ correct: _,
5538
+ ...publicOptions
5539
+ } = options;
5540
+ return publicOptions;
5541
+ }
5542
+
5527
5543
  /**
5528
5544
  * For details on the individual options, see the
5529
5545
  * PerseusLabelImageWidgetOptions type
@@ -5610,6 +5626,80 @@ function getNumberLinePublicWidgetOptions(options) {
5610
5626
  return publicOptions;
5611
5627
  }
5612
5628
 
5629
+ /**
5630
+ * For details on the individual options, see the
5631
+ * PerseusRadioWidgetOptions type
5632
+ */
5633
+
5634
+ /**
5635
+ * Only the options from each Radio choice that should be exposed to the client.
5636
+ */
5637
+
5638
+ /**
5639
+ * Given a PerseusRadioChoice object, return a new object with only the public
5640
+ * data that should be included in the Radio public widget options.
5641
+ */
5642
+ function getRadioChoicePublicData(choice) {
5643
+ const {
5644
+ content,
5645
+ isNoneOfTheAbove,
5646
+ widgets
5647
+ } = choice;
5648
+ return {
5649
+ content,
5650
+ isNoneOfTheAbove,
5651
+ widgets
5652
+ };
5653
+ }
5654
+
5655
+ /**
5656
+ * Given a PerseusRadioWidgetOptions object, return a new object with only
5657
+ * the public options that should be exposed to the client.
5658
+ */
5659
+ function getRadioPublicWidgetOptions(options) {
5660
+ return {
5661
+ ...options,
5662
+ choices: options.choices.map(getRadioChoicePublicData)
5663
+ };
5664
+ }
5665
+
5666
+ function getTablePublicWidgetOptions(options) {
5667
+ const {
5668
+ answers: _,
5669
+ ...publicOptions
5670
+ } = options;
5671
+ return publicOptions;
5672
+ }
5673
+
5674
+ function getIFramePublicWidgetOptions(options) {
5675
+ return options;
5676
+ }
5677
+
5678
+ function getMatrixPublicWidgetOptions(options) {
5679
+ const {
5680
+ answers: _,
5681
+ ...publicOptions
5682
+ } = options;
5683
+ return publicOptions;
5684
+ }
5685
+
5686
+ /**
5687
+ * For details on the individual options, see the
5688
+ * PerseusPlotterWidgetOptions type
5689
+ */
5690
+
5691
+ /**
5692
+ * Given a PerseusPlotterWidgetOptions object, return a new object with only
5693
+ * the public options that should be exposed to the client.
5694
+ */
5695
+ function getPlotterPublicWidgetOptions(options) {
5696
+ const {
5697
+ correct: _,
5698
+ ...publicOptions
5699
+ } = options;
5700
+ return publicOptions;
5701
+ }
5702
+
5613
5703
  exports.CoreWidgetRegistry = coreWidgetRegistry;
5614
5704
  exports.Errors = Errors;
5615
5705
  exports.GrapherUtil = grapherUtil;
@@ -5632,12 +5722,19 @@ exports.getCategorizerPublicWidgetOptions = getCategorizerPublicWidgetOptions;
5632
5722
  exports.getDecimalSeparator = getDecimalSeparator;
5633
5723
  exports.getDropdownPublicWidgetOptions = getDropdownPublicWidgetOptions;
5634
5724
  exports.getExpressionPublicWidgetOptions = getExpressionPublicWidgetOptions;
5725
+ exports.getGrapherPublicWidgetOptions = getGrapherPublicWidgetOptions;
5726
+ exports.getIFramePublicWidgetOptions = getIFramePublicWidgetOptions;
5727
+ exports.getInteractiveGraphPublicWidgetOptions = getInteractiveGraphPublicWidgetOptions;
5635
5728
  exports.getLabelImagePublicWidgetOptions = getLabelImagePublicWidgetOptions;
5729
+ exports.getMatrixPublicWidgetOptions = getMatrixPublicWidgetOptions;
5636
5730
  exports.getMatrixSize = getMatrixSize;
5637
5731
  exports.getNumberLinePublicWidgetOptions = getNumberLinePublicWidgetOptions;
5638
5732
  exports.getNumericInputPublicWidgetOptions = getNumericInputPublicWidgetOptions;
5639
5733
  exports.getOrdererPublicWidgetOptions = getOrdererPublicWidgetOptions;
5734
+ exports.getPlotterPublicWidgetOptions = getPlotterPublicWidgetOptions;
5735
+ exports.getRadioPublicWidgetOptions = getRadioPublicWidgetOptions;
5640
5736
  exports.getSorterPublicWidgetOptions = getSorterPublicWidgetOptions;
5737
+ exports.getTablePublicWidgetOptions = getTablePublicWidgetOptions;
5641
5738
  exports.getUpgradedWidgetOptions = getUpgradedWidgetOptions;
5642
5739
  exports.getWidgetIdsFromContent = getWidgetIdsFromContent;
5643
5740
  exports.getWidgetIdsFromContentByType = getWidgetIdsFromContentByType;