@khanacademy/perseus 19.6.1 → 19.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +13 -17
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/dist/widgets/categorizer.d.ts +1 -1
- package/package.json +2 -2
package/dist/es/index.js
CHANGED
|
@@ -24184,13 +24184,6 @@ class Categorizer extends React.Component {
|
|
|
24184
24184
|
this.getUserInput = () => {
|
|
24185
24185
|
return Categorizer.getUserInputFromProps(this.props);
|
|
24186
24186
|
};
|
|
24187
|
-
this.onChange = (itemNum, catNum) => {
|
|
24188
|
-
const values = [...this.props.values];
|
|
24189
|
-
// @ts-expect-error - TS2322 - Type 'number' is not assignable to type 'never'.
|
|
24190
|
-
values[itemNum] = catNum;
|
|
24191
|
-
this.change("values", values);
|
|
24192
|
-
this.props.trackInteraction();
|
|
24193
|
-
};
|
|
24194
24187
|
this.simpleValidate = rubric => {
|
|
24195
24188
|
return Categorizer.validate(this.getUserInput(), rubric);
|
|
24196
24189
|
};
|
|
@@ -24242,18 +24235,14 @@ class Categorizer extends React.Component {
|
|
|
24242
24235
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24243
24236
|
className: ClassNames.INTERACTIVE,
|
|
24244
24237
|
role: "button",
|
|
24245
|
-
"aria-label": catName
|
|
24246
|
-
|
|
24247
|
-
,
|
|
24248
|
-
onClick: this.onChange.bind(this, itemNum, catNum)
|
|
24238
|
+
"aria-label": catName,
|
|
24239
|
+
onClick: () => this.onChange(itemNum, catNum)
|
|
24249
24240
|
}, isMobile && /*#__PURE__*/React.createElement("input", {
|
|
24250
24241
|
type: "radio",
|
|
24251
24242
|
name: uniqueId,
|
|
24252
24243
|
className: css(sharedStyles.responsiveInput, sharedStyles.responsiveRadioInput),
|
|
24253
|
-
checked: selected
|
|
24254
|
-
|
|
24255
|
-
,
|
|
24256
|
-
onChange: this.onChange.bind(this, itemNum, catNum),
|
|
24244
|
+
checked: selected,
|
|
24245
|
+
onChange: () => this.onChange(itemNum, catNum),
|
|
24257
24246
|
onClick: e => e.stopPropagation()
|
|
24258
24247
|
}), !isMobile && /*#__PURE__*/React.createElement("span", {
|
|
24259
24248
|
className: css(styles$r.radioSpan, selected && styles$r.checkedRadioSpan, this.props.static && selected && styles$r.staticCheckedRadioSpan)
|
|
@@ -24273,10 +24262,17 @@ class Categorizer extends React.Component {
|
|
|
24273
24262
|
className: extraClassNames + " " + css(...inlineStyles)
|
|
24274
24263
|
}, table);
|
|
24275
24264
|
}
|
|
24265
|
+
onChange(itemNum, catNum) {
|
|
24266
|
+
const values = [...this.props.values];
|
|
24267
|
+
// @ts-expect-error - TS2322 - Type 'number' is not assignable to type 'never'.
|
|
24268
|
+
values[itemNum] = catNum;
|
|
24269
|
+
this.change("values", values);
|
|
24270
|
+
this.props.trackInteraction();
|
|
24271
|
+
}
|
|
24276
24272
|
static validate(userInput, rubric) {
|
|
24277
24273
|
let completed = true;
|
|
24278
24274
|
let allCorrect = true;
|
|
24279
|
-
|
|
24275
|
+
rubric.values.forEach((value, i) => {
|
|
24280
24276
|
if (userInput.values[i] == null) {
|
|
24281
24277
|
completed = false;
|
|
24282
24278
|
}
|
|
@@ -41554,7 +41550,7 @@ const init = function init(options) {
|
|
|
41554
41550
|
|
|
41555
41551
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
41556
41552
|
const libName = "@khanacademy/perseus";
|
|
41557
|
-
const libVersion = "19.6.
|
|
41553
|
+
const libVersion = "19.6.2";
|
|
41558
41554
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41559
41555
|
|
|
41560
41556
|
const apiVersion = {
|