@khanacademy/perseus-editor 2.13.0 → 2.14.1
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 +25 -0
- package/dist/es/index.js +30 -12
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +30 -12
- package/dist/index.js.map +1 -1
- package/dist/item-extras-editor.d.ts +12 -12
- package/dist/widgets/label-image/behavior.d.ts +4 -1
- package/package.json +9 -9
- package/src/__tests__/items-extras-editors.test.tsx +68 -0
- package/src/item-extras-editor.tsx +17 -13
- package/src/widgets/label-image/__stories__/behavior.stories.tsx +1 -1
- package/src/widgets/label-image/behavior.tsx +32 -0
- package/src/widgets/label-image-editor.tsx +1 -0
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n$1);
|
|
|
64
64
|
|
|
65
65
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
66
66
|
const libName = "@khanacademy/perseus-editor";
|
|
67
|
-
const libVersion = "2.
|
|
67
|
+
const libVersion = "2.14.1";
|
|
68
68
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
69
69
|
|
|
70
70
|
function _extends() {
|
|
@@ -23834,15 +23834,6 @@ const {
|
|
|
23834
23834
|
InfoTip: InfoTip$m
|
|
23835
23835
|
} = perseus.components;
|
|
23836
23836
|
class ItemExtrasEditor extends React__namespace.Component {
|
|
23837
|
-
static propTypes = {
|
|
23838
|
-
calculator: PropTypes__default["default"].bool,
|
|
23839
|
-
chi2Table: PropTypes__default["default"].bool,
|
|
23840
|
-
onChange: PropTypes__default["default"].func.isRequired,
|
|
23841
|
-
periodicTable: PropTypes__default["default"].bool,
|
|
23842
|
-
periodicTableWithKey: PropTypes__default["default"].bool,
|
|
23843
|
-
tTable: PropTypes__default["default"].bool,
|
|
23844
|
-
zTable: PropTypes__default["default"].bool
|
|
23845
|
-
};
|
|
23846
23837
|
static defaultProps = {
|
|
23847
23838
|
calculator: false,
|
|
23848
23839
|
chi2Table: false,
|
|
@@ -23879,7 +23870,11 @@ class ItemExtrasEditor extends React__namespace.Component {
|
|
|
23879
23870
|
checked: this.props.periodicTable,
|
|
23880
23871
|
onChange: e => {
|
|
23881
23872
|
this.props.onChange({
|
|
23882
|
-
periodicTable: e.target.checked
|
|
23873
|
+
periodicTable: e.target.checked,
|
|
23874
|
+
// If the periodic table is unchecked,
|
|
23875
|
+
// this needs to be reset. If table is
|
|
23876
|
+
// checked, it should already be false.
|
|
23877
|
+
periodicTableWithKey: false
|
|
23883
23878
|
});
|
|
23884
23879
|
}
|
|
23885
23880
|
})), /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, "This provides the student with the ability to view a periodic table of the elements, e.g., for answering chemistry questions.")), this.props.periodicTable && /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Include key/legend with periodic table:", " ", /*#__PURE__*/React__namespace.createElement("input", {
|
|
@@ -30911,6 +30906,7 @@ const Behavior = _ref => {
|
|
|
30911
30906
|
let {
|
|
30912
30907
|
multipleAnswers,
|
|
30913
30908
|
hideChoicesFromInstructions,
|
|
30909
|
+
preferredPopoverDirection,
|
|
30914
30910
|
onChange
|
|
30915
30911
|
} = _ref;
|
|
30916
30912
|
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -30933,7 +30929,28 @@ const Behavior = _ref => {
|
|
|
30933
30929
|
})
|
|
30934
30930
|
}), /*#__PURE__*/React__namespace.createElement("span", {
|
|
30935
30931
|
className: aphrodite.css(styles$5.label)
|
|
30936
|
-
}, "Do not display answer choices in instructions"))
|
|
30932
|
+
}, "Do not display answer choices in instructions")), /*#__PURE__*/React__namespace.createElement("li", {
|
|
30933
|
+
className: aphrodite.css(styles$5.option)
|
|
30934
|
+
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
30935
|
+
className: aphrodite.css(styles$5.label)
|
|
30936
|
+
}, "Preferred pop-over direction"), /*#__PURE__*/React__namespace.createElement("select", {
|
|
30937
|
+
value: preferredPopoverDirection,
|
|
30938
|
+
onChange: e => {
|
|
30939
|
+
onChange({
|
|
30940
|
+
preferredPopoverDirection: e.target.value
|
|
30941
|
+
});
|
|
30942
|
+
}
|
|
30943
|
+
}, /*#__PURE__*/React__namespace.createElement("option", {
|
|
30944
|
+
value: "NONE"
|
|
30945
|
+
}, " No Preference "), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30946
|
+
value: "UP"
|
|
30947
|
+
}, " Up "), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30948
|
+
value: "DOWN"
|
|
30949
|
+
}, " Down "), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30950
|
+
value: "LEFT"
|
|
30951
|
+
}, " Left "), /*#__PURE__*/React__namespace.createElement("option", {
|
|
30952
|
+
value: "RIGHT"
|
|
30953
|
+
}, " Right ")))));
|
|
30937
30954
|
};
|
|
30938
30955
|
const styles$5 = aphrodite.StyleSheet.create({
|
|
30939
30956
|
title: {
|
|
@@ -31722,6 +31739,7 @@ class LabelImageEditor extends React__namespace.Component {
|
|
|
31722
31739
|
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
31723
31740
|
className: aphrodite.css(styles.largeSpacer)
|
|
31724
31741
|
}), /*#__PURE__*/React__namespace.createElement(Behavior, {
|
|
31742
|
+
preferredPopoverDirection: "NONE",
|
|
31725
31743
|
multipleAnswers: multipleAnswers,
|
|
31726
31744
|
hideChoicesFromInstructions: hideChoicesFromInstructions,
|
|
31727
31745
|
onChange: this.handleBehaviorChange
|