@khanacademy/perseus 11.6.0 → 12.0.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/CHANGELOG.md +35 -0
- package/dist/components/math-input.d.ts +38 -11
- package/dist/components/tex-buttons.d.ts +2 -1
- package/dist/es/index.css +5 -6
- package/dist/es/index.js +1454 -1371
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +5 -6
- package/dist/index.d.ts +2 -8
- package/dist/index.js +1475 -1390
- package/dist/index.js.map +1 -1
- package/dist/item-renderer.d.ts +3 -0
- package/dist/perseus-types.d.ts +2 -1
- package/dist/perseus-version.d.ts +8 -0
- package/dist/strings.js +3 -0
- package/dist/version.d.ts +1 -11
- package/dist/widgets/expression.d.ts +15 -14
- package/package.json +9 -9
- package/src/__tests__/mock-asset-loading-widget.tsx +1 -2
- package/src/components/__stories__/graphie.stories.tsx +2 -2
- package/src/components/__stories__/math-input.stories.tsx +17 -4
- package/src/components/__tests__/math-input.test.tsx +95 -8
- package/src/components/math-input.tsx +274 -96
- package/src/components/tex-buttons.tsx +2 -2
- package/src/index.ts +2 -5
- package/src/item-renderer.tsx +3 -0
- package/src/item-version.ts +2 -2
- package/src/perseus-types.ts +11 -1
- package/src/perseus-version.ts +9 -0
- package/src/styles/perseus-renderer.less +5 -6
- package/src/styles/widgets/expression.less +0 -6
- package/src/version.ts +9 -10
- package/src/widgets/__stories__/expression.stories.tsx +24 -13
- package/src/widgets/__tests__/expression.test.tsx +4 -77
- package/src/widgets/expression.tsx +99 -94
- package/tsconfig-build.json +1 -0
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -5,83 +5,73 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var KAS = require('@khanacademy/kas');
|
|
6
6
|
var mathInput = require('@khanacademy/math-input');
|
|
7
7
|
var PerseusLinter = require('@khanacademy/perseus-linter');
|
|
8
|
+
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
8
9
|
var i18n = require('@khanacademy/wonder-blocks-i18n');
|
|
10
|
+
var Tooltip$1 = require('@khanacademy/wonder-blocks-tooltip');
|
|
9
11
|
var classNames = require('classnames');
|
|
10
12
|
var React = require('react');
|
|
11
13
|
var _ = require('underscore');
|
|
14
|
+
var Clickable = require('@khanacademy/wonder-blocks-clickable');
|
|
15
|
+
var Color = require('@khanacademy/wonder-blocks-color');
|
|
16
|
+
var wonderBlocksPopover = require('@khanacademy/wonder-blocks-popover');
|
|
17
|
+
var Spacing = require('@khanacademy/wonder-blocks-spacing');
|
|
18
|
+
var aphrodite = require('aphrodite');
|
|
12
19
|
var $ = require('jquery');
|
|
13
|
-
var ReactDOM = require('react-dom');
|
|
14
20
|
var PropTypes = require('prop-types');
|
|
21
|
+
var ReactDOM = require('react-dom');
|
|
15
22
|
var kmath = require('@khanacademy/kmath');
|
|
16
|
-
var Spacing = require('@khanacademy/wonder-blocks-spacing');
|
|
17
|
-
var aphrodite = require('aphrodite');
|
|
18
23
|
var wonderBlocksProgressSpinner = require('@khanacademy/wonder-blocks-progress-spinner');
|
|
19
|
-
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
20
24
|
var SimpleMarkdown = require('@khanacademy/simple-markdown');
|
|
21
25
|
var pureMarkdown = require('@khanacademy/pure-markdown');
|
|
22
26
|
var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
|
|
23
27
|
var Button = require('@khanacademy/wonder-blocks-button');
|
|
24
|
-
var Clickable = require('@khanacademy/wonder-blocks-clickable');
|
|
25
|
-
var Color = require('@khanacademy/wonder-blocks-color');
|
|
26
28
|
var wonderBlocksLayout = require('@khanacademy/wonder-blocks-layout');
|
|
27
|
-
var wonderBlocksPopover = require('@khanacademy/wonder-blocks-popover');
|
|
28
29
|
var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
|
|
29
30
|
var debounce = require('lodash.debounce');
|
|
30
31
|
var createReactClass = require('create-react-class');
|
|
31
|
-
var Tooltip$1 = require('@khanacademy/wonder-blocks-tooltip');
|
|
32
32
|
var Link = require('@khanacademy/wonder-blocks-link');
|
|
33
|
+
var perseusCore = require('@khanacademy/perseus-core');
|
|
33
34
|
|
|
34
35
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
35
36
|
|
|
36
37
|
function _interopNamespace(e) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
}
|
|
38
|
+
if (e && e.__esModule) return e;
|
|
39
|
+
var n = Object.create(null);
|
|
40
|
+
if (e) {
|
|
41
|
+
Object.keys(e).forEach(function (k) {
|
|
42
|
+
if (k !== 'default') {
|
|
43
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
44
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return e[k]; }
|
|
48
47
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
n["default"] = e;
|
|
52
|
+
return Object.freeze(n);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
|
|
55
56
|
var PerseusLinter__namespace = /*#__PURE__*/_interopNamespace(PerseusLinter);
|
|
56
57
|
var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n);
|
|
58
|
+
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip$1);
|
|
57
59
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
58
60
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
59
61
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
62
|
+
var Clickable__default = /*#__PURE__*/_interopDefaultLegacy(Clickable);
|
|
63
|
+
var Color__default = /*#__PURE__*/_interopDefaultLegacy(Color);
|
|
64
|
+
var Spacing__default = /*#__PURE__*/_interopDefaultLegacy(Spacing);
|
|
60
65
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
|
66
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
61
67
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
62
68
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
63
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
64
|
-
var Spacing__default = /*#__PURE__*/_interopDefaultLegacy(Spacing);
|
|
65
69
|
var SimpleMarkdown__default = /*#__PURE__*/_interopDefaultLegacy(SimpleMarkdown);
|
|
66
70
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
67
|
-
var Clickable__default = /*#__PURE__*/_interopDefaultLegacy(Clickable);
|
|
68
|
-
var Color__default = /*#__PURE__*/_interopDefaultLegacy(Color);
|
|
69
71
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
70
72
|
var createReactClass__default = /*#__PURE__*/_interopDefaultLegacy(createReactClass);
|
|
71
|
-
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip$1);
|
|
72
73
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
73
74
|
|
|
74
|
-
var version = {
|
|
75
|
-
apiVersion: {
|
|
76
|
-
major: 12,
|
|
77
|
-
minor: 0
|
|
78
|
-
},
|
|
79
|
-
itemDataVersion: {
|
|
80
|
-
major: 0,
|
|
81
|
-
minor: 1
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
75
|
function _defineProperty(obj, key, value) {
|
|
86
76
|
key = _toPropertyKey(key);
|
|
87
77
|
if (key in obj) {
|
|
@@ -125,320 +115,6 @@ function _toPropertyKey(arg) {
|
|
|
125
115
|
return typeof key === "symbol" ? key : String(key);
|
|
126
116
|
}
|
|
127
117
|
|
|
128
|
-
/**
|
|
129
|
-
* A stripped version of Icon.jsx from webapp. Takes an SVG icon and renders it
|
|
130
|
-
* inline like Font Awesome did.
|
|
131
|
-
*
|
|
132
|
-
* If you are looking for an icon that we've used before you should look in
|
|
133
|
-
* webapp's `icon-paths.js` which is a reference file for all the SVG paths
|
|
134
|
-
* that we've used. You'll need to copy the object from that file into
|
|
135
|
-
* whichever file you're using the icon and explicitly pass it in to the
|
|
136
|
-
* <InlineIcon/> React component.
|
|
137
|
-
*
|
|
138
|
-
* We assume that the viewBox is cropped and aligned to (0, 0), but icons can
|
|
139
|
-
* be defined differently. At some point we might want to add these attributes
|
|
140
|
-
* to `icon-paths.js`, but for now this is a fairly safe assumption.
|
|
141
|
-
*
|
|
142
|
-
* Sample usage:
|
|
143
|
-
*
|
|
144
|
-
* const editIcon = {
|
|
145
|
-
* path: "M41.209 53.753l5.39 0l0 5.39l3.136 0l6.468-6.517-8.477-8.526-6.517 6.517l0 3.136zm33.173-34.937q-.882-.882-1.862.049l-19.6 19.6q-.931.98-.049 1.862t1.862-.049l19.6-19.6q.931-.98.049-1.862zm-38.563 45.668l0-16.121l37.632-37.632 16.17 16.121-37.632 37.632l-16.17 0zm43.022-12.397l0 10.633q-.049 6.713-4.753 11.417t-11.368 4.704l-46.599 0q-6.713 0-11.417-4.753t-4.704-11.368l0-46.599q0-6.664 4.753-11.417t11.368-4.704l46.599 0q3.528 0 6.566 1.372.833.392.98 1.323t-.49 1.617l-2.744 2.744q-.784.784-1.96.441t-2.352-.343l-46.599 0q-3.675 0-6.321 2.646t-2.646 6.321l0 46.599q0 3.675 2.646 6.321t6.321 2.646l46.599 0q3.675 0 6.321-2.646t2.646-6.321l0-7.056q0-.735.49-1.225l3.577-3.577q.833-.833 1.96-.392t1.127 1.617zm7.203-51.646q2.254 0 3.773 1.568l8.526 8.526q1.568 1.568 1.568 3.822t-1.568 3.773l-5.145 5.145-16.121-16.121 5.145-5.145q1.568-1.568 3.822-1.568z",
|
|
146
|
-
* width: 100,
|
|
147
|
-
* height: 78.912,
|
|
148
|
-
* };
|
|
149
|
-
* <InlineIcon {...editIcon} />
|
|
150
|
-
*
|
|
151
|
-
*/
|
|
152
|
-
const InlineIcon = _ref => {
|
|
153
|
-
let {
|
|
154
|
-
path,
|
|
155
|
-
width,
|
|
156
|
-
height,
|
|
157
|
-
style = {},
|
|
158
|
-
title
|
|
159
|
-
} = _ref;
|
|
160
|
-
return /*#__PURE__*/React__namespace.createElement("svg", {
|
|
161
|
-
role: "img",
|
|
162
|
-
"aria-hidden": !title,
|
|
163
|
-
style: {
|
|
164
|
-
verticalAlign: "middle",
|
|
165
|
-
...style
|
|
166
|
-
},
|
|
167
|
-
width: "".concat(width / height, "em"),
|
|
168
|
-
height: "1em",
|
|
169
|
-
viewBox: "0 0 ".concat(width, " ").concat(height)
|
|
170
|
-
}, !!title && /*#__PURE__*/React__namespace.createElement("title", null, title), /*#__PURE__*/React__namespace.createElement("path", {
|
|
171
|
-
d: path,
|
|
172
|
-
fill: "currentColor"
|
|
173
|
-
}));
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
let _dependencies = null;
|
|
177
|
-
const setDependencies = dependencies => {
|
|
178
|
-
_dependencies = dependencies;
|
|
179
|
-
};
|
|
180
|
-
const getDependencies = () => {
|
|
181
|
-
if (_dependencies) {
|
|
182
|
-
return _dependencies;
|
|
183
|
-
}
|
|
184
|
-
throw new Error(["Perseus has not been provided required dependencies.", "setDependencies(dependencies) must be called first.", "Make sure Perseus is being imported from javascript/perseus/perseus.js."].join("\n"));
|
|
185
|
-
};
|
|
186
|
-
const DependenciesContext = /*#__PURE__*/React__namespace.createContext({
|
|
187
|
-
analytics: {
|
|
188
|
-
onAnalyticsEvent: async () => {}
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* useDependencies provides easy access to the current Perseus dependencies.
|
|
194
|
-
*/
|
|
195
|
-
const useDependencies = () => {
|
|
196
|
-
const deps = React__namespace.useContext(DependenciesContext);
|
|
197
|
-
return deps;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
var dependencies = /*#__PURE__*/Object.freeze({
|
|
201
|
-
__proto__: null,
|
|
202
|
-
setDependencies: setDependencies,
|
|
203
|
-
getDependencies: getDependencies,
|
|
204
|
-
DependenciesContext: DependenciesContext,
|
|
205
|
-
useDependencies: useDependencies
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
const prettyBig = {
|
|
209
|
-
fontSize: "150%"
|
|
210
|
-
};
|
|
211
|
-
const slightlyBig = {
|
|
212
|
-
fontSize: "120%"
|
|
213
|
-
};
|
|
214
|
-
const symbStyle = {
|
|
215
|
-
fontSize: "130%"
|
|
216
|
-
};
|
|
217
|
-
// These are functions because we want to generate a new component for each use
|
|
218
|
-
// on the page rather than reusing an instance (which will cause an error).
|
|
219
|
-
// Also, it's useful for things which might look different depending on the
|
|
220
|
-
// props.
|
|
221
|
-
|
|
222
|
-
const basic = [() => [/*#__PURE__*/React__namespace.createElement("span", {
|
|
223
|
-
key: "plus",
|
|
224
|
-
style: slightlyBig
|
|
225
|
-
}, "+"), "PLUS", i18n__namespace._("Plus")], () => [/*#__PURE__*/React__namespace.createElement("span", {
|
|
226
|
-
key: "minus",
|
|
227
|
-
style: prettyBig
|
|
228
|
-
}, "-"), "MINUS", i18n__namespace._("Minus")],
|
|
229
|
-
// TODO(joel) - display as \cdot when appropriate
|
|
230
|
-
props => {
|
|
231
|
-
const {
|
|
232
|
-
TeX
|
|
233
|
-
} = getDependencies();
|
|
234
|
-
if (props.convertDotToTimes) {
|
|
235
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
236
|
-
key: "times",
|
|
237
|
-
style: prettyBig
|
|
238
|
-
}, i18n__namespace.doNotTranslate("\\times")), "TIMES", i18n__namespace._("Multiply")];
|
|
239
|
-
}
|
|
240
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
241
|
-
key: "times",
|
|
242
|
-
style: prettyBig
|
|
243
|
-
}, i18n__namespace.doNotTranslate("\\cdot")), "CDOT", i18n__namespace._("Multiply")];
|
|
244
|
-
}, () => {
|
|
245
|
-
const {
|
|
246
|
-
TeX
|
|
247
|
-
} = getDependencies();
|
|
248
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
249
|
-
key: "frac",
|
|
250
|
-
style: prettyBig
|
|
251
|
-
}, i18n__namespace.doNotTranslate("\\frac{x}{y}")), "FRAC", i18n__namespace._("Fraction, excluding the current expression")];
|
|
252
|
-
}];
|
|
253
|
-
const buttonSets = {
|
|
254
|
-
basic,
|
|
255
|
-
"basic+div": basic.concat([() => {
|
|
256
|
-
const {
|
|
257
|
-
TeX
|
|
258
|
-
} = getDependencies();
|
|
259
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
260
|
-
key: "div"
|
|
261
|
-
}, i18n__namespace.doNotTranslate("\\div")), "DIVIDE", i18n__namespace._("Divide")];
|
|
262
|
-
}]),
|
|
263
|
-
trig: [() => {
|
|
264
|
-
const {
|
|
265
|
-
TeX
|
|
266
|
-
} = getDependencies();
|
|
267
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
268
|
-
key: "sin"
|
|
269
|
-
}, i18n__namespace.doNotTranslate("\\sin")), "SIN", i18n__namespace._("Sine")];
|
|
270
|
-
}, () => {
|
|
271
|
-
const {
|
|
272
|
-
TeX
|
|
273
|
-
} = getDependencies();
|
|
274
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
275
|
-
key: "cos"
|
|
276
|
-
}, i18n__namespace.doNotTranslate("\\cos")), "COS", i18n__namespace._("Cosine")];
|
|
277
|
-
}, () => {
|
|
278
|
-
const {
|
|
279
|
-
TeX
|
|
280
|
-
} = getDependencies();
|
|
281
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
282
|
-
key: "tan"
|
|
283
|
-
}, i18n__namespace.doNotTranslate("\\tan")), "TAN", i18n__namespace._("Tangent")];
|
|
284
|
-
}, () => {
|
|
285
|
-
const {
|
|
286
|
-
TeX
|
|
287
|
-
} = getDependencies();
|
|
288
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
289
|
-
key: "theta",
|
|
290
|
-
style: symbStyle
|
|
291
|
-
}, i18n__namespace.doNotTranslate("\\theta")), "THETA", i18n__namespace._("Theta")];
|
|
292
|
-
}, () => {
|
|
293
|
-
const {
|
|
294
|
-
TeX
|
|
295
|
-
} = getDependencies();
|
|
296
|
-
return [/*#__PURE__*/React__namespace.createElement("span", {
|
|
297
|
-
key: "phi"
|
|
298
|
-
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
299
|
-
className: "perseus-sr-only"
|
|
300
|
-
}, i18n__namespace.doNotTranslate("phi")), /*#__PURE__*/React__namespace.createElement(TeX, {
|
|
301
|
-
key: "pi",
|
|
302
|
-
style: symbStyle
|
|
303
|
-
}, i18n__namespace.doNotTranslate("\\phi"))), "PHI", i18n__namespace._("Phi")];
|
|
304
|
-
}],
|
|
305
|
-
prealgebra: [() => {
|
|
306
|
-
const {
|
|
307
|
-
TeX
|
|
308
|
-
} = getDependencies();
|
|
309
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
310
|
-
key: "sqrt"
|
|
311
|
-
}, i18n__namespace.doNotTranslate("\\sqrt{x}")), "SQRT", i18n__namespace._("Square root")];
|
|
312
|
-
},
|
|
313
|
-
// TODO(joel) - how does desmos do this?
|
|
314
|
-
() => {
|
|
315
|
-
const {
|
|
316
|
-
TeX
|
|
317
|
-
} = getDependencies();
|
|
318
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
319
|
-
key: "nthroot"
|
|
320
|
-
}, i18n__namespace.doNotTranslate("\\sqrt[3]{x}")), "NTHROOT3", i18n__namespace._("Cube root")];
|
|
321
|
-
}, () => {
|
|
322
|
-
const {
|
|
323
|
-
TeX
|
|
324
|
-
} = getDependencies();
|
|
325
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
326
|
-
key: "pow",
|
|
327
|
-
style: slightlyBig
|
|
328
|
-
}, i18n__namespace.doNotTranslate("a^b")), "POW", i18n__namespace._("Exponent")];
|
|
329
|
-
}, () => {
|
|
330
|
-
const {
|
|
331
|
-
TeX
|
|
332
|
-
} = getDependencies();
|
|
333
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
334
|
-
key: "pi",
|
|
335
|
-
style: slightlyBig
|
|
336
|
-
}, i18n__namespace.doNotTranslate("\\pi")), "PI", i18n__namespace._("Pi")];
|
|
337
|
-
}],
|
|
338
|
-
logarithms: [() => {
|
|
339
|
-
const {
|
|
340
|
-
TeX
|
|
341
|
-
} = getDependencies();
|
|
342
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
343
|
-
key: "log"
|
|
344
|
-
}, i18n__namespace.doNotTranslate("\\log")), "LOG", i18n__namespace._("Logarithm with base 10")];
|
|
345
|
-
}, () => {
|
|
346
|
-
const {
|
|
347
|
-
TeX
|
|
348
|
-
} = getDependencies();
|
|
349
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
350
|
-
key: "ln"
|
|
351
|
-
}, i18n__namespace.doNotTranslate("\\ln")), "LN", i18n__namespace._("Natural logarithm")];
|
|
352
|
-
}, () => {
|
|
353
|
-
const {
|
|
354
|
-
TeX
|
|
355
|
-
} = getDependencies();
|
|
356
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
357
|
-
key: "log_b"
|
|
358
|
-
}, i18n__namespace.doNotTranslate("\\log_b")), "LOG_B", i18n__namespace._("Logarithm with custom base")];
|
|
359
|
-
}],
|
|
360
|
-
"basic relations": [() => {
|
|
361
|
-
const {
|
|
362
|
-
TeX
|
|
363
|
-
} = getDependencies();
|
|
364
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
365
|
-
key: "eq"
|
|
366
|
-
}, "="), "EQUAL", i18n__namespace._("Equals sign")];
|
|
367
|
-
}, () => {
|
|
368
|
-
const {
|
|
369
|
-
TeX
|
|
370
|
-
} = getDependencies();
|
|
371
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
372
|
-
key: "lt"
|
|
373
|
-
}, i18n__namespace.doNotTranslate("\\lt")), "LT", i18n__namespace._("Less than sign")];
|
|
374
|
-
}, () => {
|
|
375
|
-
const {
|
|
376
|
-
TeX
|
|
377
|
-
} = getDependencies();
|
|
378
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
379
|
-
key: "gt"
|
|
380
|
-
}, i18n__namespace.doNotTranslate("\\gt")), "GT", i18n__namespace._("Greater than sign")];
|
|
381
|
-
}],
|
|
382
|
-
"advanced relations": [() => {
|
|
383
|
-
const {
|
|
384
|
-
TeX
|
|
385
|
-
} = getDependencies();
|
|
386
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
387
|
-
key: "neq"
|
|
388
|
-
}, i18n__namespace.doNotTranslate("\\neq")), "NEQ", i18n__namespace._("Not-equals sign")];
|
|
389
|
-
}, () => {
|
|
390
|
-
const {
|
|
391
|
-
TeX
|
|
392
|
-
} = getDependencies();
|
|
393
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
394
|
-
key: "leq"
|
|
395
|
-
}, i18n__namespace.doNotTranslate("\\leq")), "LEQ", i18n__namespace._("Less than or equal to sign")];
|
|
396
|
-
}, () => {
|
|
397
|
-
const {
|
|
398
|
-
TeX
|
|
399
|
-
} = getDependencies();
|
|
400
|
-
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
401
|
-
key: "geq"
|
|
402
|
-
}, i18n__namespace.doNotTranslate("\\geq")), "GEQ", i18n__namespace._("Greater than or equal to sign")];
|
|
403
|
-
}]
|
|
404
|
-
};
|
|
405
|
-
const buttonSetsPropType = PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOf(___default["default"](buttonSets).keys()));
|
|
406
|
-
class TexButtons extends React__namespace.Component {
|
|
407
|
-
render() {
|
|
408
|
-
// Always show buttonSets in the same order. Note: Technically it's ok
|
|
409
|
-
// for _.keys() to return the keys in an arbitrary order, but in
|
|
410
|
-
// practice, they will be ordered as listed above.
|
|
411
|
-
const sortedButtonSets = ___default["default"].sortBy(this.props.sets, setName =>
|
|
412
|
-
// @ts-expect-error - TS2345 - Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
|
413
|
-
___default["default"].keys(buttonSets).indexOf(setName));
|
|
414
|
-
const buttons = ___default["default"](sortedButtonSets).map(setName => buttonSets[setName]);
|
|
415
|
-
const buttonRows = ___default["default"](buttons).map(row => row.map(symbGen => {
|
|
416
|
-
// create a (component, thing we should send to mathquill) pair
|
|
417
|
-
const symbol = symbGen(this.props);
|
|
418
|
-
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
419
|
-
onClick: () => this.props.onInsert(symbol[1]),
|
|
420
|
-
className: "tex-button"
|
|
421
|
-
// @ts-expect-error - TS2533 - Object is possibly 'null' or 'undefined'. | TS2339 - Property 'key' does not exist on type 'boolean | ReactChild | ReactFragment | ReactPortal'.
|
|
422
|
-
,
|
|
423
|
-
key: symbol[0].key,
|
|
424
|
-
type: "button",
|
|
425
|
-
"aria-label": symbol[2]
|
|
426
|
-
}, symbol[0]);
|
|
427
|
-
}));
|
|
428
|
-
const buttonPopup = ___default["default"](buttonRows).map((row, i) => {
|
|
429
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
430
|
-
className: "clearfix tex-button-row",
|
|
431
|
-
key: this.props.sets[i]
|
|
432
|
-
}, row);
|
|
433
|
-
});
|
|
434
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
435
|
-
className: "".concat(this.props.className || "", " preview-measure")
|
|
436
|
-
}, buttonPopup);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
_defineProperty(TexButtons, "buttonSets", buttonSets);
|
|
440
|
-
_defineProperty(TexButtons, "buttonSetsType", buttonSetsPropType);
|
|
441
|
-
|
|
442
118
|
const customKeyTranslator = {
|
|
443
119
|
...mathInput.keyTranslator,
|
|
444
120
|
// If there's something in the input that can become part of a
|
|
@@ -461,57 +137,9 @@ class MathInput extends React__namespace.Component {
|
|
|
461
137
|
_defineProperty(this, "__mathFieldWrapperRef", null);
|
|
462
138
|
_defineProperty(this, "__mathField", null);
|
|
463
139
|
_defineProperty(this, "state", {
|
|
464
|
-
focused: false
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
this.setState({
|
|
468
|
-
focused: true
|
|
469
|
-
});
|
|
470
|
-
// TODO(joel) fix properly - we should probably allow onFocus handlers
|
|
471
|
-
// to this property, but we need to work correctly with them.
|
|
472
|
-
// if (this.props.onFocus) {
|
|
473
|
-
// this.props.onFocus();
|
|
474
|
-
// }
|
|
475
|
-
});
|
|
476
|
-
_defineProperty(this, "handleMouseDown", event => {
|
|
477
|
-
// @ts-expect-error - TS2531 - Object is possibly 'null'. | TS2345 - Argument of type 'EventTarget | null' is not assignable to parameter of type 'Node | null'.
|
|
478
|
-
const focused = ReactDOM__default["default"].findDOMNode(this).contains(event.target);
|
|
479
|
-
this.mouseDown = focused;
|
|
480
|
-
if (!focused) {
|
|
481
|
-
this.setState({
|
|
482
|
-
focused: false
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
_defineProperty(this, "handleMouseUp", () => {
|
|
487
|
-
// this mouse click started in the buttons div so we should focus the
|
|
488
|
-
// input
|
|
489
|
-
if (this.mouseDown) {
|
|
490
|
-
this.focus();
|
|
491
|
-
}
|
|
492
|
-
this.mouseDown = false;
|
|
493
|
-
});
|
|
494
|
-
_defineProperty(this, "handleBlur", e => {
|
|
495
|
-
// TODO(michaelpolyak): Consider trapping focus within the button group.
|
|
496
|
-
// Focusing back on the input when TAB out of the last button in the
|
|
497
|
-
// group. This will probably require ESCAPE key handling to enable to
|
|
498
|
-
// close (blur) the button group in order to focus on next page element.
|
|
499
|
-
if (!this.mouseDown &&
|
|
500
|
-
// @ts-expect-error - TS2531 - Object is possibly 'null'.
|
|
501
|
-
!ReactDOM__default["default"].findDOMNode(this).contains(e.relatedTarget)) {
|
|
502
|
-
this.setState({
|
|
503
|
-
focused: false
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
_defineProperty(this, "_shouldShowButtons", () => {
|
|
508
|
-
if (this.props.buttonsVisible === "always") {
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
if (this.props.buttonsVisible === "never") {
|
|
512
|
-
return false;
|
|
513
|
-
}
|
|
514
|
-
return this.state.focused;
|
|
140
|
+
focused: false,
|
|
141
|
+
keypadOpen: this.props.buttonsVisible === "always" ? true : false,
|
|
142
|
+
cursorContext: mathInput.CursorContext.NONE
|
|
515
143
|
});
|
|
516
144
|
_defineProperty(this, "insert", value => {
|
|
517
145
|
const input = this.mathField();
|
|
@@ -574,6 +202,9 @@ class MathInput extends React__namespace.Component {
|
|
|
574
202
|
if (this.props.value !== value) {
|
|
575
203
|
this.props.onChange(value);
|
|
576
204
|
}
|
|
205
|
+
this.setState({
|
|
206
|
+
cursorContext: mathInput.getCursorContext(mathField)
|
|
207
|
+
});
|
|
577
208
|
},
|
|
578
209
|
enter: () => {
|
|
579
210
|
// NOTE(kevinb): This isn't how answers to exercises are
|
|
@@ -606,34 +237,50 @@ class MathInput extends React__namespace.Component {
|
|
|
606
237
|
focused: true
|
|
607
238
|
});
|
|
608
239
|
});
|
|
609
|
-
_defineProperty(this, "blur", () => {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
240
|
+
_defineProperty(this, "blur", () => this.setState({
|
|
241
|
+
focused: false
|
|
242
|
+
}));
|
|
243
|
+
_defineProperty(this, "handleKeypadPress", (key, e) => {
|
|
244
|
+
const translator = mathInput.keyTranslator[key];
|
|
245
|
+
const mathField = this.mathField();
|
|
246
|
+
if (mathField) {
|
|
247
|
+
if (translator) {
|
|
248
|
+
translator(mathField, key);
|
|
249
|
+
}
|
|
250
|
+
this.setState({
|
|
251
|
+
cursorContext: mathInput.getCursorContext(mathField)
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// We want to prevent taking focus from input when clicking on keypad
|
|
256
|
+
// Clickable handles "onClick" differently than react;
|
|
257
|
+
// a keyboard event is "keydown" type.
|
|
258
|
+
// In react without WonderBlocks, "enter" or "space" keydown events
|
|
259
|
+
// are also "click" events, differentiated by "detail".
|
|
260
|
+
if (e.type === "click") {
|
|
261
|
+
this.focus();
|
|
262
|
+
}
|
|
615
263
|
});
|
|
616
264
|
}
|
|
617
265
|
componentDidMount() {
|
|
618
|
-
var _this$
|
|
619
|
-
window.addEventListener("mousedown", this.handleMouseDown);
|
|
620
|
-
window.addEventListener("mouseup", this.handleMouseUp);
|
|
621
|
-
|
|
266
|
+
var _this$mathField2;
|
|
622
267
|
// Ideally, we would be able to pass an initial value directly into
|
|
623
268
|
// the constructor
|
|
624
|
-
(_this$
|
|
269
|
+
(_this$mathField2 = this.mathField()) === null || _this$mathField2 === void 0 ? void 0 : _this$mathField2.latex(this.props.value);
|
|
625
270
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
271
|
+
openKeypad() {
|
|
272
|
+
if (this.props.buttonsVisible === "never") {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
this.setState({
|
|
276
|
+
keypadOpen: true
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
closeKeypad() {
|
|
280
|
+
this.setState({
|
|
281
|
+
keypadOpen: false
|
|
282
|
+
});
|
|
629
283
|
}
|
|
630
|
-
|
|
631
|
-
// handlers:
|
|
632
|
-
// keep track of two related bits of state:
|
|
633
|
-
// * this.state.focused - whether the buttons are currently shown
|
|
634
|
-
// * this.mouseDown - whether a mouse click is active that started in the
|
|
635
|
-
// buttons div
|
|
636
|
-
|
|
637
284
|
render() {
|
|
638
285
|
let className = classNames__default["default"]({
|
|
639
286
|
"perseus-math-input": true,
|
|
@@ -645,439 +292,196 @@ class MathInput extends React__namespace.Component {
|
|
|
645
292
|
if (this.props.className) {
|
|
646
293
|
className = className + " " + this.props.className;
|
|
647
294
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
// @ts-expect-error - TS2322 - Type 'Element' is not assignable to type 'null'.
|
|
651
|
-
buttons = /*#__PURE__*/React__namespace.createElement(TexButtons, {
|
|
652
|
-
sets: this.props.buttonSets,
|
|
653
|
-
className: "math-input-buttons absolute",
|
|
654
|
-
convertDotToTimes: this.props.convertDotToTimes,
|
|
655
|
-
onInsert: this.insert
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
659
|
-
style: {
|
|
660
|
-
display: "inline-block"
|
|
661
|
-
}
|
|
295
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
296
|
+
style: [styles$A.outerWrapper, this.state.focused && styles$A.wrapperFocused, this.props.hasError && styles$A.wrapperError]
|
|
662
297
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
663
298
|
style: {
|
|
664
|
-
display: "
|
|
299
|
+
display: "flex",
|
|
300
|
+
padding: 1
|
|
301
|
+
},
|
|
302
|
+
onClick: () => {
|
|
303
|
+
const mathField = this.mathField();
|
|
304
|
+
if (!mathField) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.setState({
|
|
308
|
+
cursorContext: mathInput.getCursorContext(mathField)
|
|
309
|
+
});
|
|
665
310
|
}
|
|
666
311
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
667
312
|
className: className,
|
|
668
313
|
ref: ref => this.__mathFieldWrapperRef = ref,
|
|
669
314
|
"aria-label": this.props.labelText,
|
|
670
|
-
onFocus: this.
|
|
671
|
-
onBlur: this.
|
|
672
|
-
})
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
315
|
+
onFocus: () => this.focus(),
|
|
316
|
+
onBlur: () => this.blur()
|
|
317
|
+
}), /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.Popover, {
|
|
318
|
+
opened: this.state.keypadOpen,
|
|
319
|
+
onClose: () => this.closeKeypad(),
|
|
320
|
+
dismissEnabled: true,
|
|
321
|
+
content: () => {
|
|
322
|
+
var _this$props$keypadBut, _this$props;
|
|
323
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
|
|
324
|
+
closeButtonVisible: true,
|
|
325
|
+
style: styles$A.popoverContent
|
|
326
|
+
}, /*#__PURE__*/React__namespace.createElement(mathInput.DesktopKeypad, _extends({
|
|
327
|
+
onAnalyticsEvent: this.props.analytics.onAnalyticsEvent,
|
|
328
|
+
extraKeys: this.props.extraKeys,
|
|
329
|
+
onClickKey: this.handleKeypadPress,
|
|
330
|
+
cursorContext: this.state.cursorContext,
|
|
331
|
+
convertDotToTimes: this.props.convertDotToTimes
|
|
332
|
+
}, (_this$props$keypadBut = this.props.keypadButtonSets) !== null && _this$props$keypadBut !== void 0 ? _this$props$keypadBut : mapButtonSets((_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.buttonSets))));
|
|
333
|
+
}
|
|
334
|
+
}, this.props.buttonsVisible === "never" ? /*#__PURE__*/React__namespace.createElement(MathInputIcon, {
|
|
335
|
+
hovered: false,
|
|
336
|
+
focused: false,
|
|
337
|
+
active: false
|
|
338
|
+
}) : /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
|
|
339
|
+
"aria-label": this.state.keypadOpen ? i18n__namespace._("close math keypad") : i18n__namespace._("open math keypad"),
|
|
340
|
+
"aria-checked": this.state.keypadOpen,
|
|
341
|
+
role: "switch",
|
|
342
|
+
onClick: () => this.state.keypadOpen ? this.closeKeypad() : this.openKeypad()
|
|
343
|
+
}, props => /*#__PURE__*/React__namespace.createElement(MathInputIcon, _extends({
|
|
344
|
+
active: this.state.keypadOpen
|
|
345
|
+
}, props))))));
|
|
678
346
|
}
|
|
679
347
|
}
|
|
680
348
|
_defineProperty(MathInput, "defaultProps", {
|
|
681
349
|
value: "",
|
|
682
|
-
convertDotToTimes: false
|
|
683
|
-
buttonsVisible: "focused"
|
|
350
|
+
convertDotToTimes: false
|
|
684
351
|
});
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
352
|
+
const MathInputIcon = _ref => {
|
|
353
|
+
let {
|
|
354
|
+
hovered,
|
|
355
|
+
focused,
|
|
356
|
+
active
|
|
357
|
+
} = _ref;
|
|
358
|
+
let color;
|
|
359
|
+
switch (true) {
|
|
360
|
+
case focused || active:
|
|
361
|
+
color = Color__default["default"].white;
|
|
362
|
+
break;
|
|
363
|
+
case hovered:
|
|
364
|
+
color = Color__default["default"].blue;
|
|
365
|
+
break;
|
|
366
|
+
default:
|
|
367
|
+
color = Color__default["default"].offBlack;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
const dynamicClass = active || focused ? styles$A.iconActive : styles$A.iconInactive;
|
|
371
|
+
return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
372
|
+
style: [styles$A.iconContainer, dynamicClass]
|
|
373
|
+
}, /*#__PURE__*/React__namespace.createElement("svg", {
|
|
374
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
375
|
+
width: "16",
|
|
376
|
+
height: "16",
|
|
377
|
+
fill: color,
|
|
378
|
+
viewBox: "0 0 256 256"
|
|
379
|
+
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
380
|
+
d: "M112,72a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16h64A8,8,0,0,1,112,72Zm-8,104H80V152a8,8,0,0,0-16,0v24H40a8,8,0,0,0,0,16H64v24a8,8,0,0,0,16,0V192h24a8,8,0,0,0,0-16Zm48,0h64a8,8,0,0,0,0-16H152a8,8,0,0,0,0,16Zm64,16H152a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm-61.66-90.34a8,8,0,0,0,11.32,0L184,83.31l18.34,18.35a8,8,0,0,0,11.32-11.32L195.31,72l18.35-18.34a8,8,0,0,0-11.32-11.32L184,60.69,165.66,42.34a8,8,0,0,0-11.32,11.32L172.69,72,154.34,90.34A8,8,0,0,0,154.34,101.66Z"
|
|
381
|
+
})));
|
|
382
|
+
};
|
|
383
|
+
const mapButtonSets = buttonSets => {
|
|
384
|
+
const keypadButtonSets = {};
|
|
385
|
+
if (!buttonSets) {
|
|
386
|
+
return keypadButtonSets;
|
|
713
387
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
388
|
+
buttonSets.forEach(buttonSet => {
|
|
389
|
+
switch (buttonSet) {
|
|
390
|
+
case "advanced relations":
|
|
391
|
+
keypadButtonSets.advancedRelations = true;
|
|
392
|
+
break;
|
|
393
|
+
case "basic relations":
|
|
394
|
+
keypadButtonSets.basicRelations = true;
|
|
395
|
+
break;
|
|
396
|
+
case "basic+div":
|
|
397
|
+
keypadButtonSets.divisionKey = true;
|
|
398
|
+
break;
|
|
399
|
+
case "logarithms":
|
|
400
|
+
keypadButtonSets.logarithms = true;
|
|
401
|
+
break;
|
|
402
|
+
case "prealgebra":
|
|
403
|
+
keypadButtonSets.preAlgebra = true;
|
|
404
|
+
break;
|
|
405
|
+
case "trig":
|
|
406
|
+
keypadButtonSets.trigonometry = true;
|
|
407
|
+
break;
|
|
726
408
|
}
|
|
727
409
|
});
|
|
410
|
+
return keypadButtonSets;
|
|
728
411
|
};
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
//const isRight = (this.props.horizontalDirection === "right");
|
|
734
|
-
const isTop = props.verticalDirection === "top";
|
|
735
|
-
const frontTopOffset = isTop ? 0 : 1;
|
|
736
|
-
const borderTopOffset = isTop ? 0 : -1;
|
|
737
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
738
|
-
style: {
|
|
739
|
-
display: "block",
|
|
740
|
-
position: props.position,
|
|
741
|
-
visibility: props.visibility,
|
|
742
|
-
left: props.left,
|
|
743
|
-
top: props["top"],
|
|
744
|
-
width: props.width + 2,
|
|
745
|
-
height: props.height + 1,
|
|
746
|
-
marginTop: -1,
|
|
747
|
-
marginBottom: -2,
|
|
748
|
-
zIndex: zIndex
|
|
749
|
-
}
|
|
750
|
-
}, /*#__PURE__*/React__namespace.createElement(Triangle, {
|
|
751
|
-
horizontalDirection: props.horizontalDirection,
|
|
752
|
-
verticalDirection: props.verticalDirection,
|
|
753
|
-
color: props.border,
|
|
754
|
-
left: 0,
|
|
755
|
-
top: borderTopOffset,
|
|
756
|
-
width: props.width + 2 // one extra for the diagonal
|
|
757
|
-
,
|
|
758
|
-
height: props.height + 2
|
|
759
|
-
}), /*#__PURE__*/React__namespace.createElement(Triangle, {
|
|
760
|
-
horizontalDirection: props.horizontalDirection,
|
|
761
|
-
verticalDirection: props.verticalDirection,
|
|
762
|
-
color: props.color,
|
|
763
|
-
left: 1,
|
|
764
|
-
top: frontTopOffset,
|
|
765
|
-
width: props.width,
|
|
766
|
-
height: props.height
|
|
767
|
-
}));
|
|
768
|
-
};
|
|
769
|
-
TooltipArrow.defaultProps = {
|
|
770
|
-
position: "relative",
|
|
771
|
-
visibility: "visible",
|
|
772
|
-
left: 0,
|
|
773
|
-
top: 0
|
|
412
|
+
const inputFocused = {
|
|
413
|
+
borderWidth: 2,
|
|
414
|
+
borderColor: Color__default["default"].blue,
|
|
415
|
+
margin: -1
|
|
774
416
|
};
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
|
|
417
|
+
const styles$A = aphrodite.StyleSheet.create({
|
|
418
|
+
iconContainer: {
|
|
419
|
+
display: "flex",
|
|
420
|
+
justifyContent: "center",
|
|
421
|
+
height: "100%",
|
|
422
|
+
padding: Spacing__default["default"].xxxSmall_4,
|
|
423
|
+
borderRadius: 1
|
|
778
424
|
},
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
const HORIZONTAL_CORNERS = {
|
|
784
|
-
left: {
|
|
785
|
-
targetLeft: 0
|
|
425
|
+
iconInactive: {
|
|
426
|
+
backgroundColor: Color__default["default"].offBlack8
|
|
786
427
|
},
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
|
-
const HORIZONTAL_ALIGNMNENTS = {
|
|
792
|
-
left: {
|
|
793
|
-
tooltipLeft: 0,
|
|
794
|
-
arrowLeft: arrowSize => 0
|
|
428
|
+
iconActive: {
|
|
429
|
+
backgroundColor: Color__default["default"].offBlack64
|
|
795
430
|
},
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
UNSAFE_componentWillReceiveProps() {
|
|
813
|
-
// If the contents have changed, reset our measure of the height
|
|
814
|
-
this.setState({
|
|
815
|
-
height: null
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
componentDidUpdate() {
|
|
819
|
-
this._updateHeight();
|
|
820
|
-
}
|
|
821
|
-
_renderToolTipDiv(isTooltipAbove) {
|
|
822
|
-
const settings = Object.assign({}, HORIZONTAL_CORNERS[this.props.horizontalPosition], HORIZONTAL_ALIGNMNENTS[this.props.horizontalAlign], VERTICAL_CORNERS[this.props.verticalPosition]);
|
|
823
|
-
let arrowAbove;
|
|
824
|
-
let arrowBelow;
|
|
825
|
-
if (isTooltipAbove) {
|
|
826
|
-
// We put an absolutely positioned arrow in the correct place
|
|
827
|
-
arrowAbove = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
828
|
-
verticalDirection: VerticalDirection.Top,
|
|
829
|
-
horizontalDirection: this.props.horizontalAlign,
|
|
830
|
-
position: "absolute",
|
|
831
|
-
color: "white",
|
|
832
|
-
border: this.props.borderColor,
|
|
833
|
-
left: settings.arrowLeft(this.props.arrowSize),
|
|
834
|
-
top: -this.props.arrowSize + 2,
|
|
835
|
-
width: this.props.arrowSize,
|
|
836
|
-
height: this.props.arrowSize,
|
|
837
|
-
zIndex: zIndex
|
|
838
|
-
});
|
|
839
|
-
|
|
840
|
-
// And we use a visibility: hidden arrow below to shift up the
|
|
841
|
-
// content by the correct amount
|
|
842
|
-
arrowBelow = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
843
|
-
verticalDirection: VerticalDirection.Top,
|
|
844
|
-
horizontalDirection: this.props.horizontalAlign,
|
|
845
|
-
visibility: "hidden",
|
|
846
|
-
color: "white",
|
|
847
|
-
border: this.props.borderColor,
|
|
848
|
-
left: settings.arrowLeft(this.props.arrowSize),
|
|
849
|
-
top: -1,
|
|
850
|
-
width: this.props.arrowSize,
|
|
851
|
-
height: this.props.arrowSize,
|
|
852
|
-
zIndex: zIndex
|
|
853
|
-
});
|
|
854
|
-
} else {
|
|
855
|
-
arrowAbove = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
856
|
-
verticalDirection: VerticalDirection.Bottom,
|
|
857
|
-
horizontalDirection: this.props.horizontalAlign,
|
|
858
|
-
color: "white",
|
|
859
|
-
border: this.props.borderColor,
|
|
860
|
-
left: settings.arrowLeft(this.props.arrowSize),
|
|
861
|
-
top: -1,
|
|
862
|
-
width: this.props.arrowSize,
|
|
863
|
-
height: this.props.arrowSize,
|
|
864
|
-
zIndex: zIndex
|
|
865
|
-
});
|
|
866
|
-
arrowBelow = null;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
/* A positioned div below the input to be the parent for our
|
|
870
|
-
tooltip */
|
|
871
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
872
|
-
style: {
|
|
873
|
-
position: "relative",
|
|
874
|
-
height: 0,
|
|
875
|
-
display: this.props.show ? "block" : "none"
|
|
876
|
-
}
|
|
877
|
-
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
878
|
-
// eslint-disable-next-line react/no-string-refs
|
|
879
|
-
ref: "tooltipContainer",
|
|
880
|
-
className: "tooltipContainer",
|
|
881
|
-
style: {
|
|
882
|
-
position: "absolute",
|
|
883
|
-
// height must start out undefined, not null, so that
|
|
884
|
-
// we can measure the actual height with jquery.
|
|
885
|
-
// This is used to position the tooltip with top: -100%
|
|
886
|
-
// when in verticalPosition: "top" mode
|
|
887
|
-
height: this.state.height || undefined,
|
|
888
|
-
left: settings.targetLeft
|
|
889
|
-
}
|
|
890
|
-
}, arrowAbove, /*#__PURE__*/React__namespace.createElement("div", {
|
|
891
|
-
className: this.props.className
|
|
892
|
-
// eslint-disable-next-line react/no-string-refs
|
|
893
|
-
,
|
|
894
|
-
ref: "tooltipContent",
|
|
895
|
-
style: {
|
|
896
|
-
position: "relative",
|
|
897
|
-
top: settings["top"],
|
|
898
|
-
left: settings.tooltipLeft,
|
|
899
|
-
border: "1px solid " + this.props.borderColor,
|
|
900
|
-
boxShadow: "0 1px 3px " + this.props.borderColor,
|
|
901
|
-
zIndex: zIndex - 1
|
|
902
|
-
}
|
|
903
|
-
}, this.props.children.slice(1)), arrowBelow));
|
|
904
|
-
}
|
|
905
|
-
_updateHeight() {
|
|
906
|
-
const tooltipContainer = ReactDOM__default["default"].findDOMNode(
|
|
907
|
-
// eslint-disable-next-line react/no-string-refs
|
|
908
|
-
this.refs.tooltipContainer);
|
|
909
|
-
const height = tooltipContainer.offsetHeight;
|
|
910
|
-
if (height !== this.state.height) {
|
|
911
|
-
this.setState({
|
|
912
|
-
height
|
|
913
|
-
});
|
|
431
|
+
outerWrapper: {
|
|
432
|
+
display: "inline-block",
|
|
433
|
+
borderStyle: "solid",
|
|
434
|
+
borderWidth: 1,
|
|
435
|
+
borderColor: Color__default["default"].offBlack50,
|
|
436
|
+
borderRadius: 3,
|
|
437
|
+
background: Color__default["default"].white,
|
|
438
|
+
":hover": inputFocused
|
|
439
|
+
},
|
|
440
|
+
wrapperFocused: inputFocused,
|
|
441
|
+
wrapperError: {
|
|
442
|
+
borderColor: Color__default["default"].red,
|
|
443
|
+
background: Color.fade(Color__default["default"].red, 0.08),
|
|
444
|
+
":hover": {
|
|
445
|
+
borderColor: Color__default["default"].red
|
|
914
446
|
}
|
|
447
|
+
},
|
|
448
|
+
popoverContent: {
|
|
449
|
+
padding: 0,
|
|
450
|
+
paddingBottom: Spacing__default["default"].xxSmall_6,
|
|
451
|
+
maxWidth: "initial"
|
|
915
452
|
}
|
|
916
|
-
|
|
917
|
-
const isTooltipAbove = this.props.verticalPosition === "top";
|
|
453
|
+
});
|
|
918
454
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
455
|
+
let _dependencies = null;
|
|
456
|
+
const setDependencies = dependencies => {
|
|
457
|
+
_dependencies = dependencies;
|
|
458
|
+
};
|
|
459
|
+
const getDependencies = () => {
|
|
460
|
+
if (_dependencies) {
|
|
461
|
+
return _dependencies;
|
|
462
|
+
}
|
|
463
|
+
throw new Error(["Perseus has not been provided required dependencies.", "setDependencies(dependencies) must be called first.", "Make sure Perseus is being imported from javascript/perseus/perseus.js."].join("\n"));
|
|
464
|
+
};
|
|
465
|
+
const DependenciesContext = /*#__PURE__*/React__namespace.createContext({
|
|
466
|
+
analytics: {
|
|
467
|
+
onAnalyticsEvent: async () => {}
|
|
923
468
|
}
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
// Sorry. // Apology-Oriented-Programming
|
|
927
|
-
_defineProperty(Tooltip, "defaultProps", {
|
|
928
|
-
className: "",
|
|
929
|
-
arrowSize: 10,
|
|
930
|
-
borderColor: "#ccc",
|
|
931
|
-
verticalPosition: VerticalDirection.Bottom,
|
|
932
|
-
horizontalPosition: HorizontalDirection.Left,
|
|
933
|
-
horizontalAlign: HorizontalDirection.Left,
|
|
934
|
-
targetContainerStyle: {}
|
|
935
469
|
});
|
|
936
470
|
|
|
937
471
|
/**
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
* These paths are taken directly from webapp's `icon-paths.js`. Unlike the
|
|
941
|
-
* webapp equivalent, these can be directly required within Perseus files since
|
|
942
|
-
* this is all bundled together anyway.
|
|
472
|
+
* useDependencies provides easy access to the current Perseus dependencies.
|
|
943
473
|
*/
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
width: 24,
|
|
948
|
-
height: 24
|
|
949
|
-
};
|
|
950
|
-
const iconCheckMedium = {
|
|
951
|
-
path: "M6.072 10.4l6.175-7.058a1 1 0 1 1 1.506 1.317L6.769 12.64a1 1 0 0 1-1.55-.054L2.203 8.604a1 1 0 1 1 1.594-1.208L6.072 10.4z",
|
|
952
|
-
width: 16,
|
|
953
|
-
height: 16
|
|
954
|
-
};
|
|
955
|
-
const iconChevronDown = {
|
|
956
|
-
path: "M99.669 13.048q0 3.36-2.352 5.712l-41.664 41.664q-2.408 2.408-5.88 2.408t-5.712-2.408l-41.664-41.664q-2.408-2.24-2.408-5.712t2.408-5.88l4.76-4.816q2.52-2.352 5.88-2.352t5.656 2.352l31.136 31.136 31.08-31.136q2.352-2.352 5.712-2.352t5.88 2.352l4.816 4.816q2.352 2.52 2.352 5.88z",
|
|
957
|
-
width: 100,
|
|
958
|
-
height: 63.034
|
|
959
|
-
};
|
|
960
|
-
const iconChevronRight = {
|
|
961
|
-
path: "M62.808 49.728q0 3.36-2.352 5.88l-41.72 41.664q-2.352 2.408-5.768 2.408t-5.768-2.408l-4.872-4.76q-2.352-2.52-2.352-5.88t2.352-5.712l31.08-31.136-31.08-31.024q-2.352-2.52-2.352-5.88t2.352-5.712l4.872-4.76q2.296-2.408 5.768-2.408t5.768 2.408l41.72 41.664q2.352 2.296 2.352 5.656z",
|
|
962
|
-
width: 63.034,
|
|
963
|
-
height: 100
|
|
964
|
-
};
|
|
965
|
-
const iconCircle = {
|
|
966
|
-
path: "M100.035 50.046q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
967
|
-
width: 100,
|
|
968
|
-
height: 100
|
|
969
|
-
};
|
|
970
|
-
const iconCircleArrowDown = {
|
|
971
|
-
path: "M50.046 83.676q1.767 0 2.907-1.14l29.526-29.526q1.197-1.197 1.197-2.907t-1.197-2.964l-5.928-5.928q-1.197-1.14-2.964-1.14t-2.907 1.14l-12.312 12.312l0-32.661q0-1.71-1.254-2.964t-2.907-1.254l-8.322 0q-1.71 0-2.964 1.254t-1.254 2.964l0 32.661l-12.312-12.312q-1.197-1.254-2.907-1.254t-2.907 1.254l-5.928 5.928q-1.197 1.197-1.197 2.964t1.197 2.907l29.469 29.526q1.197 1.14 2.964 1.14zm49.989-33.63q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
972
|
-
width: 100,
|
|
973
|
-
height: 100
|
|
974
|
-
};
|
|
975
|
-
const iconCircleArrowUp = {
|
|
976
|
-
path: "M54.207 83.391q1.653 0 2.907-1.254t1.254-2.907l0-32.718l12.312 12.312q1.254 1.254 2.964 1.254t2.907-1.254l5.928-5.928q1.197-1.197 1.14-2.964 0-1.767-1.14-2.907l-29.526-29.526q-1.197-1.14-2.907-1.14t-2.964 1.14l-29.469 29.526q-1.197 1.254-1.197 2.964t1.197 2.907l5.928 5.928q1.197 1.197 2.907 1.197t2.907-1.197l12.312-12.312l0 32.718q0 1.653 1.254 2.907t2.964 1.254l8.322 0zm45.828-33.345q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
977
|
-
width: 100,
|
|
978
|
-
height: 100
|
|
979
|
-
};
|
|
980
|
-
const iconCircleThin = {
|
|
981
|
-
path: "M50.046 8.322q-8.493 0-16.188 3.306-15.561 6.669-22.173 22.23-3.363 7.695-3.363 16.188t3.306 16.188 8.949 13.281q5.586 5.586 13.281 8.892t16.188 3.306 16.188-3.306 13.281-8.892 8.892-13.281 3.306-16.188-3.306-16.188-8.892-13.281-13.281-8.949q-7.695-3.306-16.188-3.306zm0 91.713q-13.623 0-25.137-6.726t-18.183-18.183q-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.126q-11.514 6.726-25.08 6.726z",
|
|
982
|
-
width: 100,
|
|
983
|
-
height: 99.944
|
|
984
|
-
};
|
|
985
|
-
const iconDesktop = {
|
|
986
|
-
path: "M94.208 52.119l0-43.746q0-.69-.506-1.15t-1.196-.506l-84.088 0q-.69 0-1.196.506t-.506 1.15l0 43.746q0 .69.506 1.196t1.196.506l84.088 0q.69 0 1.196-.506t.506-1.196zm6.716-43.746l0 57.224q0 3.45-2.484 5.934t-5.934 2.484l-28.566 0q0 3.128 2.53 7.774.828 1.61.828 2.622t-1.012 2.07q-1.012 1.012-2.346.966l-26.91 0q-1.38 0-2.392-1.012t-1.012-2.024q0-1.058 1.656-4.14t1.748-6.256l-28.612 0q-3.45 0-5.934-2.484t-2.484-5.934l0-57.224q0-3.45 2.484-5.934t5.934-2.438l84.088 0q3.45 0 5.98 2.438 2.438 2.484 2.438 5.934z",
|
|
987
|
-
width: 100,
|
|
988
|
-
height: 86.648
|
|
989
|
-
};
|
|
990
|
-
const iconDropdownArrow = {
|
|
991
|
-
path: "M9 9.8c0 .5.7 1.7 1.5 2.8 1.5 1.9 1.5 1.9 3 0C15.7 9.7 15.4 9 12 9c-1.6 0-3 .4-3 .8z",
|
|
992
|
-
width: 24,
|
|
993
|
-
height: 24
|
|
994
|
-
};
|
|
995
|
-
const iconExclamationSign = {
|
|
996
|
-
path: "M58.368 81.225l0-12.369q0-.912-.57-1.539t-1.425-.627l-12.54 0q-.855-.057-1.482.627t-.684 1.539l0 12.369q-.057.855.627 1.482t1.539.684l12.54 0q.855 0 1.425-.627t.57-1.539zm1.026-62.871q0-1.596-2.223-1.71l-14.307 0q-2.109 0-2.223 1.71l1.14 40.47q0 .627.627 1.14t1.539.456l12.084 0q.912-.057 1.539-.513t.684-1.083zm-9.348-18.354q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669z",
|
|
997
|
-
width: 100,
|
|
998
|
-
height: 99.944
|
|
999
|
-
};
|
|
1000
|
-
// Grabbed from https://github.com/encharm/Font-Awesome-SVG-PNG
|
|
1001
|
-
const iconGear = {
|
|
1002
|
-
path: "M1152 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm512-109v222q0 12-8 23t-20 13l-185 28q-19 54-39 91 35 50 107 138 10 12 10 25t-9 23q-27 37-99 108t-94 71q-12 0-26-9l-138-108q-44 23-91 38-16 136-29 186-7 28-36 28h-222q-14 0-24.5-8.5t-11.5-21.5l-28-184q-49-16-90-37l-141 107q-10 9-25 9-14 0-25-11-126-114-165-168-7-10-7-23 0-12 8-23 15-21 51-66.5t54-70.5q-27-50-41-99l-183-27q-13-2-21-12.5t-8-23.5v-222q0-12 8-23t19-13l186-28q14-46 39-92-40-57-107-138-10-12-10-24 0-10 9-23 26-36 98.5-107.5t94.5-71.5q13 0 26 10l138 107q44-23 91-38 16-136 29-186 7-28 36-28h222q14 0 24.5 8.5t11.5 21.5l28 184q49 16 90 37l142-107q9-9 24-9 13 0 25 10 129 119 165 170 7 8 7 22 0 12-8 23-15 21-51 66.5t-54 70.5q26 50 41 98l183 28q13 2 21 12.5t8 23.5z",
|
|
1003
|
-
width: 1792,
|
|
1004
|
-
height: 1792
|
|
1005
|
-
};
|
|
1006
|
-
const iconMobilePhone = {
|
|
1007
|
-
path: "M36.04 89.557q0-2.584-1.836-4.42t-4.42-1.836-4.352 1.836q-1.836 1.836-1.836 4.42t1.836 4.352 4.42 1.836q2.652-.068 4.42-1.836t1.768-4.352zm16.184-12.444l0-54.74q0-1.088-.748-1.768t-1.768-.68l-39.78 0q-1.088 0-1.768.748t-.68 1.7l0 54.74q0 1.02.748 1.768t1.7.68l39.78 0q1.02-.068 1.768-.748t.748-1.7zm-14.892-65.892q0-1.224-1.292-1.292l-12.444 0q-1.224.068-1.224 1.292t1.224 1.224l12.444 0q1.292 0 1.292-1.224zm22.372-1.292l0 79.628q0 3.944-2.992 6.936t-7.004 2.992l-39.78 0q-4.012 0-7.004-2.924-2.924-2.924-2.924-7.004l0-79.628q0-4.012 2.924-6.936t7.004-2.992l39.78 0q4.012-.068 7.004 2.924t2.992 7.004z",
|
|
1008
|
-
width: 60.013,
|
|
1009
|
-
height: 100
|
|
1010
|
-
};
|
|
1011
|
-
const iconOk = {
|
|
1012
|
-
path: "M37.964 76.048q-2.576 0-4.368-1.792l-31.864-31.864q-1.792-1.792-1.792-4.368t1.792-4.368l8.736-8.68q1.792-1.792 4.368-1.792t4.312 1.792l18.816 18.872 42-42.056q1.792-1.792 4.368-1.792t4.312 1.792l8.736 8.736q1.792 1.792 1.792 4.368t-1.792 4.312l-55.048 55.048q-1.792 1.792-4.368 1.792z",
|
|
1013
|
-
width: 100,
|
|
1014
|
-
height: 76.637
|
|
1015
|
-
};
|
|
1016
|
-
const iconPlus = {
|
|
1017
|
-
path: "M99.758 43.09l0 13.578q0 2.852-1.984 4.836t-4.836 1.984l-29.45 0l0 29.45q0 2.852-1.984 4.836t-4.836 1.984l-13.578 0q-2.852 0-4.836-1.984t-1.984-4.836l0-29.45l-29.45 0q-2.852 0-4.836-1.984t-1.984-4.836l0-13.578q0-2.852 1.984-4.836t4.836-1.984l29.45 0l0-29.45q0-2.852 1.984-4.836t4.836-1.984l13.578 0q2.852 0 4.836 1.984t1.984 4.836l0 29.45l29.45 0q2.852 0 4.836 1.984t1.984 4.836z",
|
|
1018
|
-
width: 100,
|
|
1019
|
-
height: 100
|
|
1020
|
-
};
|
|
1021
|
-
const iconRemove = {
|
|
1022
|
-
path: "M100.464 80.808q0 3.404-2.368 5.772l-11.47 11.544q-2.368 2.368-5.772 2.368t-5.698-2.368l-24.864-24.864-24.864 24.864q-2.368 2.368-5.772 2.368t-5.772-2.368l-11.47-11.544q-2.368-2.368-2.368-5.772t2.368-5.698l24.864-24.864-24.864-24.864q-2.368-2.368-2.368-5.772t2.368-5.772l11.47-11.47q2.368-2.368 5.772-2.368t5.772 2.368l24.864 24.864 24.864-24.864q2.294-2.368 5.698-2.368t5.772 2.368l11.47 11.47q2.368 2.368 2.368 5.772t-2.368 5.772l-24.864 24.864 24.864 24.864q2.368 2.294 2.368 5.698z",
|
|
1023
|
-
width: 100,
|
|
1024
|
-
height: 100
|
|
1025
|
-
};
|
|
1026
|
-
const iconStar = {
|
|
1027
|
-
path: "M15.1052249,9.55978547 L22.0028147,9.55978545 C23.6568673,9.55978545 23.9349557,10.3753626 22.6181351,11.3858845 L16.9943688,15.7015366 L19.2518801,22.8294455 C19.7526645,24.4106317 19.0984455,24.8825885 17.769353,23.8673293 L12.0490577,19.4977438 L6.5116497,23.8422153 C5.20921411,24.8640642 4.53299569,24.4067544 5.00266927,22.8160582 L7.10332364,15.7015366 L1.42794544,11.3634306 C0.110226041,10.3562014 0.383967283,9.54239221 2.0409646,9.54574013 L8.9924676,9.55978547 L11.1485117,2.72669438 C11.6458693,1.15043244 12.4548928,1.15900049 12.9494787,2.72669438 L15.1052249,9.55978547 Z",
|
|
1028
|
-
width: 24,
|
|
1029
|
-
height: 24
|
|
1030
|
-
};
|
|
1031
|
-
const iconTryAgain = {
|
|
1032
|
-
path: "M3.74890556,17.9799506 C2.19251241,16.1970909 1.10103636,13.4971457 1.13090903,11.1491783 C1.17160478,7.95052637 4.01704076,0.865059407 11.7028044,0.865059407 C19.388568,0.865059407 22.3026521,7.35203035 22.3026521,11.5879453 C22.3026521,15.8238603 19.386629,20.5574509 13.6832464,21.7131548 L13.6757539,17.3722171 C17.0812986,16.2190517 18.331158,14.1944123 18.3311578,11.5879451 C18.3311574,8.16554692 15.6664205,5.03476549 11.7028048,5.20494205 C7.73918903,5.37511861 5.59244567,8.66930079 5.59244567,11.1491783 C5.59244567,12.9090077 6.11128139,14.1753512 6.93640437,15.3053215 L8.14052356,14.2949456 C8.98559348,13.5858477 9.6994861,13.9070448 9.73489556,15.0076413 L9.91284941,20.5388014 C9.94832683,21.6415103 9.09967118,22.3514475 8.02194403,22.1254594 L2.60571602,20.9897332 C1.5259204,20.7633114 1.34338662,19.9984207 2.18070755,19.295825 L3.74890556,17.9799506 Z",
|
|
1033
|
-
width: 23,
|
|
1034
|
-
height: 23
|
|
1035
|
-
};
|
|
1036
|
-
const iconTablet = {
|
|
1037
|
-
path: "M45.322 90.706q0-1.86-1.302-3.224-1.364-1.364-3.224-1.364t-3.224 1.364-1.302 3.224q0 1.86 1.364 3.224 1.302 1.364 3.162 1.302 1.86.062 3.224-1.302t1.302-3.224zm27.218-11.346l0-68.014q0-.93-.682-1.612t-1.55-.682l-58.962 0q-.93 0-1.612.682t-.682 1.612l0 68.014q0 .93.682 1.612t1.612.62l58.962 0q.992-.062 1.612-.682t.62-1.55zm9.114-68.014l0 77.066q0 4.65-3.348 7.998t-7.998 3.348l-58.962 0q-4.65 0-7.998-3.348t-3.348-7.998l0-77.066q0-4.65 3.348-7.998t7.998-3.348l58.962 0q4.65 0 7.998 3.348t3.348 7.998z",
|
|
1038
|
-
width: 81.852,
|
|
1039
|
-
height: 100
|
|
1040
|
-
};
|
|
1041
|
-
const iconTrash = {
|
|
1042
|
-
path: "M31.293 37.506q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.218 0q-.912-.057-1.482-.627t-.57-1.482l0-37.506q0-2.109 2.052-2.109l4.218 0zm18.753 2.109l0 37.506q0 .912-.57 1.482t-1.539.627l-4.161 0q-1.995 0-2.109-2.109l0-37.506q.057-.912.627-1.482t1.482-.627l4.161 0q.969.057 1.539.627t.57 1.482zm14.592-2.109q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.161 0q-.969-.057-1.539-.627t-.57-1.482l0-37.506q0-2.109 2.109-2.109l4.161 0zm10.431 49.248l0-61.731l-58.368 0l0 61.731q.057 2.679.969 3.819t1.083 1.14l54.207 0q.171 0 1.14-1.083t.969-3.876zm-43.776-70.11l29.184 0l-3.135-7.581q-.456-.57-1.14-.741l-20.634 0q-.627.114-1.083.741zm-31.293 2.109q0-1.995 2.109-2.109l20.121 0l4.56-10.83q.969-2.394 3.477-4.104 2.565-1.71 5.187-1.71l20.805 0q2.622 0 5.187 1.71t3.477 4.104l4.56 10.83l20.178 0q.912.057 1.482.627t.57 1.482l0 4.161q0 1.995-2.052 2.109l-6.27 0l0 61.731q0 5.415-3.078 9.348t-7.353 3.933l-54.207 0q-4.275 0-7.353-3.819t-3.078-9.177l0-62.016l-6.213 0q-.969 0-1.539-.57t-.57-1.539l0-4.161z",
|
|
1043
|
-
width: 91.681,
|
|
1044
|
-
height: 100
|
|
1045
|
-
};
|
|
1046
|
-
const iconUndo = {
|
|
1047
|
-
path: "M10,6.6C10,7.2,9.8,8,9.3,9.1c0,0,0,0.1-0.1,0.1S9.2,9.3,9.2,9.4c0,0,0,0.1-0.1,0.1C9,9.6,9,9.6,8.9,9.6 c-0.1,0-0.1,0-0.1-0.1c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1s0-0.1,0-0.1c0-0.3,0-0.5,0-0.7c0-0.4,0-0.7-0.1-1C8.6,7.1,8.5,6.9,8.4,6.7S8.2,6.3,8,6.1C7.8,5.9,7.6,5.8,7.4,5.7S6.9,5.5,6.7,5.5S6.1,5.4,5.8,5.4c-0.3,0-0.6,0-1,0H3.6v1.4c0,0.1,0,0.2-0.1,0.3C3.4,7.1,3.3,7.1,3.2,7.1C3.1,7.1,3,7.1,3,7L0.1,4.1C0,4.1,0,4,0,3.9s0-0.2,0.1-0.3L3,0.8C3,0.7,3.1,0.7,3.2,0.7c0.1,0,0.2,0,0.3,0.1C3.5,0.9,3.6,0.9,3.6,1v1.4h1.2c2.6,0,4.3,0.7,4.9,2.2C9.9,5.2,10,5.8,10,6.6z",
|
|
1048
|
-
width: 10,
|
|
1049
|
-
height: 10
|
|
1050
|
-
};
|
|
1051
|
-
const iconMinus = {
|
|
1052
|
-
path: "M8,13 L16,13 C16.5522847,13 17,12.5522847 17,12 C17,11.4477153 16.5522847,11 16,11 L8,11 C7.44771525,11 7,11.4477153 7,12 C7,12.5522847 7.44771525,13 8,13 Z",
|
|
1053
|
-
width: 24,
|
|
1054
|
-
height: 24
|
|
474
|
+
const useDependencies = () => {
|
|
475
|
+
const deps = React__namespace.useContext(DependenciesContext);
|
|
476
|
+
return deps;
|
|
1055
477
|
};
|
|
1056
478
|
|
|
1057
|
-
var
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
iconCircle: iconCircle,
|
|
1064
|
-
iconCircleArrowDown: iconCircleArrowDown,
|
|
1065
|
-
iconCircleArrowUp: iconCircleArrowUp,
|
|
1066
|
-
iconCircleThin: iconCircleThin,
|
|
1067
|
-
iconDesktop: iconDesktop,
|
|
1068
|
-
iconDropdownArrow: iconDropdownArrow,
|
|
1069
|
-
iconExclamationSign: iconExclamationSign,
|
|
1070
|
-
iconGear: iconGear,
|
|
1071
|
-
iconMobilePhone: iconMobilePhone,
|
|
1072
|
-
iconOk: iconOk,
|
|
1073
|
-
iconPlus: iconPlus,
|
|
1074
|
-
iconRemove: iconRemove,
|
|
1075
|
-
iconStar: iconStar,
|
|
1076
|
-
iconTryAgain: iconTryAgain,
|
|
1077
|
-
iconTablet: iconTablet,
|
|
1078
|
-
iconTrash: iconTrash,
|
|
1079
|
-
iconUndo: iconUndo,
|
|
1080
|
-
iconMinus: iconMinus
|
|
479
|
+
var dependencies = /*#__PURE__*/Object.freeze({
|
|
480
|
+
__proto__: null,
|
|
481
|
+
setDependencies: setDependencies,
|
|
482
|
+
getDependencies: getDependencies,
|
|
483
|
+
DependenciesContext: DependenciesContext,
|
|
484
|
+
useDependencies: useDependencies
|
|
1081
485
|
});
|
|
1082
486
|
|
|
1083
487
|
// TODO(LP-11481): Change the primary API we use for logging in Perseus to use
|
|
@@ -1259,9 +663,9 @@ const propTypes = {
|
|
|
1259
663
|
};
|
|
1260
664
|
|
|
1261
665
|
var changeable = /*#__PURE__*/Object.freeze({
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
666
|
+
__proto__: null,
|
|
667
|
+
change: change,
|
|
668
|
+
propTypes: propTypes
|
|
1265
669
|
});
|
|
1266
670
|
|
|
1267
671
|
const textWidthCache = {};
|
|
@@ -1589,6 +993,26 @@ const ClassNames = {
|
|
|
1589
993
|
MOBILE: "perseus-mobile"
|
|
1590
994
|
};
|
|
1591
995
|
|
|
996
|
+
/*
|
|
997
|
+
* A11y (Accessibility) style rules
|
|
998
|
+
* These are used to mark up areas on the site that should only be readable
|
|
999
|
+
* when using a screen reader.
|
|
1000
|
+
*/
|
|
1001
|
+
var a11y = aphrodite.StyleSheet.create({
|
|
1002
|
+
// Make content only visible to screen readers.
|
|
1003
|
+
// Both collegeboard.org and Bootstrap 3 use this exact implementation.
|
|
1004
|
+
srOnly: {
|
|
1005
|
+
border: 0,
|
|
1006
|
+
clip: "rect(0,0,0,0)",
|
|
1007
|
+
height: 1,
|
|
1008
|
+
margin: -1,
|
|
1009
|
+
overflow: "hidden",
|
|
1010
|
+
padding: 0,
|
|
1011
|
+
position: "absolute",
|
|
1012
|
+
width: 1
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1592
1016
|
const KhanMath = {
|
|
1593
1017
|
// Simplify formulas before display
|
|
1594
1018
|
cleanMath: function (expr) {
|
|
@@ -2504,6 +1928,7 @@ const KhanAnswerTypes = {
|
|
|
2504
1928
|
}
|
|
2505
1929
|
};
|
|
2506
1930
|
|
|
1931
|
+
const ERROR_TITLE = i18n__namespace._("Oops!");
|
|
2507
1932
|
const ERROR_MESSAGE = i18n__namespace._("Sorry, I don't understand that!");
|
|
2508
1933
|
const insertBraces = value => {
|
|
2509
1934
|
// HACK(alex): Make sure that all LaTeX super/subscripts are wrapped
|
|
@@ -2540,53 +1965,48 @@ class Expression extends React__namespace.Component {
|
|
|
2540
1965
|
super(...arguments);
|
|
2541
1966
|
_this = this;
|
|
2542
1967
|
_defineProperty(this, "_isMounted", false);
|
|
2543
|
-
_defineProperty(this, "errorTimeout", null);
|
|
2544
1968
|
_defineProperty(this, "displayName", "Expression");
|
|
2545
1969
|
_defineProperty(this, "state", {
|
|
1970
|
+
invalid: false,
|
|
2546
1971
|
showErrorTooltip: false,
|
|
2547
|
-
|
|
1972
|
+
showErrorStyle: false
|
|
2548
1973
|
});
|
|
2549
1974
|
_defineProperty(this, "componentDidMount", () => {
|
|
1975
|
+
document.addEventListener("mousedown", this._handleMouseDown);
|
|
1976
|
+
|
|
2550
1977
|
// TODO(scottgrant): This is a hack to remove the deprecated call to
|
|
2551
1978
|
// this.isMounted() but is still considered an anti-pattern.
|
|
2552
1979
|
this._isMounted = true;
|
|
2553
1980
|
});
|
|
2554
1981
|
_defineProperty(this, "componentDidUpdate", prevProps => {
|
|
2555
1982
|
if (!___default["default"].isEqual(this.props.value, prevProps.value) || !___default["default"].isEqual(this.props.functions, prevProps.functions)) {
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
this.
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
this.errorTimeout = setTimeout(() => {
|
|
2571
|
-
const apiResult = this.props.apiOptions.onInputError(null,
|
|
2572
|
-
// reserved for some widget identifier
|
|
2573
|
-
this.props.value, ERROR_MESSAGE);
|
|
2574
|
-
if (apiResult !== false) {
|
|
2575
|
-
this.setState({
|
|
2576
|
-
showErrorTooltip: true
|
|
2577
|
-
});
|
|
2578
|
-
}
|
|
2579
|
-
}, 2000);
|
|
1983
|
+
this.setState({
|
|
1984
|
+
invalid: false,
|
|
1985
|
+
showErrorTooltip: false,
|
|
1986
|
+
showErrorStyle: false
|
|
1987
|
+
});
|
|
1988
|
+
if (!this.parse(this.props.value, this.props).parsed) {
|
|
1989
|
+
const apiResult = this.props.apiOptions.onInputError(null,
|
|
1990
|
+
// reserved for some widget identifier
|
|
1991
|
+
this.props.value, ERROR_MESSAGE);
|
|
1992
|
+
if (apiResult !== false) {
|
|
1993
|
+
this.setState({
|
|
1994
|
+
invalid: true
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
2580
1997
|
}
|
|
2581
1998
|
}
|
|
2582
1999
|
});
|
|
2583
2000
|
_defineProperty(this, "componentWillUnmount", () => {
|
|
2584
|
-
// TODO(jeff, CP-3128): Use Wonder Blocks Timing API.
|
|
2585
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2586
|
-
// @ts-expect-error - TS2769 - No overload matches this call.
|
|
2587
|
-
clearTimeout(this.errorTimeout);
|
|
2588
2001
|
this._isMounted = false;
|
|
2589
2002
|
});
|
|
2003
|
+
_defineProperty(this, "_handleMouseDown", () => {
|
|
2004
|
+
if (this._isMounted && this.state.showErrorTooltip) {
|
|
2005
|
+
this.setState({
|
|
2006
|
+
showErrorTooltip: false
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2590
2010
|
_defineProperty(this, "simpleValidate", (rubric, onInputError) => {
|
|
2591
2011
|
onInputError = onInputError || function () {};
|
|
2592
2012
|
const result = Expression.validate(this.getUserInput(), rubric, onInputError);
|
|
@@ -2616,7 +2036,8 @@ class Expression extends React__namespace.Component {
|
|
|
2616
2036
|
this.props.trackInteraction();
|
|
2617
2037
|
});
|
|
2618
2038
|
_defineProperty(this, "_handleFocus", () => {
|
|
2619
|
-
|
|
2039
|
+
var _this$props$analytics;
|
|
2040
|
+
(_this$props$analytics = this.props.analytics) === null || _this$props$analytics === void 0 ? void 0 : _this$props$analytics.onAnalyticsEvent({
|
|
2620
2041
|
type: "perseus:expression-focused",
|
|
2621
2042
|
payload: null
|
|
2622
2043
|
});
|
|
@@ -2824,7 +2245,8 @@ class Expression extends React__namespace.Component {
|
|
|
2824
2245
|
this.refs.input.insert(keyPressed);
|
|
2825
2246
|
}
|
|
2826
2247
|
sendExpressionEvaluatedEvent(result) {
|
|
2827
|
-
|
|
2248
|
+
var _this$props$analytics2;
|
|
2249
|
+
(_this$props$analytics2 = this.props.analytics) === null || _this$props$analytics2 === void 0 ? void 0 : _this$props$analytics2.onAnalyticsEvent({
|
|
2828
2250
|
type: "perseus:expression-evaluated",
|
|
2829
2251
|
payload: {
|
|
2830
2252
|
result,
|
|
@@ -2833,6 +2255,7 @@ class Expression extends React__namespace.Component {
|
|
|
2833
2255
|
});
|
|
2834
2256
|
}
|
|
2835
2257
|
render() {
|
|
2258
|
+
var _this$props$keypadCon, _this$props$analytics3;
|
|
2836
2259
|
if (this.props.apiOptions.customKeypad) {
|
|
2837
2260
|
return /*#__PURE__*/React__namespace.createElement(mathInput.KeypadInput
|
|
2838
2261
|
// eslint-disable-next-line react/no-string-refs
|
|
@@ -2855,47 +2278,27 @@ class Expression extends React__namespace.Component {
|
|
|
2855
2278
|
onBlur: this._handleBlur
|
|
2856
2279
|
});
|
|
2857
2280
|
}
|
|
2858
|
-
// TODO(alex): Style this tooltip to be more consistent with other
|
|
2859
|
-
// tooltips on the site; align to left middle (once possible)
|
|
2860
|
-
const errorTooltip = /*#__PURE__*/React__namespace.createElement("span", {
|
|
2861
|
-
className: "error-tooltip",
|
|
2862
|
-
role: "tooltip"
|
|
2863
|
-
}, /*#__PURE__*/React__namespace.createElement(Tooltip, {
|
|
2864
|
-
className: "error-text-container",
|
|
2865
|
-
horizontalPosition: HorizontalDirection.Right,
|
|
2866
|
-
horizontalAlign: HorizontalDirection.Left,
|
|
2867
|
-
verticalPosition: VerticalDirection.Top,
|
|
2868
|
-
arrowSize: 10,
|
|
2869
|
-
borderColor: "#fcc335",
|
|
2870
|
-
show: this.state.showErrorText
|
|
2871
|
-
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
2872
|
-
className: "error-icon",
|
|
2873
|
-
"data-test-id": "test-error-icon",
|
|
2874
|
-
onMouseEnter: () => {
|
|
2875
|
-
this.setState({
|
|
2876
|
-
showErrorText: true
|
|
2877
|
-
});
|
|
2878
|
-
},
|
|
2879
|
-
onMouseLeave: () => {
|
|
2880
|
-
this.setState({
|
|
2881
|
-
showErrorText: false
|
|
2882
|
-
});
|
|
2883
|
-
},
|
|
2884
|
-
onClick: () => {
|
|
2885
|
-
// TODO(alex): Better error feedback for mobile
|
|
2886
|
-
this.setState({
|
|
2887
|
-
showErrorText: !this.state.showErrorText
|
|
2888
|
-
});
|
|
2889
|
-
}
|
|
2890
|
-
}, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconExclamationSign)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2891
|
-
className: "error-text"
|
|
2892
|
-
}, ERROR_MESSAGE)));
|
|
2893
2281
|
const className = classNames__default["default"]({
|
|
2894
2282
|
"perseus-widget-expression": true,
|
|
2895
2283
|
"show-error-tooltip": this.state.showErrorTooltip
|
|
2896
2284
|
});
|
|
2897
2285
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
2898
|
-
className: className
|
|
2286
|
+
className: className,
|
|
2287
|
+
onBlur: () => this.state.invalid && this.setState({
|
|
2288
|
+
showErrorTooltip: true,
|
|
2289
|
+
showErrorStyle: true
|
|
2290
|
+
}),
|
|
2291
|
+
onFocus: () => this.setState({
|
|
2292
|
+
showErrorTooltip: false
|
|
2293
|
+
})
|
|
2294
|
+
}, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
|
|
2295
|
+
style: a11y.srOnly,
|
|
2296
|
+
role: "alert"
|
|
2297
|
+
}, this.state.showErrorTooltip && ERROR_TITLE + " " + ERROR_MESSAGE), /*#__PURE__*/React__namespace.createElement(Tooltip__default["default"], {
|
|
2298
|
+
forceAnchorFocusivity: false,
|
|
2299
|
+
opened: this.state.showErrorTooltip,
|
|
2300
|
+
title: ERROR_TITLE,
|
|
2301
|
+
content: ERROR_MESSAGE
|
|
2899
2302
|
}, /*#__PURE__*/React__namespace.createElement(MathInput
|
|
2900
2303
|
// eslint-disable-next-line react/no-string-refs
|
|
2901
2304
|
, {
|
|
@@ -2904,11 +2307,15 @@ class Expression extends React__namespace.Component {
|
|
|
2904
2307
|
value: this.props.value,
|
|
2905
2308
|
onChange: this.changeAndTrack,
|
|
2906
2309
|
convertDotToTimes: this.props.times,
|
|
2907
|
-
buttonsVisible: this.props.buttonsVisible || "focused",
|
|
2908
2310
|
buttonSets: this.props.buttonSets,
|
|
2909
2311
|
onFocus: this._handleFocus,
|
|
2910
|
-
onBlur: this._handleBlur
|
|
2911
|
-
|
|
2312
|
+
onBlur: this._handleBlur,
|
|
2313
|
+
hasError: this.state.showErrorStyle,
|
|
2314
|
+
extraKeys: (_this$props$keypadCon = this.props.keypadConfiguration) === null || _this$props$keypadCon === void 0 ? void 0 : _this$props$keypadCon.extraKeys,
|
|
2315
|
+
analytics: (_this$props$analytics3 = this.props.analytics) !== null && _this$props$analytics3 !== void 0 ? _this$props$analytics3 : {
|
|
2316
|
+
onAnalyticsEvent: async () => {}
|
|
2317
|
+
}
|
|
2318
|
+
})));
|
|
2912
2319
|
}
|
|
2913
2320
|
}
|
|
2914
2321
|
|
|
@@ -2951,11 +2358,18 @@ const keypadConfigurationForProps = widgetOptions => {
|
|
|
2951
2358
|
// and Theta, so we special-case.
|
|
2952
2359
|
const isGreek = symbol => symbol === "pi" || symbol === "theta";
|
|
2953
2360
|
const toKey = symbol => isGreek(symbol) ? symbol.toUpperCase() : symbol;
|
|
2361
|
+
const isKey = key => mathInput.KeyArray.includes(key);
|
|
2954
2362
|
for (const variable of expr.getVars()) {
|
|
2955
|
-
|
|
2363
|
+
const maybeKey = toKey(variable);
|
|
2364
|
+
if (isKey(maybeKey)) {
|
|
2365
|
+
uniqueExtraVariables[maybeKey] = true;
|
|
2366
|
+
}
|
|
2956
2367
|
}
|
|
2957
2368
|
for (const constant of expr.getConsts()) {
|
|
2958
|
-
|
|
2369
|
+
const maybeKey = toKey(constant);
|
|
2370
|
+
if (isKey(maybeKey)) {
|
|
2371
|
+
uniqueExtraConstants[maybeKey] = true;
|
|
2372
|
+
}
|
|
2959
2373
|
}
|
|
2960
2374
|
}
|
|
2961
2375
|
}
|
|
@@ -4412,60 +3826,60 @@ const articleMaxWidthInPx = 688;
|
|
|
4412
3826
|
const articleMaxWidthTableInPx = 512;
|
|
4413
3827
|
|
|
4414
3828
|
var constants$1 = /*#__PURE__*/Object.freeze({
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
3829
|
+
__proto__: null,
|
|
3830
|
+
baseFontFamily: baseFontFamily$1,
|
|
3831
|
+
boldFontFamily: boldFontFamily,
|
|
3832
|
+
green: green$1,
|
|
3833
|
+
kaGreen: kaGreen$1,
|
|
3834
|
+
blue: blue$1,
|
|
3835
|
+
gray: gray$1,
|
|
3836
|
+
red: red$1,
|
|
3837
|
+
grayLight: grayLight$1,
|
|
3838
|
+
grayLighter: grayLighter$1,
|
|
3839
|
+
learnstormBlue: learnstormBlue$1,
|
|
3840
|
+
white: white$1,
|
|
3841
|
+
gray98: gray98,
|
|
3842
|
+
gray97: gray97,
|
|
3843
|
+
gray95: gray95,
|
|
3844
|
+
gray90: gray90,
|
|
3845
|
+
gray85: gray85,
|
|
3846
|
+
gray76: gray76,
|
|
3847
|
+
gray68: gray68,
|
|
3848
|
+
gray41: gray41,
|
|
3849
|
+
gray25: gray25,
|
|
3850
|
+
gray17: gray17,
|
|
3851
|
+
black: black$1,
|
|
3852
|
+
warning1: warning1,
|
|
3853
|
+
warning3: warning3,
|
|
3854
|
+
pureSmMin: pureSmMin$2,
|
|
3855
|
+
pureMdMin: pureMdMin$2,
|
|
3856
|
+
pureLgMin: pureLgMin$2,
|
|
3857
|
+
pureXlMin: pureXlMin$2,
|
|
3858
|
+
pureXsMax: pureXsMax$2,
|
|
3859
|
+
pureSmMax: pureSmMax$2,
|
|
3860
|
+
pureMdMax: pureMdMax$2,
|
|
3861
|
+
pureLgMax: pureLgMax$2,
|
|
3862
|
+
tableBackgroundAccent: tableBackgroundAccent$1,
|
|
3863
|
+
zIndexScratchPad: zIndexScratchPad,
|
|
3864
|
+
zIndexAboveScratchpad: zIndexAboveScratchpad$1,
|
|
3865
|
+
zIndexInteractiveComponent: zIndexInteractiveComponent$1,
|
|
3866
|
+
zIndexCurrentlyDragging: zIndexCurrentlyDragging,
|
|
3867
|
+
zIndexCalculator: zIndexCalculator,
|
|
3868
|
+
phoneMargin: phoneMargin,
|
|
3869
|
+
negativePhoneMargin: negativePhoneMargin,
|
|
3870
|
+
hintBorderWidth: hintBorderWidth,
|
|
3871
|
+
baseUnitPx: baseUnitPx,
|
|
3872
|
+
interactiveSizes: interactiveSizes$1,
|
|
3873
|
+
circleSize: circleSize$1,
|
|
3874
|
+
radioMarginWidth: radioMarginWidth$1,
|
|
3875
|
+
warningColor: warningColor,
|
|
3876
|
+
warningColorHover: warningColorHover,
|
|
3877
|
+
warningColorActive: warningColorActive,
|
|
3878
|
+
publishBlockingErrorColor: publishBlockingErrorColor,
|
|
3879
|
+
radioBorderColor: radioBorderColor$1,
|
|
3880
|
+
checkedColor: checkedColor$1,
|
|
3881
|
+
articleMaxWidthInPx: articleMaxWidthInPx,
|
|
3882
|
+
articleMaxWidthTableInPx: articleMaxWidthTableInPx
|
|
4469
3883
|
});
|
|
4470
3884
|
|
|
4471
3885
|
const MIN_VIEWPORT_HEIGHT = 480;
|
|
@@ -15018,6 +14432,200 @@ ___default["default"].extend(MovableLine$4.prototype, {
|
|
|
15018
14432
|
}
|
|
15019
14433
|
});
|
|
15020
14434
|
|
|
14435
|
+
/**
|
|
14436
|
+
* A stripped version of Icon.jsx from webapp. Takes an SVG icon and renders it
|
|
14437
|
+
* inline like Font Awesome did.
|
|
14438
|
+
*
|
|
14439
|
+
* If you are looking for an icon that we've used before you should look in
|
|
14440
|
+
* webapp's `icon-paths.js` which is a reference file for all the SVG paths
|
|
14441
|
+
* that we've used. You'll need to copy the object from that file into
|
|
14442
|
+
* whichever file you're using the icon and explicitly pass it in to the
|
|
14443
|
+
* <InlineIcon/> React component.
|
|
14444
|
+
*
|
|
14445
|
+
* We assume that the viewBox is cropped and aligned to (0, 0), but icons can
|
|
14446
|
+
* be defined differently. At some point we might want to add these attributes
|
|
14447
|
+
* to `icon-paths.js`, but for now this is a fairly safe assumption.
|
|
14448
|
+
*
|
|
14449
|
+
* Sample usage:
|
|
14450
|
+
*
|
|
14451
|
+
* const editIcon = {
|
|
14452
|
+
* path: "M41.209 53.753l5.39 0l0 5.39l3.136 0l6.468-6.517-8.477-8.526-6.517 6.517l0 3.136zm33.173-34.937q-.882-.882-1.862.049l-19.6 19.6q-.931.98-.049 1.862t1.862-.049l19.6-19.6q.931-.98.049-1.862zm-38.563 45.668l0-16.121l37.632-37.632 16.17 16.121-37.632 37.632l-16.17 0zm43.022-12.397l0 10.633q-.049 6.713-4.753 11.417t-11.368 4.704l-46.599 0q-6.713 0-11.417-4.753t-4.704-11.368l0-46.599q0-6.664 4.753-11.417t11.368-4.704l46.599 0q3.528 0 6.566 1.372.833.392.98 1.323t-.49 1.617l-2.744 2.744q-.784.784-1.96.441t-2.352-.343l-46.599 0q-3.675 0-6.321 2.646t-2.646 6.321l0 46.599q0 3.675 2.646 6.321t6.321 2.646l46.599 0q3.675 0 6.321-2.646t2.646-6.321l0-7.056q0-.735.49-1.225l3.577-3.577q.833-.833 1.96-.392t1.127 1.617zm7.203-51.646q2.254 0 3.773 1.568l8.526 8.526q1.568 1.568 1.568 3.822t-1.568 3.773l-5.145 5.145-16.121-16.121 5.145-5.145q1.568-1.568 3.822-1.568z",
|
|
14453
|
+
* width: 100,
|
|
14454
|
+
* height: 78.912,
|
|
14455
|
+
* };
|
|
14456
|
+
* <InlineIcon {...editIcon} />
|
|
14457
|
+
*
|
|
14458
|
+
*/
|
|
14459
|
+
const InlineIcon = _ref => {
|
|
14460
|
+
let {
|
|
14461
|
+
path,
|
|
14462
|
+
width,
|
|
14463
|
+
height,
|
|
14464
|
+
style = {},
|
|
14465
|
+
title
|
|
14466
|
+
} = _ref;
|
|
14467
|
+
return /*#__PURE__*/React__namespace.createElement("svg", {
|
|
14468
|
+
role: "img",
|
|
14469
|
+
"aria-hidden": !title,
|
|
14470
|
+
style: {
|
|
14471
|
+
verticalAlign: "middle",
|
|
14472
|
+
...style
|
|
14473
|
+
},
|
|
14474
|
+
width: "".concat(width / height, "em"),
|
|
14475
|
+
height: "1em",
|
|
14476
|
+
viewBox: "0 0 ".concat(width, " ").concat(height)
|
|
14477
|
+
}, !!title && /*#__PURE__*/React__namespace.createElement("title", null, title), /*#__PURE__*/React__namespace.createElement("path", {
|
|
14478
|
+
d: path,
|
|
14479
|
+
fill: "currentColor"
|
|
14480
|
+
}));
|
|
14481
|
+
};
|
|
14482
|
+
|
|
14483
|
+
/**
|
|
14484
|
+
* Icon paths to be used with `inline-icon.jsx`.
|
|
14485
|
+
*
|
|
14486
|
+
* These paths are taken directly from webapp's `icon-paths.js`. Unlike the
|
|
14487
|
+
* webapp equivalent, these can be directly required within Perseus files since
|
|
14488
|
+
* this is all bundled together anyway.
|
|
14489
|
+
*/
|
|
14490
|
+
|
|
14491
|
+
const iconCheck = {
|
|
14492
|
+
path: "M8.70710678,12.2928932 C8.31658249,11.9023689 7.68341751,11.9023689 7.29289322,12.2928932 C6.90236893,12.6834175 6.90236893,13.3165825 7.29289322,13.7071068 L9.82842712,16.2426407 C10.2207367,16.6349502 10.8574274,16.6328935 11.2471942,16.2380576 L16.7116603,10.7025237 C17.0996535,10.3094846 17.0955629,9.67633279 16.7025237,9.28833966 C16.3094846,8.90034653 15.6763328,8.90443714 15.2883397,9.29747629 L10.5309507,14.1167372 L8.70710678,12.2928932 Z",
|
|
14493
|
+
width: 24,
|
|
14494
|
+
height: 24
|
|
14495
|
+
};
|
|
14496
|
+
const iconCheckMedium = {
|
|
14497
|
+
path: "M6.072 10.4l6.175-7.058a1 1 0 1 1 1.506 1.317L6.769 12.64a1 1 0 0 1-1.55-.054L2.203 8.604a1 1 0 1 1 1.594-1.208L6.072 10.4z",
|
|
14498
|
+
width: 16,
|
|
14499
|
+
height: 16
|
|
14500
|
+
};
|
|
14501
|
+
const iconChevronDown = {
|
|
14502
|
+
path: "M99.669 13.048q0 3.36-2.352 5.712l-41.664 41.664q-2.408 2.408-5.88 2.408t-5.712-2.408l-41.664-41.664q-2.408-2.24-2.408-5.712t2.408-5.88l4.76-4.816q2.52-2.352 5.88-2.352t5.656 2.352l31.136 31.136 31.08-31.136q2.352-2.352 5.712-2.352t5.88 2.352l4.816 4.816q2.352 2.52 2.352 5.88z",
|
|
14503
|
+
width: 100,
|
|
14504
|
+
height: 63.034
|
|
14505
|
+
};
|
|
14506
|
+
const iconChevronRight = {
|
|
14507
|
+
path: "M62.808 49.728q0 3.36-2.352 5.88l-41.72 41.664q-2.352 2.408-5.768 2.408t-5.768-2.408l-4.872-4.76q-2.352-2.52-2.352-5.88t2.352-5.712l31.08-31.136-31.08-31.024q-2.352-2.52-2.352-5.88t2.352-5.712l4.872-4.76q2.296-2.408 5.768-2.408t5.768 2.408l41.72 41.664q2.352 2.296 2.352 5.656z",
|
|
14508
|
+
width: 63.034,
|
|
14509
|
+
height: 100
|
|
14510
|
+
};
|
|
14511
|
+
const iconCircle = {
|
|
14512
|
+
path: "M100.035 50.046q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
14513
|
+
width: 100,
|
|
14514
|
+
height: 100
|
|
14515
|
+
};
|
|
14516
|
+
const iconCircleArrowDown = {
|
|
14517
|
+
path: "M50.046 83.676q1.767 0 2.907-1.14l29.526-29.526q1.197-1.197 1.197-2.907t-1.197-2.964l-5.928-5.928q-1.197-1.14-2.964-1.14t-2.907 1.14l-12.312 12.312l0-32.661q0-1.71-1.254-2.964t-2.907-1.254l-8.322 0q-1.71 0-2.964 1.254t-1.254 2.964l0 32.661l-12.312-12.312q-1.197-1.254-2.907-1.254t-2.907 1.254l-5.928 5.928q-1.197 1.197-1.197 2.964t1.197 2.907l29.469 29.526q1.197 1.14 2.964 1.14zm49.989-33.63q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
14518
|
+
width: 100,
|
|
14519
|
+
height: 100
|
|
14520
|
+
};
|
|
14521
|
+
const iconCircleArrowUp = {
|
|
14522
|
+
path: "M54.207 83.391q1.653 0 2.907-1.254t1.254-2.907l0-32.718l12.312 12.312q1.254 1.254 2.964 1.254t2.907-1.254l5.928-5.928q1.197-1.197 1.14-2.964 0-1.767-1.14-2.907l-29.526-29.526q-1.197-1.14-2.907-1.14t-2.964 1.14l-29.469 29.526q-1.197 1.254-1.197 2.964t1.197 2.907l5.928 5.928q1.197 1.197 2.907 1.197t2.907-1.197l12.312-12.312l0 32.718q0 1.653 1.254 2.907t2.964 1.254l8.322 0zm45.828-33.345q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
|
|
14523
|
+
width: 100,
|
|
14524
|
+
height: 100
|
|
14525
|
+
};
|
|
14526
|
+
const iconCircleThin = {
|
|
14527
|
+
path: "M50.046 8.322q-8.493 0-16.188 3.306-15.561 6.669-22.173 22.23-3.363 7.695-3.363 16.188t3.306 16.188 8.949 13.281q5.586 5.586 13.281 8.892t16.188 3.306 16.188-3.306 13.281-8.892 8.892-13.281 3.306-16.188-3.306-16.188-8.892-13.281-13.281-8.949q-7.695-3.306-16.188-3.306zm0 91.713q-13.623 0-25.137-6.726t-18.183-18.183q-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.126q-11.514 6.726-25.08 6.726z",
|
|
14528
|
+
width: 100,
|
|
14529
|
+
height: 99.944
|
|
14530
|
+
};
|
|
14531
|
+
const iconDesktop = {
|
|
14532
|
+
path: "M94.208 52.119l0-43.746q0-.69-.506-1.15t-1.196-.506l-84.088 0q-.69 0-1.196.506t-.506 1.15l0 43.746q0 .69.506 1.196t1.196.506l84.088 0q.69 0 1.196-.506t.506-1.196zm6.716-43.746l0 57.224q0 3.45-2.484 5.934t-5.934 2.484l-28.566 0q0 3.128 2.53 7.774.828 1.61.828 2.622t-1.012 2.07q-1.012 1.012-2.346.966l-26.91 0q-1.38 0-2.392-1.012t-1.012-2.024q0-1.058 1.656-4.14t1.748-6.256l-28.612 0q-3.45 0-5.934-2.484t-2.484-5.934l0-57.224q0-3.45 2.484-5.934t5.934-2.438l84.088 0q3.45 0 5.98 2.438 2.438 2.484 2.438 5.934z",
|
|
14533
|
+
width: 100,
|
|
14534
|
+
height: 86.648
|
|
14535
|
+
};
|
|
14536
|
+
const iconDropdownArrow = {
|
|
14537
|
+
path: "M9 9.8c0 .5.7 1.7 1.5 2.8 1.5 1.9 1.5 1.9 3 0C15.7 9.7 15.4 9 12 9c-1.6 0-3 .4-3 .8z",
|
|
14538
|
+
width: 24,
|
|
14539
|
+
height: 24
|
|
14540
|
+
};
|
|
14541
|
+
const iconExclamationSign = {
|
|
14542
|
+
path: "M58.368 81.225l0-12.369q0-.912-.57-1.539t-1.425-.627l-12.54 0q-.855-.057-1.482.627t-.684 1.539l0 12.369q-.057.855.627 1.482t1.539.684l12.54 0q.855 0 1.425-.627t.57-1.539zm1.026-62.871q0-1.596-2.223-1.71l-14.307 0q-2.109 0-2.223 1.71l1.14 40.47q0 .627.627 1.14t1.539.456l12.084 0q.912-.057 1.539-.513t.684-1.083zm-9.348-18.354q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.726 25.137-6.726 25.137-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669z",
|
|
14543
|
+
width: 100,
|
|
14544
|
+
height: 99.944
|
|
14545
|
+
};
|
|
14546
|
+
// Grabbed from https://github.com/encharm/Font-Awesome-SVG-PNG
|
|
14547
|
+
const iconGear = {
|
|
14548
|
+
path: "M1152 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm512-109v222q0 12-8 23t-20 13l-185 28q-19 54-39 91 35 50 107 138 10 12 10 25t-9 23q-27 37-99 108t-94 71q-12 0-26-9l-138-108q-44 23-91 38-16 136-29 186-7 28-36 28h-222q-14 0-24.5-8.5t-11.5-21.5l-28-184q-49-16-90-37l-141 107q-10 9-25 9-14 0-25-11-126-114-165-168-7-10-7-23 0-12 8-23 15-21 51-66.5t54-70.5q-27-50-41-99l-183-27q-13-2-21-12.5t-8-23.5v-222q0-12 8-23t19-13l186-28q14-46 39-92-40-57-107-138-10-12-10-24 0-10 9-23 26-36 98.5-107.5t94.5-71.5q13 0 26 10l138 107q44-23 91-38 16-136 29-186 7-28 36-28h222q14 0 24.5 8.5t11.5 21.5l28 184q49 16 90 37l142-107q9-9 24-9 13 0 25 10 129 119 165 170 7 8 7 22 0 12-8 23-15 21-51 66.5t-54 70.5q26 50 41 98l183 28q13 2 21 12.5t8 23.5z",
|
|
14549
|
+
width: 1792,
|
|
14550
|
+
height: 1792
|
|
14551
|
+
};
|
|
14552
|
+
const iconMobilePhone = {
|
|
14553
|
+
path: "M36.04 89.557q0-2.584-1.836-4.42t-4.42-1.836-4.352 1.836q-1.836 1.836-1.836 4.42t1.836 4.352 4.42 1.836q2.652-.068 4.42-1.836t1.768-4.352zm16.184-12.444l0-54.74q0-1.088-.748-1.768t-1.768-.68l-39.78 0q-1.088 0-1.768.748t-.68 1.7l0 54.74q0 1.02.748 1.768t1.7.68l39.78 0q1.02-.068 1.768-.748t.748-1.7zm-14.892-65.892q0-1.224-1.292-1.292l-12.444 0q-1.224.068-1.224 1.292t1.224 1.224l12.444 0q1.292 0 1.292-1.224zm22.372-1.292l0 79.628q0 3.944-2.992 6.936t-7.004 2.992l-39.78 0q-4.012 0-7.004-2.924-2.924-2.924-2.924-7.004l0-79.628q0-4.012 2.924-6.936t7.004-2.992l39.78 0q4.012-.068 7.004 2.924t2.992 7.004z",
|
|
14554
|
+
width: 60.013,
|
|
14555
|
+
height: 100
|
|
14556
|
+
};
|
|
14557
|
+
const iconOk = {
|
|
14558
|
+
path: "M37.964 76.048q-2.576 0-4.368-1.792l-31.864-31.864q-1.792-1.792-1.792-4.368t1.792-4.368l8.736-8.68q1.792-1.792 4.368-1.792t4.312 1.792l18.816 18.872 42-42.056q1.792-1.792 4.368-1.792t4.312 1.792l8.736 8.736q1.792 1.792 1.792 4.368t-1.792 4.312l-55.048 55.048q-1.792 1.792-4.368 1.792z",
|
|
14559
|
+
width: 100,
|
|
14560
|
+
height: 76.637
|
|
14561
|
+
};
|
|
14562
|
+
const iconPlus = {
|
|
14563
|
+
path: "M99.758 43.09l0 13.578q0 2.852-1.984 4.836t-4.836 1.984l-29.45 0l0 29.45q0 2.852-1.984 4.836t-4.836 1.984l-13.578 0q-2.852 0-4.836-1.984t-1.984-4.836l0-29.45l-29.45 0q-2.852 0-4.836-1.984t-1.984-4.836l0-13.578q0-2.852 1.984-4.836t4.836-1.984l29.45 0l0-29.45q0-2.852 1.984-4.836t4.836-1.984l13.578 0q2.852 0 4.836 1.984t1.984 4.836l0 29.45l29.45 0q2.852 0 4.836 1.984t1.984 4.836z",
|
|
14564
|
+
width: 100,
|
|
14565
|
+
height: 100
|
|
14566
|
+
};
|
|
14567
|
+
const iconRemove = {
|
|
14568
|
+
path: "M100.464 80.808q0 3.404-2.368 5.772l-11.47 11.544q-2.368 2.368-5.772 2.368t-5.698-2.368l-24.864-24.864-24.864 24.864q-2.368 2.368-5.772 2.368t-5.772-2.368l-11.47-11.544q-2.368-2.368-2.368-5.772t2.368-5.698l24.864-24.864-24.864-24.864q-2.368-2.368-2.368-5.772t2.368-5.772l11.47-11.47q2.368-2.368 5.772-2.368t5.772 2.368l24.864 24.864 24.864-24.864q2.294-2.368 5.698-2.368t5.772 2.368l11.47 11.47q2.368 2.368 2.368 5.772t-2.368 5.772l-24.864 24.864 24.864 24.864q2.368 2.294 2.368 5.698z",
|
|
14569
|
+
width: 100,
|
|
14570
|
+
height: 100
|
|
14571
|
+
};
|
|
14572
|
+
const iconStar = {
|
|
14573
|
+
path: "M15.1052249,9.55978547 L22.0028147,9.55978545 C23.6568673,9.55978545 23.9349557,10.3753626 22.6181351,11.3858845 L16.9943688,15.7015366 L19.2518801,22.8294455 C19.7526645,24.4106317 19.0984455,24.8825885 17.769353,23.8673293 L12.0490577,19.4977438 L6.5116497,23.8422153 C5.20921411,24.8640642 4.53299569,24.4067544 5.00266927,22.8160582 L7.10332364,15.7015366 L1.42794544,11.3634306 C0.110226041,10.3562014 0.383967283,9.54239221 2.0409646,9.54574013 L8.9924676,9.55978547 L11.1485117,2.72669438 C11.6458693,1.15043244 12.4548928,1.15900049 12.9494787,2.72669438 L15.1052249,9.55978547 Z",
|
|
14574
|
+
width: 24,
|
|
14575
|
+
height: 24
|
|
14576
|
+
};
|
|
14577
|
+
const iconTryAgain = {
|
|
14578
|
+
path: "M3.74890556,17.9799506 C2.19251241,16.1970909 1.10103636,13.4971457 1.13090903,11.1491783 C1.17160478,7.95052637 4.01704076,0.865059407 11.7028044,0.865059407 C19.388568,0.865059407 22.3026521,7.35203035 22.3026521,11.5879453 C22.3026521,15.8238603 19.386629,20.5574509 13.6832464,21.7131548 L13.6757539,17.3722171 C17.0812986,16.2190517 18.331158,14.1944123 18.3311578,11.5879451 C18.3311574,8.16554692 15.6664205,5.03476549 11.7028048,5.20494205 C7.73918903,5.37511861 5.59244567,8.66930079 5.59244567,11.1491783 C5.59244567,12.9090077 6.11128139,14.1753512 6.93640437,15.3053215 L8.14052356,14.2949456 C8.98559348,13.5858477 9.6994861,13.9070448 9.73489556,15.0076413 L9.91284941,20.5388014 C9.94832683,21.6415103 9.09967118,22.3514475 8.02194403,22.1254594 L2.60571602,20.9897332 C1.5259204,20.7633114 1.34338662,19.9984207 2.18070755,19.295825 L3.74890556,17.9799506 Z",
|
|
14579
|
+
width: 23,
|
|
14580
|
+
height: 23
|
|
14581
|
+
};
|
|
14582
|
+
const iconTablet = {
|
|
14583
|
+
path: "M45.322 90.706q0-1.86-1.302-3.224-1.364-1.364-3.224-1.364t-3.224 1.364-1.302 3.224q0 1.86 1.364 3.224 1.302 1.364 3.162 1.302 1.86.062 3.224-1.302t1.302-3.224zm27.218-11.346l0-68.014q0-.93-.682-1.612t-1.55-.682l-58.962 0q-.93 0-1.612.682t-.682 1.612l0 68.014q0 .93.682 1.612t1.612.62l58.962 0q.992-.062 1.612-.682t.62-1.55zm9.114-68.014l0 77.066q0 4.65-3.348 7.998t-7.998 3.348l-58.962 0q-4.65 0-7.998-3.348t-3.348-7.998l0-77.066q0-4.65 3.348-7.998t7.998-3.348l58.962 0q4.65 0 7.998 3.348t3.348 7.998z",
|
|
14584
|
+
width: 81.852,
|
|
14585
|
+
height: 100
|
|
14586
|
+
};
|
|
14587
|
+
const iconTrash = {
|
|
14588
|
+
path: "M31.293 37.506q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.218 0q-.912-.057-1.482-.627t-.57-1.482l0-37.506q0-2.109 2.052-2.109l4.218 0zm18.753 2.109l0 37.506q0 .912-.57 1.482t-1.539.627l-4.161 0q-1.995 0-2.109-2.109l0-37.506q.057-.912.627-1.482t1.482-.627l4.161 0q.969.057 1.539.627t.57 1.482zm14.592-2.109q2.052 0 2.052 2.109l0 37.506q0 1.995-2.052 2.109l-4.161 0q-.969-.057-1.539-.627t-.57-1.482l0-37.506q0-2.109 2.109-2.109l4.161 0zm10.431 49.248l0-61.731l-58.368 0l0 61.731q.057 2.679.969 3.819t1.083 1.14l54.207 0q.171 0 1.14-1.083t.969-3.876zm-43.776-70.11l29.184 0l-3.135-7.581q-.456-.57-1.14-.741l-20.634 0q-.627.114-1.083.741zm-31.293 2.109q0-1.995 2.109-2.109l20.121 0l4.56-10.83q.969-2.394 3.477-4.104 2.565-1.71 5.187-1.71l20.805 0q2.622 0 5.187 1.71t3.477 4.104l4.56 10.83l20.178 0q.912.057 1.482.627t.57 1.482l0 4.161q0 1.995-2.052 2.109l-6.27 0l0 61.731q0 5.415-3.078 9.348t-7.353 3.933l-54.207 0q-4.275 0-7.353-3.819t-3.078-9.177l0-62.016l-6.213 0q-.969 0-1.539-.57t-.57-1.539l0-4.161z",
|
|
14589
|
+
width: 91.681,
|
|
14590
|
+
height: 100
|
|
14591
|
+
};
|
|
14592
|
+
const iconUndo = {
|
|
14593
|
+
path: "M10,6.6C10,7.2,9.8,8,9.3,9.1c0,0,0,0.1-0.1,0.1S9.2,9.3,9.2,9.4c0,0,0,0.1-0.1,0.1C9,9.6,9,9.6,8.9,9.6 c-0.1,0-0.1,0-0.1-0.1c0,0,0-0.1,0-0.1c0,0,0-0.1,0-0.1s0-0.1,0-0.1c0-0.3,0-0.5,0-0.7c0-0.4,0-0.7-0.1-1C8.6,7.1,8.5,6.9,8.4,6.7S8.2,6.3,8,6.1C7.8,5.9,7.6,5.8,7.4,5.7S6.9,5.5,6.7,5.5S6.1,5.4,5.8,5.4c-0.3,0-0.6,0-1,0H3.6v1.4c0,0.1,0,0.2-0.1,0.3C3.4,7.1,3.3,7.1,3.2,7.1C3.1,7.1,3,7.1,3,7L0.1,4.1C0,4.1,0,4,0,3.9s0-0.2,0.1-0.3L3,0.8C3,0.7,3.1,0.7,3.2,0.7c0.1,0,0.2,0,0.3,0.1C3.5,0.9,3.6,0.9,3.6,1v1.4h1.2c2.6,0,4.3,0.7,4.9,2.2C9.9,5.2,10,5.8,10,6.6z",
|
|
14594
|
+
width: 10,
|
|
14595
|
+
height: 10
|
|
14596
|
+
};
|
|
14597
|
+
const iconMinus = {
|
|
14598
|
+
path: "M8,13 L16,13 C16.5522847,13 17,12.5522847 17,12 C17,11.4477153 16.5522847,11 16,11 L8,11 C7.44771525,11 7,11.4477153 7,12 C7,12.5522847 7.44771525,13 8,13 Z",
|
|
14599
|
+
width: 24,
|
|
14600
|
+
height: 24
|
|
14601
|
+
};
|
|
14602
|
+
|
|
14603
|
+
var iconPaths = /*#__PURE__*/Object.freeze({
|
|
14604
|
+
__proto__: null,
|
|
14605
|
+
iconCheck: iconCheck,
|
|
14606
|
+
iconCheckMedium: iconCheckMedium,
|
|
14607
|
+
iconChevronDown: iconChevronDown,
|
|
14608
|
+
iconChevronRight: iconChevronRight,
|
|
14609
|
+
iconCircle: iconCircle,
|
|
14610
|
+
iconCircleArrowDown: iconCircleArrowDown,
|
|
14611
|
+
iconCircleArrowUp: iconCircleArrowUp,
|
|
14612
|
+
iconCircleThin: iconCircleThin,
|
|
14613
|
+
iconDesktop: iconDesktop,
|
|
14614
|
+
iconDropdownArrow: iconDropdownArrow,
|
|
14615
|
+
iconExclamationSign: iconExclamationSign,
|
|
14616
|
+
iconGear: iconGear,
|
|
14617
|
+
iconMobilePhone: iconMobilePhone,
|
|
14618
|
+
iconOk: iconOk,
|
|
14619
|
+
iconPlus: iconPlus,
|
|
14620
|
+
iconRemove: iconRemove,
|
|
14621
|
+
iconStar: iconStar,
|
|
14622
|
+
iconTryAgain: iconTryAgain,
|
|
14623
|
+
iconTablet: iconTablet,
|
|
14624
|
+
iconTrash: iconTrash,
|
|
14625
|
+
iconUndo: iconUndo,
|
|
14626
|
+
iconMinus: iconMinus
|
|
14627
|
+
});
|
|
14628
|
+
|
|
15021
14629
|
/* eslint-disable @babel/no-invalid-this */
|
|
15022
14630
|
const add$1 = {
|
|
15023
14631
|
constrain: function () {
|
|
@@ -18785,10 +18393,10 @@ const getInteractiveBoxFromSizeClass = sizeClass => {
|
|
|
18785
18393
|
};
|
|
18786
18394
|
|
|
18787
18395
|
var sizingUtils = /*#__PURE__*/Object.freeze({
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18396
|
+
__proto__: null,
|
|
18397
|
+
containerSizeClass: containerSizeClass,
|
|
18398
|
+
getClassFromWidth: getClassFromWidth,
|
|
18399
|
+
getInteractiveBoxFromSizeClass: getInteractiveBoxFromSizeClass
|
|
18792
18400
|
});
|
|
18793
18401
|
|
|
18794
18402
|
const DEFAULT_ALIGNMENT$1 = "block";
|
|
@@ -19128,28 +18736,28 @@ const isLintable = type => {
|
|
|
19128
18736
|
};
|
|
19129
18737
|
|
|
19130
18738
|
var widgets$1 = /*#__PURE__*/Object.freeze({
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19136
|
-
|
|
19137
|
-
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
|
|
19148
|
-
|
|
19149
|
-
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
|
|
18739
|
+
__proto__: null,
|
|
18740
|
+
registerWidget: registerWidget,
|
|
18741
|
+
registerWidgets: registerWidgets,
|
|
18742
|
+
registerEditors: registerEditors,
|
|
18743
|
+
getWidget: getWidget,
|
|
18744
|
+
getEditor: getEditor,
|
|
18745
|
+
getTransform: getTransform,
|
|
18746
|
+
getVersion: getVersion,
|
|
18747
|
+
getVersionVector: getVersionVector,
|
|
18748
|
+
getPublicWidgets: getPublicWidgets,
|
|
18749
|
+
isAccessible: isAccessible,
|
|
18750
|
+
getAllWidgetTypes: getAllWidgetTypes,
|
|
18751
|
+
upgradeWidgetInfoToLatestVersion: upgradeWidgetInfoToLatestVersion,
|
|
18752
|
+
getRendererPropsForWidgetInfo: getRendererPropsForWidgetInfo,
|
|
18753
|
+
traverseChildWidgets: traverseChildWidgets$4,
|
|
18754
|
+
getSupportedAlignments: getSupportedAlignments,
|
|
18755
|
+
getDefaultAlignment: getDefaultAlignment,
|
|
18756
|
+
validateAlignments: validateAlignments,
|
|
18757
|
+
supportsStaticMode: supportsStaticMode,
|
|
18758
|
+
getStaticTransform: getStaticTransform,
|
|
18759
|
+
getTracking: getTracking,
|
|
18760
|
+
isLintable: isLintable
|
|
19153
18761
|
});
|
|
19154
18762
|
|
|
19155
18763
|
class WidgetContainer extends React__namespace.Component {
|
|
@@ -20949,6 +20557,257 @@ _defineProperty(TextInput, "defaultProps", {
|
|
|
20949
20557
|
disabled: false
|
|
20950
20558
|
});
|
|
20951
20559
|
|
|
20560
|
+
const zIndex = 10;
|
|
20561
|
+
let HorizontalDirection = /*#__PURE__*/function (HorizontalDirection) {
|
|
20562
|
+
HorizontalDirection["Left"] = "left";
|
|
20563
|
+
HorizontalDirection["Right"] = "right";
|
|
20564
|
+
return HorizontalDirection;
|
|
20565
|
+
}({});
|
|
20566
|
+
let VerticalDirection = /*#__PURE__*/function (VerticalDirection) {
|
|
20567
|
+
VerticalDirection["Top"] = "top";
|
|
20568
|
+
VerticalDirection["Bottom"] = "bottom";
|
|
20569
|
+
return VerticalDirection;
|
|
20570
|
+
}({});
|
|
20571
|
+
const Triangle = props => {
|
|
20572
|
+
let borderLeft;
|
|
20573
|
+
let borderRight;
|
|
20574
|
+
let borderTop;
|
|
20575
|
+
let borderBottom;
|
|
20576
|
+
const hBorder = "".concat(props.width, "px solid transparent");
|
|
20577
|
+
if (props.horizontalDirection === "right") {
|
|
20578
|
+
borderLeft = hBorder;
|
|
20579
|
+
} else {
|
|
20580
|
+
borderRight = hBorder;
|
|
20581
|
+
}
|
|
20582
|
+
const vBorder = "".concat(props.height, "px solid ").concat(props.color);
|
|
20583
|
+
if (props.verticalDirection === "top") {
|
|
20584
|
+
borderTop = vBorder;
|
|
20585
|
+
} else {
|
|
20586
|
+
borderBottom = vBorder;
|
|
20587
|
+
}
|
|
20588
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20589
|
+
style: {
|
|
20590
|
+
display: "block",
|
|
20591
|
+
height: 0,
|
|
20592
|
+
width: 0,
|
|
20593
|
+
position: "absolute",
|
|
20594
|
+
left: props.left,
|
|
20595
|
+
top: props["top"],
|
|
20596
|
+
borderLeft: borderLeft,
|
|
20597
|
+
borderRight: borderRight,
|
|
20598
|
+
borderTop: borderTop,
|
|
20599
|
+
borderBottom: borderBottom
|
|
20600
|
+
}
|
|
20601
|
+
});
|
|
20602
|
+
};
|
|
20603
|
+
const TooltipArrow = props => {
|
|
20604
|
+
// TODO(aria): Think about adding a box-shadow to the triangle here
|
|
20605
|
+
// See http://css-tricks.com/triangle-with-shadow/
|
|
20606
|
+
|
|
20607
|
+
//const isRight = (this.props.horizontalDirection === "right");
|
|
20608
|
+
const isTop = props.verticalDirection === "top";
|
|
20609
|
+
const frontTopOffset = isTop ? 0 : 1;
|
|
20610
|
+
const borderTopOffset = isTop ? 0 : -1;
|
|
20611
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20612
|
+
style: {
|
|
20613
|
+
display: "block",
|
|
20614
|
+
position: props.position,
|
|
20615
|
+
visibility: props.visibility,
|
|
20616
|
+
left: props.left,
|
|
20617
|
+
top: props["top"],
|
|
20618
|
+
width: props.width + 2,
|
|
20619
|
+
height: props.height + 1,
|
|
20620
|
+
marginTop: -1,
|
|
20621
|
+
marginBottom: -2,
|
|
20622
|
+
zIndex: zIndex
|
|
20623
|
+
}
|
|
20624
|
+
}, /*#__PURE__*/React__namespace.createElement(Triangle, {
|
|
20625
|
+
horizontalDirection: props.horizontalDirection,
|
|
20626
|
+
verticalDirection: props.verticalDirection,
|
|
20627
|
+
color: props.border,
|
|
20628
|
+
left: 0,
|
|
20629
|
+
top: borderTopOffset,
|
|
20630
|
+
width: props.width + 2 // one extra for the diagonal
|
|
20631
|
+
,
|
|
20632
|
+
height: props.height + 2
|
|
20633
|
+
}), /*#__PURE__*/React__namespace.createElement(Triangle, {
|
|
20634
|
+
horizontalDirection: props.horizontalDirection,
|
|
20635
|
+
verticalDirection: props.verticalDirection,
|
|
20636
|
+
color: props.color,
|
|
20637
|
+
left: 1,
|
|
20638
|
+
top: frontTopOffset,
|
|
20639
|
+
width: props.width,
|
|
20640
|
+
height: props.height
|
|
20641
|
+
}));
|
|
20642
|
+
};
|
|
20643
|
+
TooltipArrow.defaultProps = {
|
|
20644
|
+
position: "relative",
|
|
20645
|
+
visibility: "visible",
|
|
20646
|
+
left: 0,
|
|
20647
|
+
top: 0
|
|
20648
|
+
};
|
|
20649
|
+
const VERTICAL_CORNERS = {
|
|
20650
|
+
top: {
|
|
20651
|
+
top: "-100%"
|
|
20652
|
+
},
|
|
20653
|
+
bottom: {
|
|
20654
|
+
top: 0
|
|
20655
|
+
}
|
|
20656
|
+
};
|
|
20657
|
+
const HORIZONTAL_CORNERS = {
|
|
20658
|
+
left: {
|
|
20659
|
+
targetLeft: 0
|
|
20660
|
+
},
|
|
20661
|
+
right: {
|
|
20662
|
+
targetLeft: "100%"
|
|
20663
|
+
}
|
|
20664
|
+
};
|
|
20665
|
+
const HORIZONTAL_ALIGNMNENTS = {
|
|
20666
|
+
left: {
|
|
20667
|
+
tooltipLeft: 0,
|
|
20668
|
+
arrowLeft: arrowSize => 0
|
|
20669
|
+
},
|
|
20670
|
+
right: {
|
|
20671
|
+
tooltipLeft: "-100%",
|
|
20672
|
+
arrowLeft: arrowSize => -arrowSize - 2
|
|
20673
|
+
}
|
|
20674
|
+
};
|
|
20675
|
+
class Tooltip extends React__namespace.Component {
|
|
20676
|
+
constructor() {
|
|
20677
|
+
super(...arguments);
|
|
20678
|
+
_defineProperty(this, "state", {
|
|
20679
|
+
height: null // used for offsetting "top" positioned tooltips
|
|
20680
|
+
});
|
|
20681
|
+
}
|
|
20682
|
+
|
|
20683
|
+
componentDidMount() {
|
|
20684
|
+
this._updateHeight();
|
|
20685
|
+
}
|
|
20686
|
+
UNSAFE_componentWillReceiveProps() {
|
|
20687
|
+
// If the contents have changed, reset our measure of the height
|
|
20688
|
+
this.setState({
|
|
20689
|
+
height: null
|
|
20690
|
+
});
|
|
20691
|
+
}
|
|
20692
|
+
componentDidUpdate() {
|
|
20693
|
+
this._updateHeight();
|
|
20694
|
+
}
|
|
20695
|
+
_renderToolTipDiv(isTooltipAbove) {
|
|
20696
|
+
const settings = Object.assign({}, HORIZONTAL_CORNERS[this.props.horizontalPosition], HORIZONTAL_ALIGNMNENTS[this.props.horizontalAlign], VERTICAL_CORNERS[this.props.verticalPosition]);
|
|
20697
|
+
let arrowAbove;
|
|
20698
|
+
let arrowBelow;
|
|
20699
|
+
if (isTooltipAbove) {
|
|
20700
|
+
// We put an absolutely positioned arrow in the correct place
|
|
20701
|
+
arrowAbove = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
20702
|
+
verticalDirection: VerticalDirection.Top,
|
|
20703
|
+
horizontalDirection: this.props.horizontalAlign,
|
|
20704
|
+
position: "absolute",
|
|
20705
|
+
color: "white",
|
|
20706
|
+
border: this.props.borderColor,
|
|
20707
|
+
left: settings.arrowLeft(this.props.arrowSize),
|
|
20708
|
+
top: -this.props.arrowSize + 2,
|
|
20709
|
+
width: this.props.arrowSize,
|
|
20710
|
+
height: this.props.arrowSize,
|
|
20711
|
+
zIndex: zIndex
|
|
20712
|
+
});
|
|
20713
|
+
|
|
20714
|
+
// And we use a visibility: hidden arrow below to shift up the
|
|
20715
|
+
// content by the correct amount
|
|
20716
|
+
arrowBelow = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
20717
|
+
verticalDirection: VerticalDirection.Top,
|
|
20718
|
+
horizontalDirection: this.props.horizontalAlign,
|
|
20719
|
+
visibility: "hidden",
|
|
20720
|
+
color: "white",
|
|
20721
|
+
border: this.props.borderColor,
|
|
20722
|
+
left: settings.arrowLeft(this.props.arrowSize),
|
|
20723
|
+
top: -1,
|
|
20724
|
+
width: this.props.arrowSize,
|
|
20725
|
+
height: this.props.arrowSize,
|
|
20726
|
+
zIndex: zIndex
|
|
20727
|
+
});
|
|
20728
|
+
} else {
|
|
20729
|
+
arrowAbove = /*#__PURE__*/React__namespace.createElement(TooltipArrow, {
|
|
20730
|
+
verticalDirection: VerticalDirection.Bottom,
|
|
20731
|
+
horizontalDirection: this.props.horizontalAlign,
|
|
20732
|
+
color: "white",
|
|
20733
|
+
border: this.props.borderColor,
|
|
20734
|
+
left: settings.arrowLeft(this.props.arrowSize),
|
|
20735
|
+
top: -1,
|
|
20736
|
+
width: this.props.arrowSize,
|
|
20737
|
+
height: this.props.arrowSize,
|
|
20738
|
+
zIndex: zIndex
|
|
20739
|
+
});
|
|
20740
|
+
arrowBelow = null;
|
|
20741
|
+
}
|
|
20742
|
+
|
|
20743
|
+
/* A positioned div below the input to be the parent for our
|
|
20744
|
+
tooltip */
|
|
20745
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
20746
|
+
style: {
|
|
20747
|
+
position: "relative",
|
|
20748
|
+
height: 0,
|
|
20749
|
+
display: this.props.show ? "block" : "none"
|
|
20750
|
+
}
|
|
20751
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
20752
|
+
// eslint-disable-next-line react/no-string-refs
|
|
20753
|
+
ref: "tooltipContainer",
|
|
20754
|
+
className: "tooltipContainer",
|
|
20755
|
+
style: {
|
|
20756
|
+
position: "absolute",
|
|
20757
|
+
// height must start out undefined, not null, so that
|
|
20758
|
+
// we can measure the actual height with jquery.
|
|
20759
|
+
// This is used to position the tooltip with top: -100%
|
|
20760
|
+
// when in verticalPosition: "top" mode
|
|
20761
|
+
height: this.state.height || undefined,
|
|
20762
|
+
left: settings.targetLeft
|
|
20763
|
+
}
|
|
20764
|
+
}, arrowAbove, /*#__PURE__*/React__namespace.createElement("div", {
|
|
20765
|
+
className: this.props.className
|
|
20766
|
+
// eslint-disable-next-line react/no-string-refs
|
|
20767
|
+
,
|
|
20768
|
+
ref: "tooltipContent",
|
|
20769
|
+
style: {
|
|
20770
|
+
position: "relative",
|
|
20771
|
+
top: settings["top"],
|
|
20772
|
+
left: settings.tooltipLeft,
|
|
20773
|
+
border: "1px solid " + this.props.borderColor,
|
|
20774
|
+
boxShadow: "0 1px 3px " + this.props.borderColor,
|
|
20775
|
+
zIndex: zIndex - 1
|
|
20776
|
+
}
|
|
20777
|
+
}, this.props.children.slice(1)), arrowBelow));
|
|
20778
|
+
}
|
|
20779
|
+
_updateHeight() {
|
|
20780
|
+
const tooltipContainer = ReactDOM__default["default"].findDOMNode(
|
|
20781
|
+
// eslint-disable-next-line react/no-string-refs
|
|
20782
|
+
this.refs.tooltipContainer);
|
|
20783
|
+
const height = tooltipContainer.offsetHeight;
|
|
20784
|
+
if (height !== this.state.height) {
|
|
20785
|
+
this.setState({
|
|
20786
|
+
height
|
|
20787
|
+
});
|
|
20788
|
+
}
|
|
20789
|
+
}
|
|
20790
|
+
render() {
|
|
20791
|
+
const isTooltipAbove = this.props.verticalPosition === "top";
|
|
20792
|
+
|
|
20793
|
+
/* We wrap the entire output in a span so that it displays inline */
|
|
20794
|
+
return /*#__PURE__*/React__namespace.createElement("span", null, isTooltipAbove && this._renderToolTipDiv(isTooltipAbove), /*#__PURE__*/React__namespace.createElement("div", {
|
|
20795
|
+
style: this.props.targetContainerStyle
|
|
20796
|
+
}, this.props.children[0]), !isTooltipAbove && this._renderToolTipDiv());
|
|
20797
|
+
}
|
|
20798
|
+
}
|
|
20799
|
+
|
|
20800
|
+
// Sorry. // Apology-Oriented-Programming
|
|
20801
|
+
_defineProperty(Tooltip, "defaultProps", {
|
|
20802
|
+
className: "",
|
|
20803
|
+
arrowSize: 10,
|
|
20804
|
+
borderColor: "#ccc",
|
|
20805
|
+
verticalPosition: VerticalDirection.Bottom,
|
|
20806
|
+
horizontalPosition: HorizontalDirection.Left,
|
|
20807
|
+
horizontalAlign: HorizontalDirection.Left,
|
|
20808
|
+
targetContainerStyle: {}
|
|
20809
|
+
});
|
|
20810
|
+
|
|
20952
20811
|
const {
|
|
20953
20812
|
captureScratchpadTouchStart: captureScratchpadTouchStart$3
|
|
20954
20813
|
} = Util;
|
|
@@ -24761,26 +24620,6 @@ var Explanation$1 = {
|
|
|
24761
24620
|
isLintable: true
|
|
24762
24621
|
};
|
|
24763
24622
|
|
|
24764
|
-
/*
|
|
24765
|
-
* A11y (Accessibility) style rules
|
|
24766
|
-
* These are used to mark up areas on the site that should only be readable
|
|
24767
|
-
* when using a screen reader.
|
|
24768
|
-
*/
|
|
24769
|
-
var a11y = aphrodite.StyleSheet.create({
|
|
24770
|
-
// Make content only visible to screen readers.
|
|
24771
|
-
// Both collegeboard.org and Bootstrap 3 use this exact implementation.
|
|
24772
|
-
srOnly: {
|
|
24773
|
-
border: 0,
|
|
24774
|
-
clip: "rect(0,0,0,0)",
|
|
24775
|
-
height: 1,
|
|
24776
|
-
margin: -1,
|
|
24777
|
-
overflow: "hidden",
|
|
24778
|
-
padding: 0,
|
|
24779
|
-
position: "absolute",
|
|
24780
|
-
width: 1
|
|
24781
|
-
}
|
|
24782
|
-
});
|
|
24783
|
-
|
|
24784
24623
|
class GradedGroupAnswerBar extends React__namespace.Component {
|
|
24785
24624
|
render() {
|
|
24786
24625
|
const {
|
|
@@ -26036,19 +25875,19 @@ const typeToButton = type => {
|
|
|
26036
25875
|
};
|
|
26037
25876
|
|
|
26038
25877
|
var util = /*#__PURE__*/Object.freeze({
|
|
26039
|
-
|
|
26040
|
-
|
|
26041
|
-
|
|
26042
|
-
|
|
26043
|
-
|
|
26044
|
-
|
|
26045
|
-
|
|
26046
|
-
|
|
26047
|
-
|
|
26048
|
-
|
|
26049
|
-
|
|
26050
|
-
|
|
26051
|
-
|
|
25878
|
+
__proto__: null,
|
|
25879
|
+
DEFAULT_BACKGROUND_IMAGE: DEFAULT_BACKGROUND_IMAGE,
|
|
25880
|
+
allTypes: allTypes,
|
|
25881
|
+
functionForType: functionForType,
|
|
25882
|
+
validate: validate$2,
|
|
25883
|
+
getEquationString: getEquationString,
|
|
25884
|
+
pointsFromNormalized: pointsFromNormalized,
|
|
25885
|
+
maybePointsFromNormalized: maybePointsFromNormalized,
|
|
25886
|
+
defaultPlotProps: defaultPlotProps,
|
|
25887
|
+
chooseType: chooseType,
|
|
25888
|
+
getGridAndSnapSteps: getGridAndSnapSteps,
|
|
25889
|
+
DEFAULT_GRAPHER_PROPS: DEFAULT_GRAPHER_PROPS,
|
|
25890
|
+
typeToButton: typeToButton
|
|
26052
25891
|
});
|
|
26053
25892
|
|
|
26054
25893
|
// @ts-expect-error - TS2339 - Property 'MovablePoint' does not exist on type 'typeof Graphie'.
|
|
@@ -30324,349 +30163,349 @@ const pureMdMax = "1023px";
|
|
|
30324
30163
|
const pureLgMax = "1199px";
|
|
30325
30164
|
|
|
30326
30165
|
var globalConstants = /*#__PURE__*/Object.freeze({
|
|
30327
|
-
|
|
30328
|
-
|
|
30329
|
-
|
|
30330
|
-
|
|
30331
|
-
|
|
30332
|
-
|
|
30333
|
-
|
|
30334
|
-
|
|
30335
|
-
|
|
30336
|
-
|
|
30337
|
-
|
|
30338
|
-
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
|
|
30344
|
-
|
|
30345
|
-
|
|
30346
|
-
|
|
30347
|
-
|
|
30348
|
-
|
|
30349
|
-
|
|
30350
|
-
|
|
30351
|
-
|
|
30352
|
-
|
|
30353
|
-
|
|
30354
|
-
|
|
30355
|
-
|
|
30356
|
-
|
|
30357
|
-
|
|
30358
|
-
|
|
30359
|
-
|
|
30360
|
-
|
|
30361
|
-
|
|
30362
|
-
|
|
30363
|
-
|
|
30364
|
-
|
|
30365
|
-
|
|
30366
|
-
|
|
30367
|
-
|
|
30368
|
-
|
|
30369
|
-
|
|
30370
|
-
|
|
30371
|
-
|
|
30372
|
-
|
|
30373
|
-
|
|
30374
|
-
|
|
30375
|
-
|
|
30376
|
-
|
|
30377
|
-
|
|
30378
|
-
|
|
30379
|
-
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
|
|
30407
|
-
|
|
30408
|
-
|
|
30409
|
-
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
|
|
30424
|
-
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
|
|
30455
|
-
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
|
|
30469
|
-
|
|
30470
|
-
|
|
30471
|
-
|
|
30472
|
-
|
|
30473
|
-
|
|
30474
|
-
|
|
30475
|
-
|
|
30476
|
-
|
|
30477
|
-
|
|
30478
|
-
|
|
30479
|
-
|
|
30480
|
-
|
|
30481
|
-
|
|
30482
|
-
|
|
30483
|
-
|
|
30484
|
-
|
|
30485
|
-
|
|
30486
|
-
|
|
30487
|
-
|
|
30488
|
-
|
|
30489
|
-
|
|
30490
|
-
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
30494
|
-
|
|
30495
|
-
|
|
30496
|
-
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
|
|
30500
|
-
|
|
30501
|
-
|
|
30502
|
-
|
|
30503
|
-
|
|
30504
|
-
|
|
30505
|
-
|
|
30506
|
-
|
|
30507
|
-
|
|
30508
|
-
|
|
30509
|
-
|
|
30510
|
-
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30514
|
-
|
|
30515
|
-
|
|
30516
|
-
|
|
30517
|
-
|
|
30518
|
-
|
|
30519
|
-
|
|
30520
|
-
|
|
30521
|
-
|
|
30522
|
-
|
|
30523
|
-
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
|
|
30528
|
-
|
|
30529
|
-
|
|
30530
|
-
|
|
30531
|
-
|
|
30532
|
-
|
|
30533
|
-
|
|
30534
|
-
|
|
30535
|
-
|
|
30536
|
-
|
|
30537
|
-
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
|
|
30543
|
-
|
|
30544
|
-
|
|
30545
|
-
|
|
30546
|
-
|
|
30547
|
-
|
|
30548
|
-
|
|
30549
|
-
|
|
30550
|
-
|
|
30551
|
-
|
|
30552
|
-
|
|
30553
|
-
|
|
30554
|
-
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
|
|
30558
|
-
|
|
30559
|
-
|
|
30560
|
-
|
|
30561
|
-
|
|
30562
|
-
|
|
30563
|
-
|
|
30564
|
-
|
|
30565
|
-
|
|
30566
|
-
|
|
30567
|
-
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
|
|
30572
|
-
|
|
30573
|
-
|
|
30574
|
-
|
|
30575
|
-
|
|
30576
|
-
|
|
30577
|
-
|
|
30578
|
-
|
|
30579
|
-
|
|
30580
|
-
|
|
30581
|
-
|
|
30582
|
-
|
|
30583
|
-
|
|
30584
|
-
|
|
30585
|
-
|
|
30586
|
-
|
|
30587
|
-
|
|
30588
|
-
|
|
30589
|
-
|
|
30590
|
-
|
|
30591
|
-
|
|
30592
|
-
|
|
30593
|
-
|
|
30594
|
-
|
|
30595
|
-
|
|
30596
|
-
|
|
30597
|
-
|
|
30598
|
-
|
|
30599
|
-
|
|
30600
|
-
|
|
30601
|
-
|
|
30602
|
-
|
|
30603
|
-
|
|
30604
|
-
|
|
30605
|
-
|
|
30606
|
-
|
|
30607
|
-
|
|
30608
|
-
|
|
30609
|
-
|
|
30610
|
-
|
|
30611
|
-
|
|
30612
|
-
|
|
30613
|
-
|
|
30614
|
-
|
|
30615
|
-
|
|
30616
|
-
|
|
30617
|
-
|
|
30618
|
-
|
|
30619
|
-
|
|
30620
|
-
|
|
30621
|
-
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
|
|
30625
|
-
|
|
30626
|
-
|
|
30627
|
-
|
|
30628
|
-
|
|
30629
|
-
|
|
30630
|
-
|
|
30631
|
-
|
|
30632
|
-
|
|
30633
|
-
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30639
|
-
|
|
30640
|
-
|
|
30641
|
-
|
|
30642
|
-
|
|
30643
|
-
|
|
30644
|
-
|
|
30645
|
-
|
|
30646
|
-
|
|
30647
|
-
|
|
30648
|
-
|
|
30649
|
-
|
|
30650
|
-
|
|
30651
|
-
|
|
30652
|
-
|
|
30653
|
-
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30166
|
+
__proto__: null,
|
|
30167
|
+
black: black,
|
|
30168
|
+
grayDarker: grayDarker,
|
|
30169
|
+
grayDark: grayDark,
|
|
30170
|
+
gray: gray,
|
|
30171
|
+
grayLight: grayLight,
|
|
30172
|
+
grayLighter: grayLighter,
|
|
30173
|
+
white: white,
|
|
30174
|
+
blue: blue,
|
|
30175
|
+
blueDark: blueDark,
|
|
30176
|
+
green: green,
|
|
30177
|
+
red: red,
|
|
30178
|
+
yellow: yellow,
|
|
30179
|
+
orange: orange,
|
|
30180
|
+
pink: pink,
|
|
30181
|
+
purple: purple,
|
|
30182
|
+
bodyBackground: bodyBackground,
|
|
30183
|
+
textColor: textColor,
|
|
30184
|
+
linkColor: linkColor,
|
|
30185
|
+
linkColorHover: linkColorHover,
|
|
30186
|
+
sansFontFamily: sansFontFamily,
|
|
30187
|
+
serifFontFamily: serifFontFamily,
|
|
30188
|
+
monoFontFamily: monoFontFamily,
|
|
30189
|
+
baseFontSize: baseFontSize,
|
|
30190
|
+
baseFontFamily: baseFontFamily,
|
|
30191
|
+
baseLineHeight: baseLineHeight,
|
|
30192
|
+
altFontFamily: altFontFamily,
|
|
30193
|
+
headingsFontFamily: headingsFontFamily,
|
|
30194
|
+
headingsFontWeight: headingsFontWeight,
|
|
30195
|
+
headingsColor: headingsColor,
|
|
30196
|
+
fontSizeLarge: fontSizeLarge,
|
|
30197
|
+
fontSizeSmall: fontSizeSmall,
|
|
30198
|
+
fontSizeMini: fontSizeMini,
|
|
30199
|
+
paddingLarge: paddingLarge,
|
|
30200
|
+
paddingSmall: paddingSmall,
|
|
30201
|
+
paddingMini: paddingMini,
|
|
30202
|
+
baseBorderRadius: baseBorderRadius,
|
|
30203
|
+
borderRadiusLarge: borderRadiusLarge,
|
|
30204
|
+
borderRadiusSmall: borderRadiusSmall,
|
|
30205
|
+
tableBackground: tableBackground,
|
|
30206
|
+
tableBackgroundAccent: tableBackgroundAccent,
|
|
30207
|
+
tableBackgroundHover: tableBackgroundHover,
|
|
30208
|
+
tableBorder: tableBorder,
|
|
30209
|
+
btnBackground: btnBackground,
|
|
30210
|
+
btnBackgroundHighlight: btnBackgroundHighlight,
|
|
30211
|
+
btnBorder: btnBorder,
|
|
30212
|
+
btnPrimaryBackground: btnPrimaryBackground,
|
|
30213
|
+
btnPrimaryBackgroundHighlight: btnPrimaryBackgroundHighlight,
|
|
30214
|
+
btnInfoBackground: btnInfoBackground,
|
|
30215
|
+
btnInfoBackgroundHighlight: btnInfoBackgroundHighlight,
|
|
30216
|
+
btnSuccessBackground: btnSuccessBackground,
|
|
30217
|
+
btnSuccessBackgroundHighlight: btnSuccessBackgroundHighlight,
|
|
30218
|
+
btnWarningBackground: btnWarningBackground,
|
|
30219
|
+
btnWarningBackgroundHighlight: btnWarningBackgroundHighlight,
|
|
30220
|
+
btnDangerBackground: btnDangerBackground,
|
|
30221
|
+
btnDangerBackgroundHighlight: btnDangerBackgroundHighlight,
|
|
30222
|
+
btnInverseBackground: btnInverseBackground,
|
|
30223
|
+
btnInverseBackgroundHighlight: btnInverseBackgroundHighlight,
|
|
30224
|
+
inputBackground: inputBackground,
|
|
30225
|
+
inputBorder: inputBorder,
|
|
30226
|
+
inputBorderRadius: inputBorderRadius,
|
|
30227
|
+
inputDisabledBackground: inputDisabledBackground,
|
|
30228
|
+
formActionsBackground: formActionsBackground,
|
|
30229
|
+
inputHeight: inputHeight,
|
|
30230
|
+
dropdownBackground: dropdownBackground,
|
|
30231
|
+
dropdownBorder: dropdownBorder,
|
|
30232
|
+
dropdownDividerTop: dropdownDividerTop,
|
|
30233
|
+
dropdownDividerBottom: dropdownDividerBottom,
|
|
30234
|
+
dropdownLinkColor: dropdownLinkColor,
|
|
30235
|
+
dropdownLinkColorHover: dropdownLinkColorHover,
|
|
30236
|
+
dropdownLinkColorActive: dropdownLinkColorActive,
|
|
30237
|
+
dropdownLinkBackgroundActive: dropdownLinkBackgroundActive,
|
|
30238
|
+
dropdownLinkBackgroundHover: dropdownLinkBackgroundHover,
|
|
30239
|
+
zindexDropdown: zindexDropdown,
|
|
30240
|
+
zindexPopover: zindexPopover,
|
|
30241
|
+
zindexTooltip: zindexTooltip,
|
|
30242
|
+
zindexFixedNavbar: zindexFixedNavbar,
|
|
30243
|
+
zindexHeader: zindexHeader,
|
|
30244
|
+
zindexModalBackdrop: zindexModalBackdrop,
|
|
30245
|
+
zindexModal: zindexModal,
|
|
30246
|
+
zindexAboveModal: zindexAboveModal,
|
|
30247
|
+
iconSpritePath: iconSpritePath,
|
|
30248
|
+
iconWhiteSpritePath: iconWhiteSpritePath,
|
|
30249
|
+
placeholderText: placeholderText,
|
|
30250
|
+
hrBorder: hrBorder,
|
|
30251
|
+
horizontalComponentOffset: horizontalComponentOffset,
|
|
30252
|
+
wellBackground: wellBackground,
|
|
30253
|
+
navbarCollapseWidth: navbarCollapseWidth,
|
|
30254
|
+
navbarCollapseDesktopWidth: navbarCollapseDesktopWidth,
|
|
30255
|
+
navbarHeight: navbarHeight,
|
|
30256
|
+
navbarBackgroundHighlight: navbarBackgroundHighlight,
|
|
30257
|
+
navbarBackground: navbarBackground,
|
|
30258
|
+
navbarBorder: navbarBorder,
|
|
30259
|
+
navbarText: navbarText,
|
|
30260
|
+
navbarLinkColor: navbarLinkColor,
|
|
30261
|
+
navbarLinkColorHover: navbarLinkColorHover,
|
|
30262
|
+
navbarLinkColorActive: navbarLinkColorActive,
|
|
30263
|
+
navbarLinkBackgroundHover: navbarLinkBackgroundHover,
|
|
30264
|
+
navbarLinkBackgroundActive: navbarLinkBackgroundActive,
|
|
30265
|
+
navbarBrandColor: navbarBrandColor,
|
|
30266
|
+
navbarInverseBackground: navbarInverseBackground,
|
|
30267
|
+
navbarInverseBackgroundHighlight: navbarInverseBackgroundHighlight,
|
|
30268
|
+
navbarInverseBorder: navbarInverseBorder,
|
|
30269
|
+
navbarInverseText: navbarInverseText,
|
|
30270
|
+
navbarInverseLinkColor: navbarInverseLinkColor,
|
|
30271
|
+
navbarInverseLinkColorHover: navbarInverseLinkColorHover,
|
|
30272
|
+
navbarInverseLinkColorActive: navbarInverseLinkColorActive,
|
|
30273
|
+
navbarInverseLinkBackgroundHover: navbarInverseLinkBackgroundHover,
|
|
30274
|
+
navbarInverseLinkBackgroundActive: navbarInverseLinkBackgroundActive,
|
|
30275
|
+
navbarInverseSearchBackground: navbarInverseSearchBackground,
|
|
30276
|
+
navbarInverseSearchBackgroundFocus: navbarInverseSearchBackgroundFocus,
|
|
30277
|
+
navbarInverseSearchBorder: navbarInverseSearchBorder,
|
|
30278
|
+
navbarInverseSearchPlaceholderColor: navbarInverseSearchPlaceholderColor,
|
|
30279
|
+
navbarInverseBrandColor: navbarInverseBrandColor,
|
|
30280
|
+
paginationBackground: paginationBackground,
|
|
30281
|
+
paginationBorder: paginationBorder,
|
|
30282
|
+
paginationActiveBackground: paginationActiveBackground,
|
|
30283
|
+
heroUnitBackground: heroUnitBackground,
|
|
30284
|
+
heroUnitHeadingColor: heroUnitHeadingColor,
|
|
30285
|
+
heroUnitLeadColor: heroUnitLeadColor,
|
|
30286
|
+
warningText: warningText,
|
|
30287
|
+
warningBackground: warningBackground,
|
|
30288
|
+
warningBorder: warningBorder,
|
|
30289
|
+
errorText: errorText,
|
|
30290
|
+
errorBackground: errorBackground,
|
|
30291
|
+
errorBorder: errorBorder,
|
|
30292
|
+
successText: successText,
|
|
30293
|
+
successBackground: successBackground,
|
|
30294
|
+
successBorder: successBorder,
|
|
30295
|
+
infoText: infoText,
|
|
30296
|
+
infoBackground: infoBackground,
|
|
30297
|
+
infoBorder: infoBorder,
|
|
30298
|
+
tooltipColor: tooltipColor,
|
|
30299
|
+
tooltipBackground: tooltipBackground,
|
|
30300
|
+
tooltipArrowWidth: tooltipArrowWidth,
|
|
30301
|
+
tooltipArrowColor: tooltipArrowColor,
|
|
30302
|
+
popoverBackground: popoverBackground,
|
|
30303
|
+
popoverArrowWidth: popoverArrowWidth,
|
|
30304
|
+
popoverArrowColor: popoverArrowColor,
|
|
30305
|
+
popoverTitleBackground: popoverTitleBackground,
|
|
30306
|
+
popoverArrowOuterWidth: popoverArrowOuterWidth,
|
|
30307
|
+
popoverArrowOuterColor: popoverArrowOuterColor,
|
|
30308
|
+
gridColumns: gridColumns,
|
|
30309
|
+
gridColumnWidth: gridColumnWidth,
|
|
30310
|
+
gridGutterWidth: gridGutterWidth,
|
|
30311
|
+
gridRowWidth: gridRowWidth,
|
|
30312
|
+
gridColumnWidth1200: gridColumnWidth1200,
|
|
30313
|
+
gridGutterWidth1200: gridGutterWidth1200,
|
|
30314
|
+
gridRowWidth1200: gridRowWidth1200,
|
|
30315
|
+
gridColumnWidth768: gridColumnWidth768,
|
|
30316
|
+
gridGutterWidth768: gridGutterWidth768,
|
|
30317
|
+
gridRowWidth768: gridRowWidth768,
|
|
30318
|
+
fluidGridColumnWidth: fluidGridColumnWidth,
|
|
30319
|
+
fluidGridGutterWidth: fluidGridGutterWidth,
|
|
30320
|
+
fluidGridColumnWidth1200: fluidGridColumnWidth1200,
|
|
30321
|
+
fluidGridGutterWidth1200: fluidGridGutterWidth1200,
|
|
30322
|
+
fluidGridColumnWidth768: fluidGridColumnWidth768,
|
|
30323
|
+
fluidGridGutterWidth768: fluidGridGutterWidth768,
|
|
30324
|
+
kaGreen: kaGreen,
|
|
30325
|
+
kaGreenLight: kaGreenLight,
|
|
30326
|
+
kaBlue: kaBlue,
|
|
30327
|
+
kaBlueLight: kaBlueLight,
|
|
30328
|
+
grayExtraDark: grayExtraDark,
|
|
30329
|
+
grayExtraLight: grayExtraLight,
|
|
30330
|
+
graySuperLight: graySuperLight,
|
|
30331
|
+
whiteDark: whiteDark,
|
|
30332
|
+
dark: dark,
|
|
30333
|
+
blueDarkUnsaturated: blueDarkUnsaturated,
|
|
30334
|
+
blueDarkSaturated: blueDarkSaturated,
|
|
30335
|
+
blueLight: blueLight,
|
|
30336
|
+
greenLight: greenLight,
|
|
30337
|
+
greenDark: greenDark,
|
|
30338
|
+
yellowGreen: yellowGreen,
|
|
30339
|
+
okGreen: okGreen,
|
|
30340
|
+
alertRed: alertRed,
|
|
30341
|
+
coral: coral,
|
|
30342
|
+
grayBlue: grayBlue,
|
|
30343
|
+
lightPageBackground: lightPageBackground,
|
|
30344
|
+
yclaBlue: yclaBlue,
|
|
30345
|
+
yclaTeal: yclaTeal,
|
|
30346
|
+
yclaTealDark: yclaTealDark,
|
|
30347
|
+
yclaGreenDark: yclaGreenDark,
|
|
30348
|
+
yclaGreen: yclaGreen,
|
|
30349
|
+
learnstormBlue: learnstormBlue,
|
|
30350
|
+
homepageBlue: homepageBlue,
|
|
30351
|
+
backgroundBlue: backgroundBlue,
|
|
30352
|
+
teacherSignupBlue: teacherSignupBlue,
|
|
30353
|
+
homepageGreen: homepageGreen,
|
|
30354
|
+
streakColor: streakColor,
|
|
30355
|
+
facebookColor: facebookColor,
|
|
30356
|
+
blueGoogleColor: blueGoogleColor,
|
|
30357
|
+
redGoogleColor: redGoogleColor,
|
|
30358
|
+
homepageColor: homepageColor,
|
|
30359
|
+
lightTextColor: lightTextColor,
|
|
30360
|
+
fontSizeTiny: fontSizeTiny,
|
|
30361
|
+
fontSizeNormal: fontSizeNormal,
|
|
30362
|
+
fontSizeMedium: fontSizeMedium,
|
|
30363
|
+
fontSizeExtraLarge: fontSizeExtraLarge,
|
|
30364
|
+
fontSizeHuge: fontSizeHuge,
|
|
30365
|
+
fontSizeBakana: fontSizeBakana,
|
|
30366
|
+
fontSizeBananas: fontSizeBananas,
|
|
30367
|
+
fixedWidthFontFamily: fixedWidthFontFamily,
|
|
30368
|
+
contentPadding: contentPadding,
|
|
30369
|
+
primaryButtonBackground: primaryButtonBackground,
|
|
30370
|
+
primaryButtonBorder: primaryButtonBorder,
|
|
30371
|
+
buttonTextColor: buttonTextColor,
|
|
30372
|
+
buttonBorderRadius: buttonBorderRadius,
|
|
30373
|
+
basicBorderColor: basicBorderColor,
|
|
30374
|
+
minContainerWidth: minContainerWidth,
|
|
30375
|
+
maxContainerWidth: maxContainerWidth,
|
|
30376
|
+
formHintColor: formHintColor,
|
|
30377
|
+
guidelineExampleText: guidelineExampleText,
|
|
30378
|
+
hoverCardWidth: hoverCardWidth,
|
|
30379
|
+
menuHighlightColor: menuHighlightColor,
|
|
30380
|
+
menuHighlightBorderColor: menuHighlightBorderColor,
|
|
30381
|
+
menuActiveTextColor: menuActiveTextColor,
|
|
30382
|
+
menuInactiveTextColor: menuInactiveTextColor,
|
|
30383
|
+
menuSubheaderTextColor: menuSubheaderTextColor,
|
|
30384
|
+
menuBorderColor: menuBorderColor,
|
|
30385
|
+
unreadBackgroundColor: unreadBackgroundColor,
|
|
30386
|
+
menuLineHeight: menuLineHeight,
|
|
30387
|
+
menuSubheaderLineHeight: menuSubheaderLineHeight,
|
|
30388
|
+
menuSubheaderFontSize: menuSubheaderFontSize,
|
|
30389
|
+
notificationBarColor: notificationBarColor,
|
|
30390
|
+
modalBodyTopPadding: modalBodyTopPadding,
|
|
30391
|
+
modalDialogPadding: modalDialogPadding,
|
|
30392
|
+
modalSectionPadding: modalSectionPadding,
|
|
30393
|
+
mathDomain1: mathDomain1,
|
|
30394
|
+
mathDomain2: mathDomain2,
|
|
30395
|
+
mathDomain3: mathDomain3,
|
|
30396
|
+
mathDomain4: mathDomain4,
|
|
30397
|
+
partnerContentDomain1: partnerContentDomain1,
|
|
30398
|
+
partnerContentDomain2: partnerContentDomain2,
|
|
30399
|
+
partnerContentDomain3: partnerContentDomain3,
|
|
30400
|
+
partnerContentDomain4: partnerContentDomain4,
|
|
30401
|
+
csDomain1: csDomain1,
|
|
30402
|
+
csDomain2: csDomain2,
|
|
30403
|
+
csDomain3: csDomain3,
|
|
30404
|
+
csDomain4: csDomain4,
|
|
30405
|
+
economicsDomain1: economicsDomain1,
|
|
30406
|
+
economicsDomain2: economicsDomain2,
|
|
30407
|
+
economicsDomain3: economicsDomain3,
|
|
30408
|
+
economicsDomain4: economicsDomain4,
|
|
30409
|
+
collegeCareersMoreDomain1: collegeCareersMoreDomain1,
|
|
30410
|
+
collegeCareersMoreDomain2: collegeCareersMoreDomain2,
|
|
30411
|
+
collegeCareersMoreDomain3: collegeCareersMoreDomain3,
|
|
30412
|
+
collegeCareersMoreDomain4: collegeCareersMoreDomain4,
|
|
30413
|
+
humanitiesDomain1: humanitiesDomain1,
|
|
30414
|
+
humanitiesDomain2: humanitiesDomain2,
|
|
30415
|
+
humanitiesDomain3: humanitiesDomain3,
|
|
30416
|
+
humanitiesDomain4: humanitiesDomain4,
|
|
30417
|
+
gtpDomain1: gtpDomain1,
|
|
30418
|
+
gtpDomain2: gtpDomain2,
|
|
30419
|
+
gtpDomain3: gtpDomain3,
|
|
30420
|
+
gtpDomain4: gtpDomain4,
|
|
30421
|
+
scienceDomain1: scienceDomain1,
|
|
30422
|
+
scienceDomain2: scienceDomain2,
|
|
30423
|
+
scienceDomain3: scienceDomain3,
|
|
30424
|
+
scienceDomain4: scienceDomain4,
|
|
30425
|
+
testPrepDomain1: testPrepDomain1,
|
|
30426
|
+
testPrepDomain2: testPrepDomain2,
|
|
30427
|
+
testPrepDomain3: testPrepDomain3,
|
|
30428
|
+
testPrepDomain4: testPrepDomain4,
|
|
30429
|
+
defaultDomain1: defaultDomain1,
|
|
30430
|
+
defaultDomain2: defaultDomain2,
|
|
30431
|
+
defaultDomain3: defaultDomain3,
|
|
30432
|
+
defaultDomain4: defaultDomain4,
|
|
30433
|
+
defaultDomainColor: defaultDomainColor,
|
|
30434
|
+
defaultSubjectColor: defaultSubjectColor,
|
|
30435
|
+
defaultTopicColor: defaultTopicColor,
|
|
30436
|
+
defaultHoverColor: defaultHoverColor,
|
|
30437
|
+
defaultLinkColor: defaultLinkColor,
|
|
30438
|
+
defaultLinkHoverColor: defaultLinkHoverColor,
|
|
30439
|
+
scienceDomainColor: scienceDomainColor,
|
|
30440
|
+
scienceSubjectColor: scienceSubjectColor,
|
|
30441
|
+
scienceTopicColor: scienceTopicColor,
|
|
30442
|
+
scienceHoverColor: scienceHoverColor,
|
|
30443
|
+
scienceLinkColor: scienceLinkColor,
|
|
30444
|
+
scienceLinkHoverColor: scienceLinkHoverColor,
|
|
30445
|
+
humanitiesDomainColor: humanitiesDomainColor,
|
|
30446
|
+
humanitiesSubjectColor: humanitiesSubjectColor,
|
|
30447
|
+
humanitiesTopicColor: humanitiesTopicColor,
|
|
30448
|
+
humanitiesHoverColor: humanitiesHoverColor,
|
|
30449
|
+
humanitiesLinkColor: humanitiesLinkColor,
|
|
30450
|
+
humanitiesLinkHoverColor: humanitiesLinkHoverColor,
|
|
30451
|
+
economicsDomainColor: economicsDomainColor,
|
|
30452
|
+
economicsSubjectColor: economicsSubjectColor,
|
|
30453
|
+
economicsTopicColor: economicsTopicColor,
|
|
30454
|
+
economicsHoverColor: economicsHoverColor,
|
|
30455
|
+
economicsLinkColor: economicsLinkColor,
|
|
30456
|
+
economicsLinkHoverColor: economicsLinkHoverColor,
|
|
30457
|
+
csDomainColor: csDomainColor,
|
|
30458
|
+
csSubjectColor: csSubjectColor,
|
|
30459
|
+
csTopicColor: csTopicColor,
|
|
30460
|
+
csHoverColor: csHoverColor,
|
|
30461
|
+
csLinkColor: csLinkColor,
|
|
30462
|
+
csLinkHoverColor: csLinkHoverColor,
|
|
30463
|
+
partnerContentDomainColor: partnerContentDomainColor,
|
|
30464
|
+
partnerContentSubjectColor: partnerContentSubjectColor,
|
|
30465
|
+
partnerContentTopicColor: partnerContentTopicColor,
|
|
30466
|
+
partnerContentHoverColor: partnerContentHoverColor,
|
|
30467
|
+
partnerContentLinkColor: partnerContentLinkColor,
|
|
30468
|
+
partnerContentLinkHoverColor: partnerContentLinkHoverColor,
|
|
30469
|
+
essayDomainColor: essayDomainColor,
|
|
30470
|
+
mathDomainColor: mathDomainColor,
|
|
30471
|
+
mathSubjectColor: mathSubjectColor,
|
|
30472
|
+
mathTopicColor: mathTopicColor,
|
|
30473
|
+
mathHoverColor: mathHoverColor,
|
|
30474
|
+
mathLinkColor: mathLinkColor,
|
|
30475
|
+
mathLinkHoverColor: mathLinkHoverColor,
|
|
30476
|
+
testPrepDomainColor: testPrepDomainColor,
|
|
30477
|
+
testPrepSubjectColor: testPrepSubjectColor,
|
|
30478
|
+
testPrepTopicColor: testPrepTopicColor,
|
|
30479
|
+
testPrepHoverColor: testPrepHoverColor,
|
|
30480
|
+
testPrepLinkColor: testPrepLinkColor,
|
|
30481
|
+
testPrepLinkHoverColor: testPrepLinkHoverColor,
|
|
30482
|
+
collegeCareersMoreDomainColor: collegeCareersMoreDomainColor,
|
|
30483
|
+
collegeCareersMoreSubjectColor: collegeCareersMoreSubjectColor,
|
|
30484
|
+
collegeCareersMoreTopicColor: collegeCareersMoreTopicColor,
|
|
30485
|
+
collegeCareersMoreHoverColor: collegeCareersMoreHoverColor,
|
|
30486
|
+
collegeCareersMoreLinkColor: collegeCareersMoreLinkColor,
|
|
30487
|
+
collegeCareersMoreLinkHoverColor: collegeCareersMoreLinkHoverColor,
|
|
30488
|
+
colorProficient: colorProficient,
|
|
30489
|
+
colorPracticed: colorPracticed,
|
|
30490
|
+
colorMastery1: colorMastery1,
|
|
30491
|
+
colorMastery2: colorMastery2,
|
|
30492
|
+
colorMastery3: colorMastery3,
|
|
30493
|
+
colorSuggested: colorSuggested,
|
|
30494
|
+
colorReview: colorReview,
|
|
30495
|
+
colorNotStarted: colorNotStarted,
|
|
30496
|
+
colorStarted: colorStarted,
|
|
30497
|
+
colorStruggling: colorStruggling,
|
|
30498
|
+
colorPersonal: colorPersonal,
|
|
30499
|
+
colorPractice: colorPractice,
|
|
30500
|
+
colorEnergyPoints: colorEnergyPoints,
|
|
30501
|
+
pureSmMin: pureSmMin,
|
|
30502
|
+
pureMdMin: pureMdMin,
|
|
30503
|
+
pureLgMin: pureLgMin,
|
|
30504
|
+
pureXlMin: pureXlMin,
|
|
30505
|
+
pureXsMax: pureXsMax,
|
|
30506
|
+
pureSmMax: pureSmMax,
|
|
30507
|
+
pureMdMax: pureMdMax,
|
|
30508
|
+
pureLgMax: pureLgMax
|
|
30670
30509
|
});
|
|
30671
30510
|
|
|
30672
30511
|
const colors$1 = {
|
|
@@ -30943,11 +30782,11 @@ const typography = {
|
|
|
30943
30782
|
};
|
|
30944
30783
|
|
|
30945
30784
|
var globalStyles = /*#__PURE__*/Object.freeze({
|
|
30946
|
-
|
|
30947
|
-
|
|
30948
|
-
|
|
30949
|
-
|
|
30950
|
-
|
|
30785
|
+
__proto__: null,
|
|
30786
|
+
colors: colors$1,
|
|
30787
|
+
borderRadius: borderRadius,
|
|
30788
|
+
fonts: fonts,
|
|
30789
|
+
typography: typography
|
|
30951
30790
|
});
|
|
30952
30791
|
|
|
30953
30792
|
class AnswerChoice extends React__namespace.Component {
|
|
@@ -44168,11 +44007,25 @@ const init = function (options) {
|
|
|
44168
44007
|
});
|
|
44169
44008
|
};
|
|
44170
44009
|
|
|
44010
|
+
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
44011
|
+
const libName = "@khanacademy/perseus";
|
|
44012
|
+
const libVersion = "12.0.0";
|
|
44013
|
+
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
44014
|
+
|
|
44015
|
+
const apiVersion = {
|
|
44016
|
+
major: 12,
|
|
44017
|
+
minor: 0
|
|
44018
|
+
};
|
|
44019
|
+
const itemDataVersion = {
|
|
44020
|
+
major: 0,
|
|
44021
|
+
minor: 1
|
|
44022
|
+
};
|
|
44023
|
+
|
|
44171
44024
|
var allWidgets = [...basicWidgets, ...extraWidgets];
|
|
44172
44025
|
|
|
44173
44026
|
registerWidgets(allWidgets);
|
|
44174
44027
|
const ItemVersion = getVersionVector();
|
|
44175
|
-
ItemVersion["::renderer::"] =
|
|
44028
|
+
ItemVersion["::renderer::"] = itemDataVersion;
|
|
44176
44029
|
|
|
44177
44030
|
class ArticleRenderer extends React__namespace.Component {
|
|
44178
44031
|
constructor(props) {
|
|
@@ -44733,6 +44586,9 @@ const ProvideKeypad = {
|
|
|
44733
44586
|
const {
|
|
44734
44587
|
mapObject: mapObject$1
|
|
44735
44588
|
} = objective_;
|
|
44589
|
+
/**
|
|
44590
|
+
* @depreciated use ServerItemRenderer
|
|
44591
|
+
*/
|
|
44736
44592
|
class ItemRenderer extends React__namespace.Component {
|
|
44737
44593
|
// @ts-expect-error - TS2564 - Property 'questionRenderer' has no initializer and is not definitely assigned in the constructor.
|
|
44738
44594
|
|
|
@@ -45886,24 +45742,256 @@ _defineProperty(RangeInput, "defaultProps", {
|
|
|
45886
45742
|
placeholder: [null, null]
|
|
45887
45743
|
});
|
|
45888
45744
|
|
|
45745
|
+
const prettyBig = {
|
|
45746
|
+
fontSize: "150%"
|
|
45747
|
+
};
|
|
45748
|
+
const slightlyBig = {
|
|
45749
|
+
fontSize: "120%"
|
|
45750
|
+
};
|
|
45751
|
+
const symbStyle = {
|
|
45752
|
+
fontSize: "130%"
|
|
45753
|
+
};
|
|
45754
|
+
// These are functions because we want to generate a new component for each use
|
|
45755
|
+
// on the page rather than reusing an instance (which will cause an error).
|
|
45756
|
+
// Also, it's useful for things which might look different depending on the
|
|
45757
|
+
// props.
|
|
45758
|
+
|
|
45759
|
+
const basic = [() => [/*#__PURE__*/React__namespace.createElement("span", {
|
|
45760
|
+
key: "plus",
|
|
45761
|
+
style: slightlyBig
|
|
45762
|
+
}, "+"), "PLUS", i18n__namespace._("Plus")], () => [/*#__PURE__*/React__namespace.createElement("span", {
|
|
45763
|
+
key: "minus",
|
|
45764
|
+
style: prettyBig
|
|
45765
|
+
}, "-"), "MINUS", i18n__namespace._("Minus")],
|
|
45766
|
+
// TODO(joel) - display as \cdot when appropriate
|
|
45767
|
+
props => {
|
|
45768
|
+
const {
|
|
45769
|
+
TeX
|
|
45770
|
+
} = getDependencies();
|
|
45771
|
+
if (props.convertDotToTimes) {
|
|
45772
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45773
|
+
key: "times",
|
|
45774
|
+
style: prettyBig
|
|
45775
|
+
}, i18n__namespace.doNotTranslate("\\times")), "TIMES", i18n__namespace._("Multiply")];
|
|
45776
|
+
}
|
|
45777
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45778
|
+
key: "times",
|
|
45779
|
+
style: prettyBig
|
|
45780
|
+
}, i18n__namespace.doNotTranslate("\\cdot")), "CDOT", i18n__namespace._("Multiply")];
|
|
45781
|
+
}, () => {
|
|
45782
|
+
const {
|
|
45783
|
+
TeX
|
|
45784
|
+
} = getDependencies();
|
|
45785
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45786
|
+
key: "frac",
|
|
45787
|
+
style: prettyBig
|
|
45788
|
+
}, i18n__namespace.doNotTranslate("\\frac{x}{y}")), "FRAC", i18n__namespace._("Fraction, excluding the current expression")];
|
|
45789
|
+
}];
|
|
45790
|
+
const buttonSets = {
|
|
45791
|
+
basic,
|
|
45792
|
+
"basic+div": basic.concat([() => {
|
|
45793
|
+
const {
|
|
45794
|
+
TeX
|
|
45795
|
+
} = getDependencies();
|
|
45796
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45797
|
+
key: "div"
|
|
45798
|
+
}, i18n__namespace.doNotTranslate("\\div")), "DIVIDE", i18n__namespace._("Divide")];
|
|
45799
|
+
}]),
|
|
45800
|
+
trig: [() => {
|
|
45801
|
+
const {
|
|
45802
|
+
TeX
|
|
45803
|
+
} = getDependencies();
|
|
45804
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45805
|
+
key: "sin"
|
|
45806
|
+
}, i18n__namespace.doNotTranslate("\\sin")), "SIN", i18n__namespace._("Sine")];
|
|
45807
|
+
}, () => {
|
|
45808
|
+
const {
|
|
45809
|
+
TeX
|
|
45810
|
+
} = getDependencies();
|
|
45811
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45812
|
+
key: "cos"
|
|
45813
|
+
}, i18n__namespace.doNotTranslate("\\cos")), "COS", i18n__namespace._("Cosine")];
|
|
45814
|
+
}, () => {
|
|
45815
|
+
const {
|
|
45816
|
+
TeX
|
|
45817
|
+
} = getDependencies();
|
|
45818
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45819
|
+
key: "tan"
|
|
45820
|
+
}, i18n__namespace.doNotTranslate("\\tan")), "TAN", i18n__namespace._("Tangent")];
|
|
45821
|
+
}, () => {
|
|
45822
|
+
const {
|
|
45823
|
+
TeX
|
|
45824
|
+
} = getDependencies();
|
|
45825
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45826
|
+
key: "theta",
|
|
45827
|
+
style: symbStyle
|
|
45828
|
+
}, i18n__namespace.doNotTranslate("\\theta")), "THETA", i18n__namespace._("Theta")];
|
|
45829
|
+
}, () => {
|
|
45830
|
+
const {
|
|
45831
|
+
TeX
|
|
45832
|
+
} = getDependencies();
|
|
45833
|
+
return [/*#__PURE__*/React__namespace.createElement("span", {
|
|
45834
|
+
key: "phi"
|
|
45835
|
+
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
45836
|
+
className: "perseus-sr-only"
|
|
45837
|
+
}, i18n__namespace.doNotTranslate("phi")), /*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45838
|
+
key: "pi",
|
|
45839
|
+
style: symbStyle
|
|
45840
|
+
}, i18n__namespace.doNotTranslate("\\phi"))), "PHI", i18n__namespace._("Phi")];
|
|
45841
|
+
}],
|
|
45842
|
+
prealgebra: [() => {
|
|
45843
|
+
const {
|
|
45844
|
+
TeX
|
|
45845
|
+
} = getDependencies();
|
|
45846
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45847
|
+
key: "sqrt"
|
|
45848
|
+
}, i18n__namespace.doNotTranslate("\\sqrt{x}")), "SQRT", i18n__namespace._("Square root")];
|
|
45849
|
+
},
|
|
45850
|
+
// TODO(joel) - how does desmos do this?
|
|
45851
|
+
() => {
|
|
45852
|
+
const {
|
|
45853
|
+
TeX
|
|
45854
|
+
} = getDependencies();
|
|
45855
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45856
|
+
key: "nthroot"
|
|
45857
|
+
}, i18n__namespace.doNotTranslate("\\sqrt[3]{x}")), "NTHROOT3", i18n__namespace._("Cube root")];
|
|
45858
|
+
}, () => {
|
|
45859
|
+
const {
|
|
45860
|
+
TeX
|
|
45861
|
+
} = getDependencies();
|
|
45862
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45863
|
+
key: "pow",
|
|
45864
|
+
style: slightlyBig
|
|
45865
|
+
}, i18n__namespace.doNotTranslate("a^b")), "POW", i18n__namespace._("Exponent")];
|
|
45866
|
+
}, () => {
|
|
45867
|
+
const {
|
|
45868
|
+
TeX
|
|
45869
|
+
} = getDependencies();
|
|
45870
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45871
|
+
key: "pi",
|
|
45872
|
+
style: slightlyBig
|
|
45873
|
+
}, i18n__namespace.doNotTranslate("\\pi")), "PI", i18n__namespace._("Pi")];
|
|
45874
|
+
}],
|
|
45875
|
+
logarithms: [() => {
|
|
45876
|
+
const {
|
|
45877
|
+
TeX
|
|
45878
|
+
} = getDependencies();
|
|
45879
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45880
|
+
key: "log"
|
|
45881
|
+
}, i18n__namespace.doNotTranslate("\\log")), "LOG", i18n__namespace._("Logarithm with base 10")];
|
|
45882
|
+
}, () => {
|
|
45883
|
+
const {
|
|
45884
|
+
TeX
|
|
45885
|
+
} = getDependencies();
|
|
45886
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45887
|
+
key: "ln"
|
|
45888
|
+
}, i18n__namespace.doNotTranslate("\\ln")), "LN", i18n__namespace._("Natural logarithm")];
|
|
45889
|
+
}, () => {
|
|
45890
|
+
const {
|
|
45891
|
+
TeX
|
|
45892
|
+
} = getDependencies();
|
|
45893
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45894
|
+
key: "log_b"
|
|
45895
|
+
}, i18n__namespace.doNotTranslate("\\log_b")), "LOG_B", i18n__namespace._("Logarithm with custom base")];
|
|
45896
|
+
}],
|
|
45897
|
+
"basic relations": [() => {
|
|
45898
|
+
const {
|
|
45899
|
+
TeX
|
|
45900
|
+
} = getDependencies();
|
|
45901
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45902
|
+
key: "eq"
|
|
45903
|
+
}, "="), "EQUAL", i18n__namespace._("Equals sign")];
|
|
45904
|
+
}, () => {
|
|
45905
|
+
const {
|
|
45906
|
+
TeX
|
|
45907
|
+
} = getDependencies();
|
|
45908
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45909
|
+
key: "lt"
|
|
45910
|
+
}, i18n__namespace.doNotTranslate("\\lt")), "LT", i18n__namespace._("Less than sign")];
|
|
45911
|
+
}, () => {
|
|
45912
|
+
const {
|
|
45913
|
+
TeX
|
|
45914
|
+
} = getDependencies();
|
|
45915
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45916
|
+
key: "gt"
|
|
45917
|
+
}, i18n__namespace.doNotTranslate("\\gt")), "GT", i18n__namespace._("Greater than sign")];
|
|
45918
|
+
}],
|
|
45919
|
+
"advanced relations": [() => {
|
|
45920
|
+
const {
|
|
45921
|
+
TeX
|
|
45922
|
+
} = getDependencies();
|
|
45923
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45924
|
+
key: "neq"
|
|
45925
|
+
}, i18n__namespace.doNotTranslate("\\neq")), "NEQ", i18n__namespace._("Not-equals sign")];
|
|
45926
|
+
}, () => {
|
|
45927
|
+
const {
|
|
45928
|
+
TeX
|
|
45929
|
+
} = getDependencies();
|
|
45930
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45931
|
+
key: "leq"
|
|
45932
|
+
}, i18n__namespace.doNotTranslate("\\leq")), "LEQ", i18n__namespace._("Less than or equal to sign")];
|
|
45933
|
+
}, () => {
|
|
45934
|
+
const {
|
|
45935
|
+
TeX
|
|
45936
|
+
} = getDependencies();
|
|
45937
|
+
return [/*#__PURE__*/React__namespace.createElement(TeX, {
|
|
45938
|
+
key: "geq"
|
|
45939
|
+
}, i18n__namespace.doNotTranslate("\\geq")), "GEQ", i18n__namespace._("Greater than or equal to sign")];
|
|
45940
|
+
}]
|
|
45941
|
+
};
|
|
45942
|
+
const buttonSetsPropType = PropTypes__default["default"].arrayOf(PropTypes__default["default"].oneOf(___default["default"](buttonSets).keys()));
|
|
45943
|
+
class TexButtons extends React__namespace.Component {
|
|
45944
|
+
render() {
|
|
45945
|
+
// Always show buttonSets in the same order. Note: Technically it's ok
|
|
45946
|
+
// for _.keys() to return the keys in an arbitrary order, but in
|
|
45947
|
+
// practice, they will be ordered as listed above.
|
|
45948
|
+
const sortedButtonSets = ___default["default"].sortBy(this.props.sets, setName => ___default["default"].keys(buttonSets).indexOf(setName));
|
|
45949
|
+
const buttons = ___default["default"](sortedButtonSets).map(setName => buttonSets[setName]);
|
|
45950
|
+
const buttonRows = ___default["default"](buttons).map(row => row.map(symbGen => {
|
|
45951
|
+
// create a (component, thing we should send to mathquill) pair
|
|
45952
|
+
const symbol = symbGen(this.props);
|
|
45953
|
+
return /*#__PURE__*/React__namespace.createElement("button", {
|
|
45954
|
+
onClick: () => this.props.onInsert(symbol[1]),
|
|
45955
|
+
className: "tex-button"
|
|
45956
|
+
// @ts-expect-error - TS2533 - Object is possibly 'null' or 'undefined'. | TS2339 - Property 'key' does not exist on type 'boolean | ReactChild | ReactFragment | ReactPortal'.
|
|
45957
|
+
,
|
|
45958
|
+
key: symbol[0].key,
|
|
45959
|
+
type: "button",
|
|
45960
|
+
"aria-label": symbol[2]
|
|
45961
|
+
}, symbol[0]);
|
|
45962
|
+
}));
|
|
45963
|
+
const buttonPopup = ___default["default"](buttonRows).map((row, i) => {
|
|
45964
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
45965
|
+
className: "clearfix tex-button-row",
|
|
45966
|
+
key: this.props.sets[i]
|
|
45967
|
+
}, row);
|
|
45968
|
+
});
|
|
45969
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
45970
|
+
className: "".concat(this.props.className || "", " preview-measure")
|
|
45971
|
+
}, buttonPopup);
|
|
45972
|
+
}
|
|
45973
|
+
}
|
|
45974
|
+
_defineProperty(TexButtons, "buttonSets", buttonSets);
|
|
45975
|
+
_defineProperty(TexButtons, "buttonSetsType", buttonSetsPropType);
|
|
45976
|
+
|
|
45889
45977
|
var components = /*#__PURE__*/Object.freeze({
|
|
45890
|
-
|
|
45891
|
-
|
|
45892
|
-
|
|
45893
|
-
|
|
45894
|
-
|
|
45895
|
-
|
|
45896
|
-
|
|
45897
|
-
|
|
45898
|
-
|
|
45899
|
-
|
|
45900
|
-
|
|
45901
|
-
|
|
45902
|
-
|
|
45903
|
-
|
|
45904
|
-
|
|
45905
|
-
|
|
45906
|
-
|
|
45978
|
+
__proto__: null,
|
|
45979
|
+
ButtonGroup: ButtonGroup,
|
|
45980
|
+
Graph: Graph,
|
|
45981
|
+
Graphie: Graphie,
|
|
45982
|
+
HUD: HUD,
|
|
45983
|
+
Icon: Icon,
|
|
45984
|
+
InfoTip: InfoTip,
|
|
45985
|
+
InlineIcon: InlineIcon,
|
|
45986
|
+
MathInput: MathInput,
|
|
45987
|
+
MultiButtonGroup: MultiButtonGroup,
|
|
45988
|
+
NumberInput: NumberInput,
|
|
45989
|
+
PropCheckBox: PropCheckBox,
|
|
45990
|
+
RangeInput: RangeInput,
|
|
45991
|
+
SvgImage: SvgImage,
|
|
45992
|
+
TextInput: TextInput,
|
|
45993
|
+
TexButtons: TexButtons,
|
|
45994
|
+
TextListEditor: TextListEditor
|
|
45907
45995
|
});
|
|
45908
45996
|
|
|
45909
45997
|
const devices = {
|
|
@@ -45922,10 +46010,10 @@ const lintGutterWidth = 36;
|
|
|
45922
46010
|
const perseusFrameBorderWidth = 1;
|
|
45923
46011
|
|
|
45924
46012
|
var constants = /*#__PURE__*/Object.freeze({
|
|
45925
|
-
|
|
45926
|
-
|
|
45927
|
-
|
|
45928
|
-
|
|
46013
|
+
__proto__: null,
|
|
46014
|
+
devices: devices,
|
|
46015
|
+
lintGutterWidth: lintGutterWidth,
|
|
46016
|
+
perseusFrameBorderWidth: perseusFrameBorderWidth
|
|
45929
46017
|
});
|
|
45930
46018
|
|
|
45931
46019
|
// TODO(FEI-4010): Remove `Perseus` prefix for all types here
|
|
@@ -47042,10 +47130,6 @@ const EditorJsonify = {
|
|
|
47042
47130
|
}
|
|
47043
47131
|
};
|
|
47044
47132
|
|
|
47045
|
-
/* eslint-disable @khanacademy/ts-no-error-suppressions */
|
|
47046
|
-
const apiVersion = version.apiVersion;
|
|
47047
|
-
const itemDataVersion = version.itemDataVersion;
|
|
47048
|
-
|
|
47049
47133
|
exports.ApiOptions = ApiOptions;
|
|
47050
47134
|
exports.ArrowPicker = ArrowPicker;
|
|
47051
47135
|
exports.ArticleRenderer = ArticleRenderer;
|
|
@@ -47104,6 +47188,7 @@ exports.isItemRenderableByVersion = isItemRenderableByVersion;
|
|
|
47104
47188
|
exports.itemDataVersion = itemDataVersion;
|
|
47105
47189
|
exports.itemToTree = itemToTree;
|
|
47106
47190
|
exports.itemVersion = ItemVersion;
|
|
47191
|
+
exports.libVersion = libVersion;
|
|
47107
47192
|
exports.mediaQueries = mediaQueries;
|
|
47108
47193
|
exports.preprocessTex = preprocessTex;
|
|
47109
47194
|
exports.registerAllWidgetsForTesting = registerAllWidgetsForTesting;
|