@khanacademy/perseus-editor 18.2.1 → 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/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var perseusUtils = require('@khanacademy/perseus-utils');
5
6
  var _extends = require('@babel/runtime/helpers/extends');
6
7
  var perseus = require('@khanacademy/perseus');
7
8
  var perseusCore = require('@khanacademy/perseus-core');
@@ -104,51 +105,10 @@ var arrowFatUp__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatUp);
104
105
  var minusCircle__default = /*#__PURE__*/_interopDefaultLegacy(minusCircle);
105
106
  var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCounterClockwise);
106
107
 
107
- /**
108
- * Adds the given perseus library version information to the __perseus_debug__
109
- * object and ensures that the object is attached to `globalThis` (`window` in
110
- * browser environments).
111
- *
112
- * This allows each library to provide runtime version information to assist in
113
- * debugging in production environments.
114
- */
115
- const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
116
- // If the library version is the default value, then we don't want to
117
- // prefix it with a "v" to indicate that it is a version number.
118
- let prefix = "v";
119
- if (libraryVersion === "__lib_version__") {
120
- prefix = "";
121
- }
122
- const formattedVersion = `${prefix}${libraryVersion}`;
123
- if (typeof globalThis !== "undefined") {
124
- globalThis.__perseus_debug__ = globalThis.__perseus_debug__ ?? {};
125
- const existingVersionEntry = globalThis.__perseus_debug__[libraryName];
126
- if (existingVersionEntry) {
127
- // If we already have an entry and it doesn't match the registered
128
- // version, we morph the entry into an array and log a warning.
129
- if (existingVersionEntry !== formattedVersion) {
130
- // Existing entry might be an array already (oops, at least 2
131
- // versions of the library already loaded!).
132
- const allVersions = Array.isArray(existingVersionEntry) ? existingVersionEntry : [existingVersionEntry];
133
- allVersions.push(formattedVersion);
134
- globalThis.__perseus_debug__[libraryName] = allVersions;
135
-
136
- // eslint-disable-next-line no-console
137
- console.warn(`Multiple versions of ${libraryName} loaded on this page: ${allVersions.sort().join(", ")}`);
138
- }
139
- } else {
140
- globalThis.__perseus_debug__[libraryName] = formattedVersion;
141
- }
142
- } else {
143
- // eslint-disable-next-line no-console
144
- console.warn(`globalThis not found found (${formattedVersion})`);
145
- }
146
- };
147
-
148
108
  // This file is processed by a Rollup plugin (replace) to inject the production
149
109
  const libName = "@khanacademy/perseus-editor";
150
- const libVersion = "18.2.1";
151
- addLibraryVersionToPerseusDebug(libName, libVersion);
110
+ const libVersion = "18.2.2";
111
+ perseusUtils.addLibraryVersionToPerseusDebug(libName, libVersion);
152
112
 
153
113
  const devices = {
154
114
  PHONE: "phone",