@khanacademy/perseus-editor 18.2.0 → 18.2.2

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 CHANGED
@@ -1,7 +1,8 @@
1
+ import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
1
2
  import _extends from '@babel/runtime/helpers/extends';
2
3
  import { components, Widgets, iconChevronDown, iconTrash, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, itemDataVersion, ClassNames, usePerseusI18n, Renderer, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, Expression, interactiveSizes, GrapherWidget, containerSizeClass, getInteractiveBoxFromSizeClass, GrapherUtil as GrapherUtil$1, PerseusI18nContext, KhanColors, mathOnlyParser, getAngleCoords, getPolygonCoords, getPointCoords, getQuadraticCoords, getSinusoidCoords, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, InteractiveGraphWidget, bodyXsmallBold, MatrixWidget, makeSafeUrl, PlotterWidget, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
3
4
  export { widgets } from '@khanacademy/perseus';
4
- import { upgradeWidgetInfoToLatestVersion, CoreWidgetRegistry, PerseusError, Errors, ItemExtras, categorizerLogic, csProgramLogic, definitionLogic, dropdownLogic, explanationLogic, expressionLogic, deriveExtraKeys, PerseusExpressionAnswerFormConsidered, gradedGroupLogic, gradedGroupSetLogic, grapherLogic, GrapherUtil, groupLogic, iframeLogic, imageLogic, inputNumberLogic, interactionLogic, lockedFigureColors, lockedFigureFillStyles, interactiveGraphLogic, labelImageLogic, matcherLogic, matrixLogic, getMatrixSize, measurerLogic, numberLineLogic, numericInputLogic, ordererLogic, passageLogic, passageRefLogic, passageRefTargetLogic, phetSimulationLogic, plotterLogic, plotterPlotTypes, pythonProgramLogic, radioLogic, deriveNumCorrect, sorterLogic, tableLogic, videoLogic } from '@khanacademy/perseus-core';
5
+ import { CoreWidgetRegistry, upgradeWidgetInfoToLatestVersion, PerseusError, Errors, ItemExtras, categorizerLogic, csProgramLogic, definitionLogic, dropdownLogic, explanationLogic, expressionLogic, deriveExtraKeys, PerseusExpressionAnswerFormConsidered, gradedGroupLogic, gradedGroupSetLogic, grapherLogic, GrapherUtil, groupLogic, iframeLogic, imageLogic, inputNumberLogic, interactionLogic, lockedFigureColors, lockedFigureFillStyles, interactiveGraphLogic, labelImageLogic, matcherLogic, matrixLogic, getMatrixSize, measurerLogic, numberLineLogic, numericInputLogic, ordererLogic, passageLogic, passageRefLogic, passageRefTargetLogic, phetSimulationLogic, plotterLogic, plotterPlotTypes, pythonProgramLogic, radioLogic, deriveNumCorrect, sorterLogic, tableLogic, videoLogic } from '@khanacademy/perseus-core';
5
6
  import * as React from 'react';
6
7
  import { useId, useRef, useEffect, useState } from 'react';
7
8
  import _ from 'underscore';
@@ -51,51 +52,9 @@ import arrowFatUp from '@phosphor-icons/core/regular/arrow-fat-up.svg';
51
52
  import minusCircle from '@phosphor-icons/core/regular/minus-circle.svg';
52
53
  import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clockwise-bold.svg';
53
54
 
54
- /**
55
- * Adds the given perseus library version information to the __perseus_debug__
56
- * object and ensures that the object is attached to `globalThis` (`window` in
57
- * browser environments).
58
- *
59
- * This allows each library to provide runtime version information to assist in
60
- * debugging in production environments.
61
- */
62
- const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
63
- // If the library version is the default value, then we don't want to
64
- // prefix it with a "v" to indicate that it is a version number.
65
- let prefix = "v";
66
- if (libraryVersion === "__lib_version__") {
67
- prefix = "";
68
- }
69
- const formattedVersion = `${prefix}${libraryVersion}`;
70
- if (typeof globalThis !== "undefined") {
71
- var _globalThis$__perseus;
72
- globalThis.__perseus_debug__ = (_globalThis$__perseus = globalThis.__perseus_debug__) != null ? _globalThis$__perseus : {};
73
- const existingVersionEntry = globalThis.__perseus_debug__[libraryName];
74
- if (existingVersionEntry) {
75
- // If we already have an entry and it doesn't match the registered
76
- // version, we morph the entry into an array and log a warning.
77
- if (existingVersionEntry !== formattedVersion) {
78
- // Existing entry might be an array already (oops, at least 2
79
- // versions of the library already loaded!).
80
- const allVersions = Array.isArray(existingVersionEntry) ? existingVersionEntry : [existingVersionEntry];
81
- allVersions.push(formattedVersion);
82
- globalThis.__perseus_debug__[libraryName] = allVersions;
83
-
84
- // eslint-disable-next-line no-console
85
- console.warn(`Multiple versions of ${libraryName} loaded on this page: ${allVersions.sort().join(", ")}`);
86
- }
87
- } else {
88
- globalThis.__perseus_debug__[libraryName] = formattedVersion;
89
- }
90
- } else {
91
- // eslint-disable-next-line no-console
92
- console.warn(`globalThis not found found (${formattedVersion})`);
93
- }
94
- };
95
-
96
55
  // This file is processed by a Rollup plugin (replace) to inject the production
97
56
  const libName = "@khanacademy/perseus-editor";
98
- const libVersion = "18.2.0";
57
+ const libVersion = "18.2.2";
99
58
  addLibraryVersionToPerseusDebug(libName, libVersion);
100
59
 
101
60
  const devices = {